From patchwork Fri May 21 22:36:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F74AC4707A for ; Fri, 21 May 2021 22:37:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 748D6613D8 for ; Fri, 21 May 2021 22:37:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229979AbhEUWi3 (ORCPT ); Fri, 21 May 2021 18:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbhEUWi2 (ORCPT ); Fri, 21 May 2021 18:38:28 -0400 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38F52C061574 for ; Fri, 21 May 2021 15:37:05 -0700 (PDT) Received: by mail-ot1-x329.google.com with SMTP id g7-20020a9d12870000b0290328b1342b73so11592318otg.9 for ; Fri, 21 May 2021 15:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zSaGUKSATA0J/8fyUa8ihu0eEXgmsvBLcy1cUDmnHBI=; b=HowY+mLLoQKjQwC63taRMMytfQW3JCX91pg6CUkAyoHAg2/dDDr+o4b4Yj7Yuz2FBh fM9s65aHr0z67arop7DeyRkH3xiYnas2MV7MdO72EzGqn3dGuRWVnulqAvdvyJC9OYGj DbYyWXmbGckfPiXkos7B7bMPdx2VYpwqS1CWeZv1J608ufp5lgEZ61xD9GwncEWGnYWZ 5hbuHLDMJq9oYb5KvUYphsJNTX9X/WyL8j663+Flf0+UbGLh96rAOkW8sggE91cX7MNj woccmyhA/QSx2NuepokWYVS+cELWvo76DE5ePiz0npezDXT9juC/WcQC7LLrB5PCWNdA ud7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zSaGUKSATA0J/8fyUa8ihu0eEXgmsvBLcy1cUDmnHBI=; b=N4RdLZyRXlDu43MrOHsmWxmp8CF9EibAapLTr5xy12+kfBrIU5AmTMvkv/FYMQ/4kC rUL3Tq2YxDKGNfLREQ8JSIEdQMmNyEjHg/3eeJDLoEs2dRl5yAX8Rmrix/jfT86PF5Sa G/+aUdKjC4YHadn4YxsRY/esF2sU/oMyBG+vyEU8k//cdgQlrLx63rn3nOsjaa9kB00x KJgfEUjDAJ+9MsQM/ECRh1r3AHVgXJrCWOFPQL8Ibzs+a6dtMW4WLAJEJaDOimRQ/cLi MHXv2gLT2T6ZXvKXLmylPzve2e66bPaI7xJv4xkl/8VQ6BcCsNGVLl58AoYkJ87ax4xo oX7Q== X-Gm-Message-State: AOAM530wajcvkWlzMImI+sgbLwbg5euMdAzwacOFAai1jrSXmgvvQ5P8 wAHRMuS8s3Ov1PAxcu8joZxuyZLjK0UqFw== X-Google-Smtp-Source: ABdhPJwLHRUAyWF+oXAJIWkaMlQ46DzJHTXrYbi7gIsHHQoJPC4yR7BivHe/l+Kbl3XYns/Y/AjfSA== X-Received: by 2002:a9d:366:: with SMTP id 93mr10319245otv.323.1621636624323; Fri, 21 May 2021 15:37:04 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id i4sm922569oih.13.2021.05.21.15.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:03 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 01/12] doc: remove GNU troff workaround Date: Fri, 21 May 2021 17:36:50 -0500 Message-Id: <20210521223701.526547-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In 2007 the docbook project made the mistake of converting ' to \' for man pages [1]. It's a problem because groff interprets \' as acute accent which is rendered as ' in ASCII, but as ยด in utf-8. This started a cascade of bug reports in git [2], debian [3], Arch Linux [4], docbook itself [5], and probably many others. A solution was to use the correct groff character: \(aq, which is always rendered as ', but the problem is that such character doesn't work in other troff programs. A portable solution required the use of a conditional character that is \(aq in groff, but ' in all others: .ie \n(.g .ds Aq \(aq .el .ds Aq ' The proper solution took time to be implemented in docbook, but in 2010 they did it [6]. So the docbook man page stylesheets were broken from 1.73 to 1.76. Unfortunately by that point many workarounds already existed. In the case of git GNU_ROFF was introduced, and in the case of Arch Linux a mappig from \' to ' was added to groff's man.local. Other distributions might have done the same, or similar workarounds. Since 2010 there is not need for this workaround, which is fixed elsewhere not just in docbook, but other layers as well. Let's remove it. Also, it's GNU troff, not GNU roff. [1] https://github.com/docbook/xslt10-stylesheets/commit/ea2a0bac56c56eec1892ac3d9254dca89f7c5746 [2] https://lore.kernel.org/git/20091012102926.GA3937@debian.b2j/ [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=507673#65 [4] https://bugs.archlinux.org/task/9643 [5] https://sourceforge.net/p/docbook/bugs/1022/ [6] https://github.com/docbook/xslt10-stylesheets/commit/fb553434265906ed81edc6d5f533d0b08d200046 Inspired-by: brian m. carlson Signed-off-by: Felipe Contreras --- Documentation/Makefile | 8 -------- Documentation/manpage-quote-apos.xsl | 16 ---------------- Makefile | 4 ---- 3 files changed, 28 deletions(-) delete mode 100644 Documentation/manpage-quote-apos.xsl diff --git a/Documentation/Makefile b/Documentation/Makefile index f5605b7767..bf1f66b3eb 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -178,14 +178,6 @@ MAN_BASE_URL = file://$(htmldir)/ endif XMLTO_EXTRA += -m manpage-base-url.xsl -# If your target system uses GNU groff, it may try to render -# apostrophes as a "pretty" apostrophe using unicode. This breaks -# cut&paste, so you should set GNU_ROFF to force them to be ASCII -# apostrophes. Unfortunately does not work with non-GNU roff. -ifdef GNU_ROFF -XMLTO_EXTRA += -m manpage-quote-apos.xsl -endif - ifdef USE_ASCIIDOCTOR ASCIIDOC = asciidoctor ASCIIDOC_CONF = diff --git a/Documentation/manpage-quote-apos.xsl b/Documentation/manpage-quote-apos.xsl deleted file mode 100644 index aeb8839f33..0000000000 diff --git a/Makefile b/Makefile index 3a2d3c80a8..55dbdee98e 100644 --- a/Makefile +++ b/Makefile @@ -278,10 +278,6 @@ all:: # Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks # field that counts the on-disk footprint in 512-byte blocks. # -# Define GNU_ROFF if your target system uses GNU groff. This forces -# apostrophes to be ASCII so that cut&pasting examples to the shell -# will work. -# # Define USE_ASCIIDOCTOR to use Asciidoctor instead of AsciiDoc to build the # documentation. # From patchwork Fri May 21 22:36:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 597E0C04FF3 for ; Fri, 21 May 2021 22:37:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37320613D8 for ; Fri, 21 May 2021 22:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230031AbhEUWic (ORCPT ); Fri, 21 May 2021 18:38:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbhEUWib (ORCPT ); Fri, 21 May 2021 18:38:31 -0400 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD779C061574 for ; Fri, 21 May 2021 15:37:06 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id b25so21168474oic.0 for ; Fri, 21 May 2021 15:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LcHlKLi9XHJ5zeaM219u//KyMDQfD2a0BXuqf+hmn8M=; b=YjK7mZ2tTIqpNMsfRS7GBxnjVwM/zYX0YNwRpRdGsXI/6UhYjSqWvM6v/8yZxPr1J9 gFIqjwIxsN6IQRtut5wYTnVLBzR1sXz8tXHh0BYxqbpoBb7EdO+Z3WCc6RD0ElTcscP4 6z1yEC8Z3gnidmm54HjRvRn+1SYURvjZhTzAWKSvcjWobdh2u137wEN3O+HEPW8aoK2w JgZjNNz+rblYu7AC70Tr9R8n+3U303bw4zRxCRFqtYxM17IWIZ2CWnJefUDU2yMUMANk B5h4EZYRzfEfaw2+FOir26dM96fo6lf/nRWiwxO31WRzS0OghpCCLRDEVYy4QGKofNUm Sc4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LcHlKLi9XHJ5zeaM219u//KyMDQfD2a0BXuqf+hmn8M=; b=KFIbKQFBp05BtK/v3kyBkcdDn1B4B8dHnGU99alUSkNHJ0cuIEZUR3cewuf54JEhCo tchesLArf6akVAT3lKIk+I/Ogza4tkvhapy+gmssHOm4NXxAWR3wZT7t003zx34YWHIk xr12FTzC9HTywbnU7fyXmBzsTJn1IkAslpfjM1c6GCRbMYS7ySiEb7byHq4spdfdTHcP h+EDAW4M8AU5Hl1YcZ8hK4/Ou+kEIrZu3fEHemYF9yTn1i7l3Oy6BMLQJqnT1tHN02Xw kL+wqJ2RKjx+h73OVFVq2AREXefxSw0tiZvorfATZ1md9ui5p+K4qSyA2QcLY3z/dDYn NQuA== X-Gm-Message-State: AOAM5309AOZ4aPLyq92Q1+ICNNU+C85SL5OBSDIqCJSm/FMaBv0box1n T+GdbfwoIwL7Uvjl3Xg7oh0bpmIdsu3EVQ== X-Google-Smtp-Source: ABdhPJzOFDcn8GgCfHltCke4arhqigRtXVpzr+ZeN95wvuJJNNAYxAf9B79hWstm3WJbsXq8iAfomQ== X-Received: by 2002:aca:44a:: with SMTP id 71mr3656863oie.39.1621636626017; Fri, 21 May 2021 15:37:06 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id p1sm1609375otk.58.2021.05.21.15.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:05 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 02/12] doc: use --stringparam in xmlto Date: Fri, 21 May 2021 17:36:51 -0500 Message-Id: <20210521223701.526547-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Commit 50d9bbba92 (Documentation: Avoid use of xmlto --stringparam, 2009-12-04) introduced manpage-base-url.xsl because ancient versions of xmlto did not have --stringparam. However, that was more than ten years ago, no need for that complexity anymore. Signed-off-by: Felipe Contreras --- Documentation/.gitignore | 1 - Documentation/Makefile | 8 ++------ Documentation/manpage-base-url.xsl.in | 10 ---------- 3 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 Documentation/manpage-base-url.xsl.in diff --git a/Documentation/.gitignore b/Documentation/.gitignore index 9022d48355..e9f8d693b1 100644 --- a/Documentation/.gitignore +++ b/Documentation/.gitignore @@ -10,7 +10,6 @@ howto-index.txt doc.dep cmds-*.txt mergetools-*.txt -manpage-base-url.xsl SubmittingPatches.txt tmp-doc-diff/ GIT-ASCIIDOCFLAGS diff --git a/Documentation/Makefile b/Documentation/Makefile index bf1f66b3eb..84643a34e9 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -176,7 +176,7 @@ endif ifndef MAN_BASE_URL MAN_BASE_URL = file://$(htmldir)/ endif -XMLTO_EXTRA += -m manpage-base-url.xsl +XMLTO_EXTRA += --stringparam man.base.url.for.relative.links='$(MAN_BASE_URL)' ifdef USE_ASCIIDOCTOR ASCIIDOC = asciidoctor @@ -342,7 +342,6 @@ clean: $(RM) technical/*.html technical/api-index.txt $(RM) SubmittingPatches.txt $(RM) $(cmds_txt) $(mergetools_txt) *.made - $(RM) manpage-base-url.xsl $(RM) GIT-ASCIIDOCFLAGS $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS) @@ -351,10 +350,7 @@ $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS) $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS) $(QUIET_ASCIIDOC)$(TXT_TO_HTML) -o $@ $< -manpage-base-url.xsl: manpage-base-url.xsl.in - $(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@ - -%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl) +%.1 %.5 %.7 : %.xml $(wildcard manpage*.xsl) $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< %.xml : %.txt $(ASCIIDOC_DEPS) diff --git a/Documentation/manpage-base-url.xsl.in b/Documentation/manpage-base-url.xsl.in deleted file mode 100644 index e800904df3..0000000000 From patchwork Fri May 21 22:36:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B89B6C4707A for ; Fri, 21 May 2021 22:37:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F2E86128A for ; Fri, 21 May 2021 22:37:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbhEUWid (ORCPT ); Fri, 21 May 2021 18:38:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbhEUWic (ORCPT ); Fri, 21 May 2021 18:38:32 -0400 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77CA9C061574 for ; Fri, 21 May 2021 15:37:08 -0700 (PDT) Received: by mail-ot1-x333.google.com with SMTP id r26-20020a056830121ab02902a5ff1c9b81so19425400otp.11 for ; Fri, 21 May 2021 15:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZY08OiHT1yl6uv7E2pgFnP7wdYDcAdVofYB9KZKxJz0=; b=RtlYQMey3OHgZPGCEOT0lUayyolOD2YsZPeDRA9hxWuF1bkTYoQBiTBtwp1+CyKhzq 1CfvzccWEqAXLgQyrNAfbRRZzOwT8BBYqSuONGWnfKcRAd2LY6Y9zOz/fXO25r8VndjU CcfhdaDK/9SvuGD1pwezsNxK+iAdHEZsH9/RIlscuMiKhpMi0O3aZGNtmS4ARcOTFROY praZ4H/UIw0E5XIrd+7//2hpAlviK50q9hYq43Ipayw2OfMAXUSq+RaaaXbf/XuC0DSo fDcVhAgbkO1GWGVD3qrBEPPItk+aYeTBpSPC2OfbLExsRoY6JZkBmGhLDp6WihXEISfU /vog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZY08OiHT1yl6uv7E2pgFnP7wdYDcAdVofYB9KZKxJz0=; b=h/yy4M540Sz97rypZslk5cu2WL7oaGCER7/sblYqMcwRBGHg1t1u7a622Y9VcUx2Jb Xzb7sGnYntrVLSBu38qszQBYEtQ0iOsmbbdCbFHDw9M/3Ue5ezPXBf2TVRGM18+8IC+T bqKl/RMhrtAa/mRitm/5lzmeNUyw3GRgocmx1N9WVn5szrL09SQ7eHBPSp4eTCT/7an3 Tu4knO99AHuYAkrVGudjqRuS4WroDvIpK6hURVWYz+vDZVW86P6kWenhk+YMAWUt42eH EwU7gIFFfcJKpaaPhaTUq9H8JFI+8KOS5OFuxHrT+SHc9iE3m3UohV/qppiEM4RnkTOW hPnQ== X-Gm-Message-State: AOAM530MDfekfqWWlizA/9d50W1367/fTCdmmKdkmUEgTv9gvM3jkE/b O6kUyCxgiUl7pJRRRmmlUtknr8Ei4KELeQ== X-Google-Smtp-Source: ABdhPJykp93hphR0ZHVTCpI/FarNa0u9wOtMBt2rLzSm9Uws/TPgb94m6PWLIN9NPN+Dr7zqugifQw== X-Received: by 2002:a05:6830:1251:: with SMTP id s17mr10355388otp.81.1621636627610; Fri, 21 May 2021 15:37:07 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id n5sm1567695otq.69.2021.05.21.15.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:07 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 03/12] doc: simplify version passing Date: Fri, 21 May 2021 17:36:52 -0500 Message-Id: <20210521223701.526547-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The code to pass the version of the man page comes from 2007: 7ef195ba3e (Documentation: Add version information to man pages, 2007-03-25). However, both asciidoc and asciidoctor already do this by default. Asciidoctor doesn't read manversion, but there's no need since both tools just join mansource and manversion. Let's do that ourselves and get rid of a bunch of code. Signed-off-by: Felipe Contreras --- Documentation/Makefile | 3 +-- Documentation/asciidoc.conf | 19 ------------------- Documentation/asciidoctor-extensions.rb | 17 ----------------- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 84643a34e9..47053c78f8 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -137,8 +137,7 @@ ASCIIDOC_HTML = xhtml11 ASCIIDOC_DOCBOOK = docbook ASCIIDOC_CONF = -f asciidoc.conf ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \ - -amanversion=$(GIT_VERSION) \ - -amanmanual='Git Manual' -amansource='Git' + -amanmanual='Git Manual' -amansource='Git $(GIT_VERSION)' ASCIIDOC_DEPS = asciidoc.conf GIT-ASCIIDOCFLAGS TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML) TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK) diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf index 3e4c13971b..60f76f43ed 100644 --- a/Documentation/asciidoc.conf +++ b/Documentation/asciidoc.conf @@ -51,25 +51,6 @@ ifdef::doctype-manpage[] endif::doctype-manpage[] endif::backend-docbook[] -ifdef::doctype-manpage[] -ifdef::backend-docbook[] -[header] -template::[header-declarations] - - -{mantitle} -{manvolnum} -{mansource} -{manversion} -{manmanual} - - - {manname} - {manpurpose} - -endif::backend-docbook[] -endif::doctype-manpage[] - ifdef::backend-xhtml11[] [attributes] git-relative-html-prefix= diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index d906a00803..70a0956663 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -23,26 +23,9 @@ module Git end end end - - class DocumentPostProcessor < Asciidoctor::Extensions::Postprocessor - def process document, output - if document.basebackend? 'docbook' - mansource = document.attributes['mansource'] - manversion = document.attributes['manversion'] - manmanual = document.attributes['manmanual'] - new_tags = "" \ - "#{mansource}\n" \ - "#{manversion}\n" \ - "#{manmanual}\n" - output = output.sub(/<\/refmeta>/, new_tags + "") - end - output - end - end end end Asciidoctor::Extensions.register do inline_macro Git::Documentation::LinkGitProcessor, :linkgit - postprocessor Git::Documentation::DocumentPostProcessor end From patchwork Fri May 21 22:36:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274035 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 590F3C04FF3 for ; Fri, 21 May 2021 22:37:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 367CD6128A for ; Fri, 21 May 2021 22:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230059AbhEUWii (ORCPT ); Fri, 21 May 2021 18:38:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbhEUWie (ORCPT ); Fri, 21 May 2021 18:38:34 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14706C061574 for ; Fri, 21 May 2021 15:37:10 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id r26-20020a056830121ab02902a5ff1c9b81so19425451otp.11 for ; Fri, 21 May 2021 15:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L/P3GbnSpAi4jwHpDCRO08gI9/rsuAByW+B+eYDPeMY=; b=tcamo9MO/ceVbr4CtrTcY177a0pzRSFylkjvhLgiQy6EMV2CgH26WAlkmccwISeKAU JuiuXzib1o+0GPtrzwJyWfRmt48m9Fh7vakcKUomRsjjX+3GGXoDFlg/92WJVpnxbsgq 0oP4PPz31hO1dn3rWSMViwDGBt/qatTGmehrepSURMTM69kGBICUEMnWH96VqFvqUjMF qhfKelGWGI5eVbm5KmE/LA0ssELPNB3UR+XYr/YK8mGyMrMaWjqLA1/nAbbfNImkZq1F SXrMORZIAm47gAj9tHrteb2ijpW8v0FXAcuck3AXzejxQ5QulfTBg6yOocsu6aV0itVF rk+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L/P3GbnSpAi4jwHpDCRO08gI9/rsuAByW+B+eYDPeMY=; b=g8tndmIfC3GwvxstIPdmtWubXrVg1OtrqqXWTBWhIypnXuP+1p/yD72EGZcKhjPRWG frCGe0sYbW795cshKhs7qoBHRsl+ZrIOp7VZ0TYd1JIcHzVr+D2OviREOMb85m5eCB6d 9i03hY4wYa8agZAWEvrB3oEho8wj9R+0DaOmJi0xdzeTpbv+FVa0z0u+wPYJsTjAjdH3 7aIqzqWwR6V2RbzhLqay6Oom1YrafPj9THYQpq2AzBtyOkZfaWLdTev5wv+QCCGl+CuG 8m3V3dghL7ryePgk41bofYXZ2LmjNyUdPewjhQLttPI2zDlmWETX4Atky8w2LNmLMWdD 82tg== X-Gm-Message-State: AOAM530hf0x7nDmrTlyZuUANk30sXno7+GDPdssS8xqPRkCx1oOQNFtD 2XvBnoiT/f43s+co5uo0jEId0kLsb3+iWg== X-Google-Smtp-Source: ABdhPJxC6VmaMIGu/qLFlZZChWA/9WsI5Dg8qzUa9QLhqeN9/HT4tcaBgowRikv9Zzqt4LCyJIo3jQ== X-Received: by 2002:a05:6830:1544:: with SMTP id l4mr10403563otp.154.1621636629213; Fri, 21 May 2021 15:37:09 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id w10sm1472589ott.75.2021.05.21.15.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:08 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 04/12] doc: asciidoc: remove unnecessary attribute Date: Fri, 21 May 2021 17:36:53 -0500 Message-Id: <20210521223701.526547-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org It's part of asciidoc global configuration since 2012. Signed-off-by: Felipe Contreras --- Documentation/asciidoc.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf index 60f76f43ed..f7908f9dea 100644 --- a/Documentation/asciidoc.conf +++ b/Documentation/asciidoc.conf @@ -12,7 +12,6 @@ [attributes] asterisk=* -plus=+ caret=^ startsb=[ endsb=] From patchwork Fri May 21 22:36:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CBC6C04FF3 for ; Fri, 21 May 2021 22:37:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DEF07613AF for ; Fri, 21 May 2021 22:37:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbhEUWij (ORCPT ); Fri, 21 May 2021 18:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230062AbhEUWig (ORCPT ); Fri, 21 May 2021 18:38:36 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD7DFC0613CE for ; Fri, 21 May 2021 15:37:11 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id y76so11839624oia.6 for ; Fri, 21 May 2021 15:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AUeBTCbvRvCVU56Lhu+lrJaMRNaVUL+GG3sub/sPFiY=; b=aIMMpm8DpvOOtv8HG8/MpypDvGuDZRmgWrCnvaKfYa9iTXKjMAReyEW9avM6WmbDqo NI6RDvq83RJH68M5asTn6Jlr5coLlThtdTWVTHF1fCJMJUQV74N96NPU9GSEl3+wXlwK Bz4uLs2X+yaQ+t93ESG9eFDEhmkdYdz+u9SneKQyn5ZKeThqEfkUvrA4+lbRDjRzgEP5 FmowZoZJTMmF3RRNoXECS0BrkXaAnxsgHUWxIhLIuiOp3tDEst5p3TH4dNJC++Btb9tu +iOEGnItMOJjK+ihD+GWHDqiSVa9GHTI8U9mhxGq8wTVr+veMnj6RUTihNLAyEQRrVtA LJFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AUeBTCbvRvCVU56Lhu+lrJaMRNaVUL+GG3sub/sPFiY=; b=O01NgU0YFYP4PEsoLmKG808LLnhS12xz5TD3yf0qNJNYlhb3Seek06EAlzxbAdoXtD jYtZNGwJQ2IEIr9BoB3/YoBgr8aUW8FuZKc0/WjqpOUdNgtLZOeEWlOs2bdpDh3sH8fy qTy2OUXPjLVC2XAPL8IpQMsYz0aAvKCE2LjscN1/B0bgVy0U2NJqWGWXirl+xutI/g0V TQ/ALwWPl0Bo6ZJHDZPyS0fVsCms+r6jzzhr4+QMgtTWjmqhxR+hbS7DBoy1QBVOacSx IF4J569FDjOL9dN9lSo+yYE9O0imvla4NWcdX+b4Pmnnky/pGBKiGZRU9oSkXHMKXD9C 1MoQ== X-Gm-Message-State: AOAM530D+Vh9LquoQ+35kMejv4TL5Py/VKY++UsgFqQYfklTIfSJKEmT NlEqxqWTBts7/s44/NAkr9qIPKz0d5SSsQ== X-Google-Smtp-Source: ABdhPJzf7Jx19bhFJdmMyDiDXyWfOCQ5W6gKdXPNN0CEArrWqgjAt0JA8oNUVVPx5psRik6TLwmfRA== X-Received: by 2002:a05:6808:48e:: with SMTP id z14mr3697892oid.34.1621636631107; Fri, 21 May 2021 15:37:11 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id v19sm1566979otq.35.2021.05.21.15.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:10 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 05/12] doc: asciidoctor: remove unnecessary require Date: Fri, 21 May 2021 17:36:54 -0500 Message-Id: <20210521223701.526547-6-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This file is loaded by asciidoctor, the module is already loaded. In addition to being less redundant this fixes a problem while trying use a development version of asciidoctor when the gem is available: $GEM_HOME/gems/asciidoctor-2.0.15/lib/asciidoctor.rb:51: warning: already initialized constant Asciidoctor::RUBY_ENGINE $HOME/asciidoctor/lib/asciidoctor.rb:52: warning: previous definition of RUBY_ENGINE was here ... That's a bug in asciidoctor, but there's no need to trigger it. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 70a0956663..423450392d 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -1,4 +1,3 @@ -require 'asciidoctor' require 'asciidoctor/extensions' module Git From patchwork Fri May 21 22:36:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274039 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21E90C4707E for ; Fri, 21 May 2021 22:37:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04AFA613D8 for ; Fri, 21 May 2021 22:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbhEUWik (ORCPT ); Fri, 21 May 2021 18:38:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbhEUWih (ORCPT ); Fri, 21 May 2021 18:38:37 -0400 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A62AC0613ED for ; Fri, 21 May 2021 15:37:13 -0700 (PDT) Received: by mail-oi1-x230.google.com with SMTP id c196so12908991oib.9 for ; Fri, 21 May 2021 15:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vv31O72HlaW7pfx8KxRQpSn0tEZuIxic3nwHjKUSexU=; b=mca5goIQ6zTOYAHvBsF9X2FkKAhVFOkSKp90RphqFHJGqFolFhiIxuSP/SfuzobwkH ewptOzjGd+GPjqa9mmBfE19OC1YX6esLu0okNkrAvqWdJrMPtjV7lyXnfgZbugT/dW92 UhAH58gNV8GAyPVDNKWbLw07CzOaXPSfVy9qJYg66ny+RsWVb1MYLHPcnLlRUUu1vcF8 MNWmccZJvI0QilhQlC90cZK8vryrmN217iUcnkBw1qr2+ZqaBk/Mv51aDhb47aRwbvsi RG/Zsj2nVe91p6EaVNL9rHwrXawEbuc0z9jhLRbXn1mi7vEB01YOzJiEaHp6uG2B9n8t RXEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vv31O72HlaW7pfx8KxRQpSn0tEZuIxic3nwHjKUSexU=; b=M2tqSPxgM4VmAEa3PO6tfz9dIZaSZvK6hlAXlhwdnl/fOsGKrX+wDmilethlM+PczR lrLszsuSI/u76/zSIXLAYh4AyWDa6TWc4Y8lBhw7nWH8Gy3/ebxHD1PaT9qtvQuiNgWt /m8sY1iw+eQiemIgfFhc5S7LPtZijkYfXRfBvLLbUmmrnW2/NE/fW+9TVT5QV8JdvXmw Kc2X2vlS0BKE+l+dPOR0Pan2PHuI8zIkxpjYz8OUDCtlomWhJhUVascFBtwIudFri85y wtNKQVmOc3oxdOGR6kE/D9aPCzqz82+TDtp2f0y82mSN5tJkul+iuOILYtigF3Xgn2U2 Jo1A== X-Gm-Message-State: AOAM533V+znTGapOu3GFbO/XOFpjdn2Pl4mWO6LcUkxhgd/Aemq++rkK j91qd6Rd87k4duQBwPMwt3V2pAqQnqs7OA== X-Google-Smtp-Source: ABdhPJzhCL9dx6fMy8PsaFyNft8DiklNRHISJKiO21fP6Ku0Tj8eOevc92icem2veQS5K+Ei3ORf8A== X-Received: by 2002:a05:6808:138e:: with SMTP id c14mr3868436oiw.55.1621636632557; Fri, 21 May 2021 15:37:12 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id q14sm1263988ota.31.2021.05.21.15.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:12 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 06/12] doc: asciidoctor: remove cruft Date: Fri, 21 May 2021 17:36:55 -0500 Message-Id: <20210521223701.526547-7-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org These were probably copy-pasted from other extensions. The name is already defined (:linkgit), and we are not using the DSL mode. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 423450392d..3dea106d00 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -3,10 +3,6 @@ require 'asciidoctor/extensions' module Git module Documentation class LinkGitProcessor < Asciidoctor::Extensions::InlineMacroProcessor - use_dsl - - named :chrome - def process(parent, target, attrs) prefix = parent.document.attr('git-relative-html-prefix') if parent.document.doctype == 'book' From patchwork Fri May 21 22:36:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7834C04FF3 for ; Fri, 21 May 2021 22:37:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD9E4613D9 for ; Fri, 21 May 2021 22:37:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230117AbhEUWil (ORCPT ); Fri, 21 May 2021 18:38:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbhEUWij (ORCPT ); Fri, 21 May 2021 18:38:39 -0400 Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E22DC061574 for ; Fri, 21 May 2021 15:37:15 -0700 (PDT) Received: by mail-oo1-xc2b.google.com with SMTP id s24-20020a4aead80000b02901fec6deb28aso4919825ooh.11 for ; Fri, 21 May 2021 15:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ehDHJukYh7b8FbgY3eX3Ifyv88n/KEhHnL/0usgot2w=; b=ERjE1/uJPlrRtOA3fgfImejeNTGwA9G/mC9BAA7IUmmY5MeKda+ONwTTHAYzqMNNpb t7sWlfGT98frAPMUiDpf06JFHPkFC2ON/PDCuiFispwHIR2NpBnEJqGIyfAXMFUsS6cI 06Nc1jPN7pcJW90db7qHO3WRcoH+9QbrM+yuV/BhONiUB7viPU1Jm9jY5ioQl2fB72QB CnPZua+XcQE6+KWoXumTwgKOyj9VS3YHh7e2YuQic0If2HNVgbg9kvaGJXOAf1KT2E12 6xkMsiH3V1FhQzH0yDm2akGTJ0hncT1Ya88qbLDt1IWas3GhUUmhLAbkBLkwtGHAFHcg sYAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ehDHJukYh7b8FbgY3eX3Ifyv88n/KEhHnL/0usgot2w=; b=i/D3zBK3sZlfBWdNB/ZHxwwyHEg5KmNpi6cssTEdZ0EYNqf8oMULLMgH26Zb5yS05U 9cDQ5jkbuqdm0uxyLe4P7BzLoOoj8Iqcw+5RTTcQVJ2XGS/w8ViFwT57iBMh5UQpf2x6 mBYLUxx5yifYr03tbT+JBiSuasd9h3F9fFxLZns0fc0X6ZO1O3Xw/T3Ky6/lRsmCqYR5 KHXr5RjZMrricHby9FPO2e2Q6Bg4YnJANZcPwTHiuciRCAmP2WdaiPQg8Mhn0PehKgtX imctOf8HqJ+enNvScSVJmYRISAWfaC6ydiiSHHoLMrNcXs92gycUfA/WS6/o1WYbvjhM qVCQ== X-Gm-Message-State: AOAM533DNMe5Lz5Yb/LDiFtOjA+44/dmNRRbfgYzL6mkjkNEgUv3u76k /mzrf8jFTef0f+Mn3Vc+3Ym8A3SAPr7FXA== X-Google-Smtp-Source: ABdhPJzuaHyOLmv3tspeGQmgh/9dkS5GtFI/3/vEHudQXyQw8gwG3aOJ3qpgOavN5nRjsZLEAbk7QQ== X-Received: by 2002:a05:6820:611:: with SMTP id e17mr10145447oow.0.1621636634211; Fri, 21 May 2021 15:37:14 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id n13sm1439410oop.8.2021.05.21.15.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:13 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 07/12] doc: asciidoctor: reorganize extensions Date: Fri, 21 May 2021 17:36:56 -0500 Message-Id: <20210521223701.526547-8-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There's no need to create verbose classes, we can do the same with a simple block. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 34 +++++++++++-------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 3dea106d00..f998a42249 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -1,26 +1,22 @@ require 'asciidoctor/extensions' -module Git - module Documentation - class LinkGitProcessor < Asciidoctor::Extensions::InlineMacroProcessor - def process(parent, target, attrs) - prefix = parent.document.attr('git-relative-html-prefix') - if parent.document.doctype == 'book' - "" \ - "#{target}(#{attrs[1]})" - elsif parent.document.basebackend? 'html' - %(#{target}(#{attrs[1]})) - elsif parent.document.basebackend? 'docbook' - "\n" \ - "#{target}" \ - "#{attrs[1]}\n" \ - "" - end +Asciidoctor::Extensions.register do + + inline_macro :linkgit do + process do |parent, target, attrs| + prefix = parent.document.attr('git-relative-html-prefix') + if parent.document.doctype == 'book' + "" \ + "#{target}(#{attrs[1]})" + elsif parent.document.basebackend? 'html' + %(#{target}(#{attrs[1]})) + elsif parent.document.basebackend? 'docbook' + "\n" \ + "#{target}" \ + "#{attrs[1]}\n" \ + "" end end end -end -Asciidoctor::Extensions.register do - inline_macro Git::Documentation::LinkGitProcessor, :linkgit end From patchwork Fri May 21 22:36:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43958C04FF3 for ; Fri, 21 May 2021 22:37:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24BF1613AF for ; Fri, 21 May 2021 22:37:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230146AbhEUWim (ORCPT ); Fri, 21 May 2021 18:38:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230096AbhEUWil (ORCPT ); Fri, 21 May 2021 18:38:41 -0400 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92925C061574 for ; Fri, 21 May 2021 15:37:16 -0700 (PDT) Received: by mail-ot1-x336.google.com with SMTP id u25-20020a0568302319b02902ac3d54c25eso19473691ote.1 for ; Fri, 21 May 2021 15:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EmDs9Vqb5zhFDtU71E+DNwzSqZWSR1qVPgovOloFuMw=; b=lz6d7sQKwx+UUcAipdQ3nB5BNTh2UJb/79DD5rE0qgxs8wPVGmuG4X4cSagnzeOcP1 +6sA+MaTcyBZUWqUcOSt44rZuElN2t0BiDvshh2b0uxDMiHkCBSsg8E5BsgNmha1mB0q yButU0WjJXm1aYNgQIB2qE+JzrC9saZHQpcWuuypdGL0uB9jMLoxtQFLjHRo4mPUPlnU muOjM/LcaoLwg1AbiO0jO5bLVrAqy6P6ZOyTSHjEpSbGswS8sgRrmCYHb2QoQornWkKy YiAKEIY61eclafW/c9t+ultiBQwhLpkJFgz6VWptgQVNEPiOSLLQ29+2LdXLcgmoRAUr 10zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EmDs9Vqb5zhFDtU71E+DNwzSqZWSR1qVPgovOloFuMw=; b=VONBGNqHcT+FONrRY76zGsUw0k6e6hm/wkyb43gCiV2ViLua2SXtGMKWqy/5fggbxA aMjq+NJJHFvsRkglOIfCgo9mHfoLbWvDTWgcgVEd+n4uQbB7sX2sOzQyWqrtAm02F1by 98luNvp3v5GMfzW2I/2npEhGR+ITjeiAny0Tg4jJGHFmHLTUrHl/KZs/y52lY8iySu7a VQyCX8rvkPCnGcYsXfSM0z01k14Q3O2AfHRB0+/lmjWXvGwLJl4ZFB/e25DZelMMxY+m TKGvWBYhgoHkNAH2dj5YvDM0VYkT1os9c+VyY4JaidLfE4CoWjVPKRiipRSd9Fr/Dg7x cc3A== X-Gm-Message-State: AOAM533usztKIr5UPwEp6LLjaoumELPxqzP2RcMB6FhVqJZ8BPuh6DDu in2AzaYfpcxet3YVXJ3lGYyW+HsnXvMSwQ== X-Google-Smtp-Source: ABdhPJwri9Lm5lUWS0OWlT+xwiqph79nZVtnIlF+/7s9xckLGSL6DwPtqk7ruFG2hm9B5HI3N1ROKg== X-Received: by 2002:a9d:721e:: with SMTP id u30mr10305545otj.250.1621636635767; Fri, 21 May 2021 15:37:15 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id k21sm1523764otr.3.2021.05.21.15.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:15 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 08/12] doc: asciidoctor: use html-prefix only for html Date: Fri, 21 May 2021 17:36:57 -0500 Message-Id: <20210521223701.526547-9-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This is what asciidoc.conf does. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index f998a42249..c77b6de350 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -4,11 +4,11 @@ Asciidoctor::Extensions.register do inline_macro :linkgit do process do |parent, target, attrs| - prefix = parent.document.attr('git-relative-html-prefix') if parent.document.doctype == 'book' - "" \ + "" \ "#{target}(#{attrs[1]})" elsif parent.document.basebackend? 'html' + prefix = parent.document.attr('git-relative-html-prefix') %(#{target}(#{attrs[1]})) elsif parent.document.basebackend? 'docbook' "\n" \ From patchwork Fri May 21 22:36:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274045 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D69EC4707A for ; Fri, 21 May 2021 22:37:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83A2A613D8 for ; Fri, 21 May 2021 22:37:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbhEUWio (ORCPT ); Fri, 21 May 2021 18:38:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbhEUWil (ORCPT ); Fri, 21 May 2021 18:38:41 -0400 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25C63C061574 for ; Fri, 21 May 2021 15:37:18 -0700 (PDT) Received: by mail-ot1-x330.google.com with SMTP id 80-20020a9d08560000b0290333e9d2b247so8883623oty.7 for ; Fri, 21 May 2021 15:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GlTK0LbCLdZHM3tR8WpR9GRnFxhsvXWBAS9HWgerdoM=; b=Fmk4YmXNr8YBuZRn9QRQdf87+Bi1cnLW8Tk6EyPKzeDwKCNiCSBPwHaMUnZLFj+mGe 46TwgcVWgj0TIYUUP/Z1AQtNfyFEbCeXSJiJNVFdjQCfXCOUxw8pjk40D3w+nIfEPzdm qb+DSzcJPa02oHpgilr1CPhPe83Q8Idmf/Gpdqou+wY9r/e7DGVyutXJzYsUqXdxp9cy l/mEqrSgP1yYNrvvb7ZPxuIcWYbYnGpF6kbOY5O/Sw7JO/rm/JrdlL/M2REhY0DjMoYB PZ6f2St6f957fateFUPUcAwNKicRFEVTzs3twu9vETV0MKIBsgPapy3MBIPhqJnvOd58 kZoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GlTK0LbCLdZHM3tR8WpR9GRnFxhsvXWBAS9HWgerdoM=; b=JtZYm+8MY+XBRl1353CPPmx8DVZaFjpDURBU+ifrqteI/VyqYGafcIMc4cNvz7P5Ce wZqesHH5sQMfDoQzyRq1YUncLEQg8XTJ5HQE5E5KwEzrD6bBd3I4kSxBxgVjYPpvrPdj kzDIocQ3jCHZ9QD+0+/OOGF/iOTS58DpdAJc9yAsvOyWZr6wRpjUkI0Xu2o6K0rtJu52 4JGhtozfpZl4fCB8A0CZ9iMRr1tvEAHi7DOVMp2Va51T7v2XLKr9D15qHWoopN63Q6Q1 z+5kUFfhIN7gaLPDuEWIHNhhcpnRwiRFsG8PsRn3LaZjw2mFrcchFtLTziJGfI1wPv1r 10RQ== X-Gm-Message-State: AOAM530Q8ftEwz3F10jr66tqJ0xRGG5tB7AiYDFVQsz52aHQNqw8oV1k cX/o/4sw9Fhi8TDdgaZ8B1ngahj5RafG/g== X-Google-Smtp-Source: ABdhPJyRrKvSivelAKYCeCrJnCVKDS5iHMYV5pv1j6o7o4cF4/ktgVetpapWh30F2hmtW8hO1RbV6Q== X-Received: by 2002:a9d:7303:: with SMTP id e3mr10529788otk.216.1621636637271; Fri, 21 May 2021 15:37:17 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id d65sm1568736otb.78.2021.05.21.15.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:16 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 09/12] doc: asciidoctor: refactor macro registration Date: Fri, 21 May 2021 17:36:58 -0500 Message-Id: <20210521223701.526547-10-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There is no need to execute extra code every time the process block is called. In Ruby the lexical scope is shared, so we can define variables in the register block scope, and all the rest will inherit those variables. Based on the doctype and basebackend one of three blocks is selected for the inline_macro. However, the conditionals will be run only once. In the end Ruby will only run the code between `process do end`, nothing else. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index c77b6de350..a678704e17 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -2,15 +2,21 @@ require 'asciidoctor/extensions' Asciidoctor::Extensions.register do + doc = document + inline_macro :linkgit do - process do |parent, target, attrs| - if parent.document.doctype == 'book' + if doc.doctype == 'book' + process do |parent, target, attrs| "" \ "#{target}(#{attrs[1]})" - elsif parent.document.basebackend? 'html' - prefix = parent.document.attr('git-relative-html-prefix') + end + elsif doc.basebackend? 'html' + prefix = doc.attr('git-relative-html-prefix') + process do |parent, target, attrs| %(#{target}(#{attrs[1]})) - elsif parent.document.basebackend? 'docbook' + end + elsif doc.basebackend? 'docbook' + process do |parent, target, attrs| "\n" \ "#{target}" \ "#{attrs[1]}\n" \ From patchwork Fri May 21 22:36:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274047 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D05C1C04FF3 for ; Fri, 21 May 2021 22:37:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B6E9E6128A for ; Fri, 21 May 2021 22:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230150AbhEUWir (ORCPT ); Fri, 21 May 2021 18:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbhEUWio (ORCPT ); Fri, 21 May 2021 18:38:44 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE27AC061574 for ; Fri, 21 May 2021 15:37:19 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id x15so21063936oic.13 for ; Fri, 21 May 2021 15:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uzr2uGo16UQuc9KlAb5i7OgS3/aiPV44qHIRlKqN+ng=; b=JKv06sNjCS630xq/a1GsyLc0mu0FaEsI765TiwHv6VQBfrWYk+vvbmgvtPwZixgQW1 q6MNcS8oH+lANqjjMni+zlpV8ZJ2uqf+0PopDiwCvXZelGSfaDU9fRVgCBcm8AYVdt1b 4C4cDXg9omH3DE+GDRGvXRmtDoIIfr8bVgp6xT5njc/JGygTj7wWosm3thsKvdjhffOz UhuR7MGHP2GTdPtfWZTm/nqlkTwHaMgFZ97JGTF83iC9uxEfK2VSjThOhyZ6VerUG6H5 Hy4JMHelw3XAazZ2Ly8pu/x02JaPKOHdW+Hc/1cE6giymwKUkjrWw1sEkBPBgQ+dPgbV q7mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uzr2uGo16UQuc9KlAb5i7OgS3/aiPV44qHIRlKqN+ng=; b=cBT1RBlgY9zjEI3Crt8zcWQFl65Jfpn86r1eQtK5nZDmhMAWPy+D4stum4yj9sIb3L VJVfgpE3L9IH7wb+cbuVOszNc7lo0GTWcVer6C1T1QVt9NM0mS4oMkAhGASxziFp8Yzf UbJunYxiqjLdUYZ+KE+Jx5yvbZ7pjJdwxwkvKJd+DTN7U5Yyh+wcTiW2/iQMMWkUDkCZ MZyxlC0UtmcgqAjzPBlnjrEKI4T3cY5G0Yt1e31l+xx/sANcv6ELGYm9veOdOikORSp4 g6PTh5K4nWpexjPOaX1YQ28dkGBoU7UPyxgvpc7BsVZLvf0hYQLtr2LgQtoPfmF4Zp3F ESMg== X-Gm-Message-State: AOAM531DtwsF5aygvRYfoImo7ve/kZUhsN7HZYPEx+03vFU2SQpuVxi8 ZM4hBsX3e8O8Q6XS1FOmeirFEKNe0qvisA== X-Google-Smtp-Source: ABdhPJxop10CVp6FIeFvPtYWXg2cOx+6jjuqjOWvG9vQRPggZaerEXgc8tR74q40hxjb5oHzmkpd8Q== X-Received: by 2002:aca:d07:: with SMTP id 7mr3846252oin.100.1621636638914; Fri, 21 May 2021 15:37:18 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id a18sm1159945oiy.24.2021.05.21.15.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:18 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 10/12] doc: asciidoctor: improve string handling Date: Fri, 21 May 2021 17:36:59 -0500 Message-Id: <20210521223701.526547-11-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Using printf style formatting (more familiar to git developers), and also here document. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index a678704e17..3282d59a48 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -7,20 +7,20 @@ Asciidoctor::Extensions.register do inline_macro :linkgit do if doc.doctype == 'book' process do |parent, target, attrs| - "" \ - "#{target}(#{attrs[1]})" + '%1$s(%2$s)' % [target, attrs[1]] end elsif doc.basebackend? 'html' prefix = doc.attr('git-relative-html-prefix') process do |parent, target, attrs| - %(#{target}(#{attrs[1]})) + %(%1$s(%2$s)) % [target, attrs[1]] end elsif doc.basebackend? 'docbook' process do |parent, target, attrs| - "\n" \ - "#{target}" \ - "#{attrs[1]}\n" \ - "" + <<~EOF.chomp % [target, attrs[1]] + + %s%s + + EOF end end end From patchwork Fri May 21 22:37:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB749C4707A for ; Fri, 21 May 2021 22:37:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D79D613AF for ; Fri, 21 May 2021 22:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbhEUWis (ORCPT ); Fri, 21 May 2021 18:38:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230167AbhEUWiq (ORCPT ); Fri, 21 May 2021 18:38:46 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8249EC06138A for ; Fri, 21 May 2021 15:37:21 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id h9so21141034oih.4 for ; Fri, 21 May 2021 15:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aqbscAW2JC4oyXeOj4nR2hALeI+2Kpda4E3q52opqv4=; b=g0NzynA/m1pxVrrQ/rmDOMgOuttALxb2s738WnMfXy6wKg5tv2RpBa/CbKuOgcKLAW /VznuQPvkg7jwsoXNJPCVQ7E0XsfTmlap4OQsikZwK9g2Y39pkZjQeDg1vQNY9ENqz0H fvklvXrzoVymRSrc9EOV7YbIuz6mQwU6g6G0/CBYPhNVws8UaRu4cEY+dSsNn3ageGK0 FHkpQcaz31lcLTI4PTeDqS18SuZkCDiOhMQWm/AGbIGJbz2ZgV2m5vOTETOLAya1TzQ5 1Qq5pMOANzKr45BXa/kPtTl8f2Xwuz2yA77/yiirs5rYpbf3c2NxWfRd/cnVsuCfnNtF h7/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aqbscAW2JC4oyXeOj4nR2hALeI+2Kpda4E3q52opqv4=; b=W/SHaRIpsNOZ3CsVzif9AfEtDnznh+MN3fuhpC5Evast8yuVNvkgt+R+mvMbgfxsQE AIsHuGaqCu1xvtiTDmInB7BORrNZFKfOkxWxHij3CiXD7a6ZBCwl4hrYeiixE/UqRfBx XB10xeIw9GBClL3pRpEmKkKC9RYc+GY73V9c7gj3eq30faY3EOYjm9zkg/M3rAVYbcCp Cc/ILYj7uuNCuwWVU/uWC/TwG3nlmTiigmxSXoieZK/8J9wKstkd/FyUv53mXjwvSG7Z Zz4BYpj5CFE6uGE/sY6urD7XyLDuXoK6m7Xr00xdlTCfSXTWikGaSFY3C//Z9lsLrT2x W/ZQ== X-Gm-Message-State: AOAM533hOLyt0vcsFGlXAL9/Q37Ed/hcP7QSeqHMgjfcY41dVdKI1rcH RkwXhFtvOI2bJ87oF/CxZV1MULXo3wL3Sg== X-Google-Smtp-Source: ABdhPJynlOySO3SuqstNUMtkPNOzqZJCrfi/MQd+pdZ01MguvcPx916gQ9Er364L8N3F4vIyqFfwsg== X-Received: by 2002:a54:448a:: with SMTP id v10mr3812876oiv.133.1621636640601; Fri, 21 May 2021 15:37:20 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id i4sm922688oih.13.2021.05.21.15.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:20 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 11/12] doc: asciidoctor: split the format from the code Date: Fri, 21 May 2021 17:37:00 -0500 Message-Id: <20210521223701.526547-12-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This way we don't have to specify the block to execute on every conditional. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 3282d59a48..51981af13c 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -6,22 +6,22 @@ Asciidoctor::Extensions.register do inline_macro :linkgit do if doc.doctype == 'book' - process do |parent, target, attrs| - '%1$s(%2$s)' % [target, attrs[1]] - end + format = '%1$s(%2$s)' elsif doc.basebackend? 'html' prefix = doc.attr('git-relative-html-prefix') - process do |parent, target, attrs| - %(%1$s(%2$s)) % [target, attrs[1]] - end + format = %(%1$s(%2$s)) elsif doc.basebackend? 'docbook' - process do |parent, target, attrs| - <<~EOF.chomp % [target, attrs[1]] - - %s%s - - EOF - end + format = <<~EOF.chomp + + %s%s + + EOF + else + return + end + + process do |_, target, attrs| + format % [target, attrs[1]] end end From patchwork Fri May 21 22:37:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12274051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E699C04FF3 for ; Fri, 21 May 2021 22:37:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55D17613D8 for ; Fri, 21 May 2021 22:37:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230062AbhEUWis (ORCPT ); Fri, 21 May 2021 18:38:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230178AbhEUWir (ORCPT ); Fri, 21 May 2021 18:38:47 -0400 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A1CDC061574 for ; Fri, 21 May 2021 15:37:23 -0700 (PDT) Received: by mail-oi1-x235.google.com with SMTP id h9so21141086oih.4 for ; Fri, 21 May 2021 15:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pswKRjqSmEQtoeNs6BztCFLOKuD6NGg7hYBvW2ja2Uc=; b=h7yINgI+s3YVwr4HQt9cNmYpBtI3J0i1jX+YMVeWQD6+RAphZMvXNJv3JNZzhiiPRc swF9pkJHY5YM+7Y3nBMs/UXVFrCUshrN5y4by5EgUa8AzSPAYkqRubPiNXcB+g/OmWld zePz4B88tFKWzU8o7lFsF572SqVoysIyrMOVsnMsFGLY5DdK72e2/pVBY3uC808/J9K6 TpafuUNKy+q78nR9XmqEeFNOG6t/dd1HuihhrrTHrA/DYAAlfmarRVxitZ4WlYD2pzee 0d9FCEr/IwGjYgN3tx1Abg6UfPo8KCZ2FDUWTGRavL3jcVlXiSzV0FKZd4NPFyEthnwc n9EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pswKRjqSmEQtoeNs6BztCFLOKuD6NGg7hYBvW2ja2Uc=; b=jlyqoKmajrR03a919LbhibErQ8m0DjyVp6epJkTt71Du2w9/yPuLIvq03mpkd60fHW MotPecBKJXF8G0JXFJA/qXwDsr+d7quy2fBip+umocX/ylZRgPTV02v6PpK3LQ3hOxEU WXa+JOJtX6sYL55oHbfL9uI9JP8PD3XuPRqQuQWyum1w/SgMnpXrDRCXZcLeGu+dAptJ Qbr3l1TZXG8smFGqoAXaSuBLio/IFjssER4Hibga/xLlPgUg5IW6swloRWwxac2BXeTO GJBU/SyjXInkg3JqLI8EEFT6Uj9Y2vv49zNa37WJl3xQBusPIWk05ypYL4fhcSkBw6j3 /Hqw== X-Gm-Message-State: AOAM532lyHohQzFP1tZvSXlzt1UWREDDoqAzDTpL66tcJ44DvYCsNxzH oh+tHftBa+rYqG+JJcnobOtqvFOzEM2PFw== X-Google-Smtp-Source: ABdhPJwM6IGw+PDTGyC7kaKB7WJ7pG0MPUlY6xh9l7UJWOAMDNGVQ9Qu7rFn/IoJ8/4vq3PruBbrgA== X-Received: by 2002:aca:b5c4:: with SMTP id e187mr3871803oif.149.1621636642521; Fri, 21 May 2021 15:37:22 -0700 (PDT) Received: from localhost (fixed-187-189-187-231.totalplay.net. [187.189.187.231]) by smtp.gmail.com with ESMTPSA id n13sm1431187oov.30.2021.05.21.15.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 15:37:21 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?Martin_=C3=85gren?= , "brian m . carlson" , Felipe Contreras Subject: [PATCH v2 12/12] doc: asciidoctor: specify name of our group Date: Fri, 21 May 2021 17:37:01 -0500 Message-Id: <20210521223701.526547-13-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210521223701.526547-1-felipe.contreras@gmail.com> References: <20210521223701.526547-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Doesn't do anything, but otherwise we get a random name. Signed-off-by: Felipe Contreras --- Documentation/asciidoctor-extensions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/asciidoctor-extensions.rb b/Documentation/asciidoctor-extensions.rb index 51981af13c..b36317e4d2 100644 --- a/Documentation/asciidoctor-extensions.rb +++ b/Documentation/asciidoctor-extensions.rb @@ -1,6 +1,6 @@ require 'asciidoctor/extensions' -Asciidoctor::Extensions.register do +Asciidoctor::Extensions.register :git do doc = document