From patchwork Tue May 25 10:47:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12278457 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 DF6C0C2B9F8 for ; Tue, 25 May 2021 10:48:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B328661423 for ; Tue, 25 May 2021 10:48:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231220AbhEYKtj (ORCPT ); Tue, 25 May 2021 06:49:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231164AbhEYKtg (ORCPT ); Tue, 25 May 2021 06:49:36 -0400 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4A74C061756 for ; Tue, 25 May 2021 03:48:05 -0700 (PDT) Received: by mail-ot1-x32f.google.com with SMTP id i14-20020a9d624e0000b029033683c71999so16987098otk.5 for ; Tue, 25 May 2021 03:48: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=PpJMC6KUqTNLKh7b5a+5L94zbQfMGs9IUqUaUKeLYac=; b=svzxnnuXhKPiZpXutrJNYVFtGXTVD4LpHX8YUjQjPXhiis8bojVnLkuEiWdfRyZ4b9 HvNOY95CgO/6GyZRgkAoqMIyOgIKLd8F30xEeJS3hEZd/TOejPUpCeda9KVw1edTS4h8 sxEzPfxaWNkIo0ws7Z4sWrI9ciUdPhweTl9wxc9TQeC9nKEsxKvPylDpZ8jDUFWPcE/Q 8PQPihXaTaXvhb67IMQozwUnba/n9pGolHP0aEk8rFoDxoOWApUwK6W7fGdC5/bll9en 3NoJ/d9zBZNEMWIqMMxJHs/e9c+R+JOQTRqgw+7Byjb3BNXqx9C21mdYYp3Li7yfGky4 w41Q== 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=PpJMC6KUqTNLKh7b5a+5L94zbQfMGs9IUqUaUKeLYac=; b=bQZOxV/oe/JIWo4W07txo7sm+L7tr2qi3bcXRYmy60jdBUwXhbzxp2yw7SJSa00kYT ltKP2aA+J3RZ8uQ5QtZPN0WA6Eri/h30h9xUvNbyf5Fj6zNNHdYgm1nhG/oqXWb3hQlA jTBou01GSIigWCCiHeTZCo67doFjVlzJ/x/k+yK5Q0VTFrV4d1k2tcyUWiYxp8sXehv5 74CRftPUyX3tNBgvvaJWcHz1hnKhCbnTxvrPMoZsTeSduqyLVRKAeaUAwghltI/Yaipf cUJCgD20aQlHrfke+vzwH9d5mKVULK5n+JDLZ9ptnH+ysxTNyO4X4CLswCW3VkZ6kE/J gTLg== X-Gm-Message-State: AOAM531qqJUBEjKlzrnCCiVUIdCNxYYrMYk2vVSHk1kq4d71G2QPiUBF EdtGW9L5C97V5OVLZKBWXf+1gpswnd0CdQ== X-Google-Smtp-Source: ABdhPJwR+l+gLBeZf886uyLUQ9CAPl/c7mkNOa3eVcO9poyX+q8lF88h6Nux9tscsoJz8pi8koGjxg== X-Received: by 2002:a05:6830:1284:: with SMTP id z4mr23139323otp.148.1621939684936; Tue, 25 May 2021 03:48:04 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id o18sm3683027otp.61.2021.05.25.03.48.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48:04 -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 v3 01/12] doc: remove GNU troff workaround Date: Tue, 25 May 2021 05:47:51 -0500 Message-Id: <20210525104802.158336-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 --- a/Documentation/manpage-quote-apos.xsl +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - ' - \(aq - - - - 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 Tue May 25 10:47: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: 12278459 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 DAE87C2B9F8 for ; Tue, 25 May 2021 10:48:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A77046142B for ; Tue, 25 May 2021 10:48:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231262AbhEYKtm (ORCPT ); Tue, 25 May 2021 06:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231185AbhEYKti (ORCPT ); Tue, 25 May 2021 06:49:38 -0400 Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA426C061574 for ; Tue, 25 May 2021 03:48:07 -0700 (PDT) Received: by mail-ot1-x32b.google.com with SMTP id 69-20020a9d0a4b0000b02902ed42f141e1so28156772otg.2 for ; Tue, 25 May 2021 03:48:07 -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=EVfA+XzfYuaTMZ3HnvQZ29VZquEKJ3+s/p2eSQyca7U=; b=t0qJsLZvgZXxee44YhUyvooEo7giwVwJkwYY28aWMAbqO0JRJTIsp/WzVNv4STetui FLvKNUe71Z3GjfenIAepwutXH9BAKeCPMVOE38K6fKLT+FbtLNb42s4dlr8LRpTWcJEf MAWYu3s19Y5HGOegOap5gsIlt3qraydpYStoMKz+pcL0G65T33K/h9D0fqKnSxWufkVv AON/LvovkxOtWcek2aenD4J0s0IBpukWnKCmXL5Y4viW0FtdKdgUvEZaS9Rs/Q7QKpR4 yoxdkTnoOSNgkUMZQWER0zVg+DboN6xr3IRpGTUS+2bCYoGFjGhFooyNzObuqwfPvlIr 4U9Q== 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=EVfA+XzfYuaTMZ3HnvQZ29VZquEKJ3+s/p2eSQyca7U=; b=NRo/qGqlZ/ffJjrjq2LmYMjJOazmYmzJddze9QIwLhMG8uYCNkJmkheo2E8Rqjvg3K I5kB/z2SEkXb5HqMeXOkw/6k+B3KS+7qWB0/Vm/cWJweiPAyz5kppvsIp1Wxk9xGWWcR sdCjUMvagufdZorjNdm/uQlNN1QEsipw19HzBW/Xi7V5b2Vn3naoJv1POcZW0CvuKl6m K5+vqv2aLbncXYadjUNUMW+Rgvby2wMm99LGfSdSBBx9XyQVwbqos/kVt3zNXQ2KQAGw wMTBeGUpiFrTz2Gu3qUaziZwpBGX5F25rYhlFjeKVWd7Apk+k32WInX5mLxejeZsXBGg 8qPQ== X-Gm-Message-State: AOAM5339qrN61PEfNamzeI0eK4oOpV0ayMxKfAVZ1sMcHbWvff8JfXgq mI3AB6CRai+9TFMM7nAaQYXWB4kftM0N0g== X-Google-Smtp-Source: ABdhPJwu2e0TTauGXJsccSsp2TEO0dOSo2/4pf3mTY1mXQ0+k47P+S3RHKm9LEf/F6MXZjBL6fOQgQ== X-Received: by 2002:a9d:4101:: with SMTP id o1mr23174129ote.281.1621939686984; Tue, 25 May 2021 03:48:06 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id t39sm3371515ooi.42.2021.05.25.03.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48:06 -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 v3 02/12] doc: use --stringparam in xmlto Date: Tue, 25 May 2021 05:47:52 -0500 Message-Id: <20210525104802.158336-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 --- a/Documentation/manpage-base-url.xsl.in +++ /dev/null @@ -1,10 +0,0 @@ - - - - -@@MAN_BASE_URL@@ - - From patchwork Tue May 25 10:47: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: 12278461 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.8 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 0EB4FC2B9F8 for ; Tue, 25 May 2021 10:48:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E742761404 for ; Tue, 25 May 2021 10:48:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231261AbhEYKts (ORCPT ); Tue, 25 May 2021 06:49:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231223AbhEYKtk (ORCPT ); Tue, 25 May 2021 06:49:40 -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 5A27EC061756 for ; Tue, 25 May 2021 03:48:09 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id h9so29882241oih.4 for ; Tue, 25 May 2021 03:48:09 -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=gsLiE8p60edlcrhp79r1x330FTwqYm7OqAAMavAeVfmTIGHISi47HkTC8nJhZDzBH8 n3qQgZUm3tEfkkDKzgBEKgp4bmQyeLr2vVZcesEBeVc4iI+d+Ukabx8jK9hs9eZHX/bj GqIY70GZQDVcj7fxKZzYh29gKkqLb5/Xanw7SG9GWhQzA1rL+T3Pxrdf/Gvspdw/e1ow /rAHR/LnDXqKc8vwp3Q3owi0EXySkzSqxnC0rDQrZlmfgHNpCjjgRC6WGLlVTii5aYik ukL67R2kosZ6ETElPGm8kYi1vfPzxkZu63Qi+JV8l28UkDXQPYnVHVyMf/xTdfHi/cmw +3Ew== 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=Zzp0zvUjJFQpw0sLYGnWOiZ8hfIWAU0aolT6ESiPzDyyG+hGGJI1ew8oSpvsPqGyBq RqPtzEk/J5moWfyQkfBSXYFbHKwoDybKiEXlqmd34hw0ZyiVh6EGSdGwWBWi7jNuKOnn GERjprBChBRivuEdW13i3G+VxdU3x3qkQEaF3cJjEKFTsePfLMpbm4p93qV5k1HEJAFY hw/xyIfvFrAz3UqBL4HUaElriMOk1eF8cteXqio6M+DsUAlr789K65vO9W6pYJSw4QB7 CRAZbbdHLK++HNI1mQ97Q28MH+MJA7kMvxBIIAE+No+n82C8p9eaAkCul/ZFXBudd3XN Hvvw== X-Gm-Message-State: AOAM5300jr53vTIsCT+HKVArBfNm+/trOiOrjVMTMDJZXnzK4UcJ4Xz5 h6LTY/7MjnbX20jg6ZwUpm+qfAQRtDIZYw== X-Google-Smtp-Source: ABdhPJxFQ3Es5HYQSZPeSO1ggxWSoYczgVJVCnY3SMnBbr8Dob5bLQwesf2mzgIVr/cpZayV4fJLfw== X-Received: by 2002:a54:4113:: with SMTP id l19mr2311128oic.38.1621939688471; Tue, 25 May 2021 03:48:08 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id p22sm3386489oop.7.2021.05.25.03.48.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48: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 v3 03/12] doc: simplify version passing Date: Tue, 25 May 2021 05:47:53 -0500 Message-Id: <20210525104802.158336-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 Tue May 25 10:47: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: 12278463 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.8 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 DE873C2B9F8 for ; Tue, 25 May 2021 10:48:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B625C61404 for ; Tue, 25 May 2021 10:48:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231326AbhEYKty (ORCPT ); Tue, 25 May 2021 06:49:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231259AbhEYKtl (ORCPT ); Tue, 25 May 2021 06:49:41 -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 A21DAC06138A for ; Tue, 25 May 2021 03:48:10 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id s19so29834043oic.7 for ; Tue, 25 May 2021 03:48: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=d8QbuSnc80dHiyvVqyVqW1ZCvs2LdweWTbUTd2vsfRNHRPiNsbhdKflT6uCmwxxnii rmJeBVh2B9yHfBv3YUDza23Q8jFZVOyJK7gCPPjwmk9wSoA/8qKqRWIqAo/4+DdBJ3sk 9vl3TJp+PT+zrBzHOTGhRzDCl8vJnkqAiTm333kO3WD9O10c9QFXKZH45nCndNaBPdUh Ra00oIVuwyHK843izR/VV4f+s/I8G8z9YiAdOWm2iJoN8lCDYFfmMrQDb4BMhuDWD2+b MxVAOO0asrOOja/czAD10PB7vY7sIJ930nCnnkpnEy/528el1daQlYk+e1+Zcirz0uEW J7tA== 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=TUsQd63TLzcOtPV3bHNQ3B/ceTCzSkLilXdyp3v/O/stYDmkjM/vUqfDuDwLxcm6ix pokig9o38mOc0IL6HUBpfvjwQbRSw4kHDnDEDBjovGhzZUdzZynkhmRoPvn5eGrjsegR 5U+2l5jQD1Jxer4eSzU2OI8hWq18o+JJ7pFNxZvXHrb0ZOxYSFK6Os5YCLftXiOo1/Kq YQthhaLf7afYE9A9h66r27aIfp4bjLwAVppLLs29NaL21dJ60dFL7k1xfoESITgvyDVr dsXMGhHFWw7AcdkREeDUHKpocCGboZMjqkzGw29GZVCO0YPhuoRBUeX1kq6GpgvGsbOc ePlQ== X-Gm-Message-State: AOAM531hyaNR1S2U45/voH+atFwok9UVQHq6XLH0Vg0HiyUBXMhK9LCI 7oGW+r6TnnL9U/ASZUWtAdmdbBngBMC1fg== X-Google-Smtp-Source: ABdhPJzCnZBF0k+VYyl47P4RsYZ958OCpC6IrG2hoFmWq7MEjywkfGAtGAEbdaht4ZEH+gcG/qteVA== X-Received: by 2002:aca:35c5:: with SMTP id c188mr2362982oia.27.1621939689859; Tue, 25 May 2021 03:48:09 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id a14sm3616832otl.52.2021.05.25.03.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48:09 -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 v3 04/12] doc: asciidoc: remove unnecessary attribute Date: Tue, 25 May 2021 05:47:54 -0500 Message-Id: <20210525104802.158336-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 Tue May 25 10:47: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: 12278465 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.8 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 3EEB7C2B9F8 for ; Tue, 25 May 2021 10:48:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C3846142B for ; Tue, 25 May 2021 10:48:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231391AbhEYKt7 (ORCPT ); Tue, 25 May 2021 06:49:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231266AbhEYKtn (ORCPT ); Tue, 25 May 2021 06:49:43 -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 42289C06138C for ; Tue, 25 May 2021 03:48:12 -0700 (PDT) Received: by mail-ot1-x329.google.com with SMTP id r26-20020a056830121ab02902a5ff1c9b81so28153772otp.11 for ; Tue, 25 May 2021 03:48:12 -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=Ncm1jUqzwSr+8Vpez4LgF+kC+1c0LHrEgQU4hfwGAwOvbZ90SevHFujPxPf5xK88Gz MBwWK4vuIHOmaFjCvavxuKtt2MbiIZDhIzH6RStthqqxGo5fer+t8IemDOUbK9Kd+m3p tV+T/LX0Xxi6ivTOUEH1wqx90C7DF7ERaclJK75vDt51oJR46xwtn4FVWw9QrX64zpGn obSGP9o8ZCzhFdoAOq53G8JRxdbQFzQ5/pxTqULUhaBRVi5ujlcoYsd9cTo1mBIBg7Yv QQG6V/Cnh8PIVTV5HNKxNoSFcCc68QQcV3jMYmZqasbmWvm4nDtXNoHQOe24x49U3SzX n8SA== 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=FffwAqTVSI6hBeL78rnkcVMW1+f/ancuVtF+wFXhn3pAEukgq2G64X1qqESAlrRfrU TsewajYM+4yOsorB/5iH7JF2B6OzQ2Sf3R3fr7TQe5OS6n2V6FBR3oVAhMcuCulBBsoY Dcczt0a5aRuvrKVzR8haiM4/PRCnvwFoEiNdKfipQ1tEc8J2DUwh0poyCZ3Ixt5ilEra K2AVXq+m6Ip4wBPiaiqXrfLDdZ3iQ3UEk0Jy0MIYFAC7hNR8qjT3CG8NJeW5YGvigbIx 2cgkZUWS70+0xa4LwuZZtTL+59iXZqjJXpWT6ncxIhOWAPt31EFMhk2SYSjVwTaJCVFE rYiw== X-Gm-Message-State: AOAM531no184/jYEaIUzz/tC6eyvhIIpzu95BW9NTQ4Cb7i0gdD10mZ2 D7OrojNPe0gT86DwtGgEJbvndHnh/+e+6Q== X-Google-Smtp-Source: ABdhPJyK8U06p+gsrw+OsBYHZSbRijXxFTQyNUK7HnRMo94MNhMRj3ZPDrohxTHPuVym5ybCQ20bEw== X-Received: by 2002:a05:6830:1184:: with SMTP id u4mr22867395otq.324.1621939691402; Tue, 25 May 2021 03:48:11 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id u201sm3132609oia.10.2021.05.25.03.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48: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 v3 05/12] doc: asciidoctor: remove unnecessary require Date: Tue, 25 May 2021 05:47:55 -0500 Message-Id: <20210525104802.158336-6-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 Tue May 25 10:47: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: 12278467 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.8 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 E70F2C47084 for ; Tue, 25 May 2021 10:48:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CAD0E6142C for ; Tue, 25 May 2021 10:48:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231260AbhEYKuB (ORCPT ); Tue, 25 May 2021 06:50:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230250AbhEYKtr (ORCPT ); Tue, 25 May 2021 06:49:47 -0400 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC694C06138E for ; Tue, 25 May 2021 03:48:13 -0700 (PDT) Received: by mail-oi1-x22a.google.com with SMTP id y76so20592860oia.6 for ; Tue, 25 May 2021 03:48: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=EKk16kF7e/fWcoT2lE5FT0Ad9dtbi0eGcmhTfn/6aXXxUY1G8/YhO3WjXoB0wfBygh XSJuCKsBgh2/Xu8ZTeS6sakpteL5MfItdyh/MkukEFqDWAkC915VquU2aBc0Q9BjbFn2 vtAyQsbUTWCYd2jC6k4/LSf2nvMHOG7gndN+zocMmB9Iyo5kg0Z0stXb6WYy9FnkfNOQ T0+ZQz2o8SzMzt183l57QfVkRKslW6qEr/AYEvZuBd/u/rxZ1a5uMwLMDQkDSkRKV3cM 3QJx3S+sWmkxxlXdtr9sCD5g+d7pZouWOdUHT/xNXNh/VHwWp3Sz8ZjiwKK4nGZnCFpD e76w== 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=hKjlTlz79C2gvpvZLMrSXoYk+Q8m6vq/FCi2yAGo9JLvZUZhh/k/WoE7k6GBQuAKCK bsJBT12MTu67PaYPK4Gqun6rKmik/6NQo7fla4IkpeIAQr1b9B8amKTBuB4Z2BM0Wnpi ytnyEt83ybafkcwakDG8Lj7HMmIpvIrZ3nBktyew6hgUf0r3cim8bMUyKs1FG5dUNqjo bozB5tZbUmJxh+krtuB8rKiTMDwpU6rUTYE7qbQa6Ze/5pxswHG8BHHdvoJm97eNK58V wfjm4v9y9TOkYocjvvRpEo1Ozjmb/Hk+8m3s/WMA2l/vDGM6cKFWg3q347XKcY+1EVqI lmsg== X-Gm-Message-State: AOAM532fTj8rjWfX/XX2ZvjsRikKjpFN8Z4zpzI69VmoCHioAv/fVyu2 ZzcYotyyEfnlOFP3z8m63wZzsllIF23FKg== X-Google-Smtp-Source: ABdhPJw8csKlh0AgidO6UWwIFaZ43QMVFMswBRgMUKvn5ST3hZvfoTui0XcpuuC0oVOwFsqOm7KwQQ== X-Received: by 2002:aca:aa0d:: with SMTP id t13mr1205200oie.146.1621939693015; Tue, 25 May 2021 03:48:13 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id o18sm3683075otp.61.2021.05.25.03.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48: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 v3 06/12] doc: asciidoctor: remove cruft Date: Tue, 25 May 2021 05:47:56 -0500 Message-Id: <20210525104802.158336-7-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 Tue May 25 10:47: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: 12278471 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.8 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 5A496C47085 for ; Tue, 25 May 2021 10:48:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DBDB6142C for ; Tue, 25 May 2021 10:48:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231434AbhEYKuD (ORCPT ); Tue, 25 May 2021 06:50:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231321AbhEYKtr (ORCPT ); Tue, 25 May 2021 06:49:47 -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 56FDAC061342 for ; Tue, 25 May 2021 03:48:15 -0700 (PDT) Received: by mail-ot1-x329.google.com with SMTP id i12-20020a05683033ecb02903346fa0f74dso17514002otu.10 for ; Tue, 25 May 2021 03:48: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=hIJXElLD0xeftZxcbW+ozTXARKWq+s8edoJuyUfPjvoomaBX0eCryGIJCUhzk6m662 JvEyGb9ka3mCukQM6RozwL5RYaP8PmTx8LIr7SUgZY43LufKhZquXT7GMC01IlJGPxNL 7WiU20RaS9WjXGTbwAh3wILHu47EAl944UtwmtjaVVr6YZ9jRGO1fNMODDryryx/1W08 MOrz25owh9qQ2hEQ0ZwhRF8jy2OJcMgoURyv1BFaUCvAmdJEPap2ybGrw7KZJpsIpIth FbaSTh5leGb49GfVggnv4y3zpBOyPw7DTp10EFjpBbCfSmJXlvRmBysFfzegSVt1L7xg wM3g== 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=PEiPJjXx+Nd3I8YblLAEhxkj+9bcRy822edigvhjuWlSgHONuSqbk5m/SWcna4GSPV 5DdLPS3n3AFf5DYugWQ9wzuyK8RoP5mr8acWmv0lvLE8SIqJsHeOKUoDZBNJjv8tDvmC V+5DG64sJ6e7UKIGqOxfO7sCQ0u4hsWb8sY0nhrsTzLaJkg3G4q3zfRtwxteo8OeGtVG v0KoBhRC4mMVm16ItVF4rTEaRsYkQ6YS4PkmsnV8QkDEoZ9c2uza/ALLx4bermsqj2IH BR64BVJQ3zpSUOjH3m95aUpuFAAFdC2p5EV7vcQ+IuGKb1kP/vKOk7oHRxOUn6ei3Wum oQNA== X-Gm-Message-State: AOAM532rENN7eBCsNRDqdwFzhwbTpdGe/1zGos+VM3nOacBp2HKFGoOr ybyTDYqge+lLKd4Uqjd4T069LqLzVHYHWA== X-Google-Smtp-Source: ABdhPJzrijus/S44e/eBkbTWrBOkk9esCoxvtWmW8nux4KNiwgp2l+BLhL/fThnr2oualIcGtRBNCw== X-Received: by 2002:a9d:6e7:: with SMTP id 94mr20349447otx.366.1621939694457; Tue, 25 May 2021 03:48:14 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id i2sm3667603oto.66.2021.05.25.03.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48:14 -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 v3 07/12] doc: asciidoctor: reorganize extensions Date: Tue, 25 May 2021 05:47:57 -0500 Message-Id: <20210525104802.158336-8-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 Tue May 25 10:47: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: 12278469 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.8 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 E8682C2B9F8 for ; Tue, 25 May 2021 10:48:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6A346142C for ; Tue, 25 May 2021 10:48:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231416AbhEYKuC (ORCPT ); Tue, 25 May 2021 06:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbhEYKts (ORCPT ); Tue, 25 May 2021 06:49:48 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8096C061345 for ; Tue, 25 May 2021 03:48:16 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id t24so14339556oiw.3 for ; Tue, 25 May 2021 03:48: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=e52JML0fiTDihhMfJljpg+XRr4AHBsvdRHHBuwcL/OcaisHdV2sL5uPoUTSWCKNNn6 NWSiZmkgww+/eMYJi5S91OIOoN69q8LsBL5c7gTmaO16a6hzTo1P3LTEdv3Nx2yP0ivB i715palBnhK8mt3xVpGWVZ+T2WY+pgGovYbQCimGsU3GSIhcEu3SNwW8HT+jXzAyvWPu 0NhmEP8pbBf9eWcTV/rxz+5WOU6CZexDXw4cyI/TSecql2XMQIe4VIzVFYc0zC3hSudh 9aspOhsiR3p7gg0FpX8svksoqk1dVbIPLrF6+LPc9GGHiJJi21oMdHrKkWCueQblh9No PVqQ== 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=uOzad7PqJMUDryFDkAis67Di3qm9vQ3jRcKD3A6okcEXnzB2k6IUcbHqYrDCQmxfXH a2h9rOBy27hLO59nhG9pJ/X4/nvhh5bt/TBCATK11wfkQMmk/b6RGK9M/AjMFh1IQFGM gAK9JvL8R2G6t0l4w38cYzxprKB6c/nFCUUdlEzQzPCE774XlyCL2akWZND7PPZNbiic k9Id8Af/nEuY55CZ+MFmbYZNaEFHUeWyrZnqwenwDEaxKqVRRpWMFHLIxYhOKmGQfww5 i9E6kPz/6IcCHv+Elw4b8mxx6MIx9OWxdB7muO1Ot9WXA7q8aFmX8VO3A+hRtoEvbNJi iMOA== X-Gm-Message-State: AOAM531VtNApLhSIns7Yesu8VuqSF9DiEm6ALynndvy+/NrOw8RKsunB 1MJD81fk1uZr0Na0oFfrftBBGDm5nSuqzA== X-Google-Smtp-Source: ABdhPJw/nd174Ziy2v+SJp4W6YP6imG7f5arFE9PtC5x9jRuSvmwMCmmvMkjAuZ86b04N6f5EG6v7w== X-Received: by 2002:a54:4e81:: with SMTP id c1mr14294113oiy.119.1621939695967; Tue, 25 May 2021 03:48:15 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id v19sm3716569otk.22.2021.05.25.03.48.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48: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 v3 08/12] doc: asciidoctor: use html-prefix only for html Date: Tue, 25 May 2021 05:47:58 -0500 Message-Id: <20210525104802.158336-9-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 Tue May 25 10:47: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: 12278479 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.8 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 85E26C2B9F8 for ; Tue, 25 May 2021 10:48:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6AAF361404 for ; Tue, 25 May 2021 10:48:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231321AbhEYKuK (ORCPT ); Tue, 25 May 2021 06:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231406AbhEYKuA (ORCPT ); Tue, 25 May 2021 06:50:00 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE425C06138D for ; Tue, 25 May 2021 03:48:28 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id b25so29920195oic.0 for ; Tue, 25 May 2021 03:48:28 -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=D0227bqOcEPYTwmzAdKO1Y2jC4F9gwARjfm0uHj+1qSHX5bn1XVBEgyr8ZPnWlaot3 ESMLiMbsESjv+mqU197lscX1PWEX6Vg6VUbSrdyM6yN2BTp8+2Qmu4DS9JzAPxWM3z4e BoE7zqhDkR2ys/OY+f4cDxVlisZEWBpLSnSQapaoAJZx1OVAEUs3UA6wVknMZrot2yIC 7iYmVTbleAgGqDZ8gVvGnKc+DVYHye3SOF9KoAHbfXs6k2tnWyM4iel4ef1YARAu8KTZ M7YfrN8nhdAtXUPCiRG14XpURRwB4h2iocLJHHnQ7HG+KlDde3hmaDPtNmK6cNk0tWWr 2Fjw== 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=DPzRzqZOmGeUFlSoGIeSA9ZKxxJdu3USGMZvOIl9fSCOYuh9L1oUIxX26cvHbdgSJQ 5/H3KKOtOezxThfuB9E3ubk1u8IMv3O5R59UuZJkiszG8MbQQavogP4ekd7BpHwvPTCU k0mbX1VdL1xzDgb49Kg6A7PF2EDfLavCg0Yc3WaNcc6VQ/jXLWk92+Uy2kiI1HJ0Xi2L Xi0O6TD2pqE/Ig9zHl2JDQVlFj6Rmu72MrlZtaZWuP3a8yZ9G32t/axq6QxxSpGj2U9I COStIaMkx53aWzBK5jnFdgikJ7n81WPzceH1+flpwkFYGfJquoj6sd/nihXcLRNJyhxL h1vA== X-Gm-Message-State: AOAM530DWedjBE1Vm8j1CFdcm8cISQG0uTYmSqlarbYTICX889tvFJVN jOMePYVpAIlbrBQFVPTdwKH44RyzU/qhgg== X-Google-Smtp-Source: ABdhPJyN6ZnREcGMcimDVtQzr7KyCUOXoH2eyHUF2uSmToN7YbnHHR/RxwdKVpOcZaymh2bj8L5Y8A== X-Received: by 2002:a54:4594:: with SMTP id z20mr2362729oib.100.1621939697340; Tue, 25 May 2021 03:48:17 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id z15sm3685403otp.20.2021.05.25.03.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48:17 -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 v3 09/12] doc: asciidoctor: refactor macro registration Date: Tue, 25 May 2021 05:47:59 -0500 Message-Id: <20210525104802.158336-10-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 Tue May 25 10:48: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: 12278473 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.8 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 44D88C2B9F8 for ; Tue, 25 May 2021 10:48:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29DCE6142C for ; Tue, 25 May 2021 10:48:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231472AbhEYKuE (ORCPT ); Tue, 25 May 2021 06:50:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231286AbhEYKtt (ORCPT ); Tue, 25 May 2021 06:49:49 -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 05042C061574 for ; Tue, 25 May 2021 03:48:20 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id d21so29820062oic.11 for ; Tue, 25 May 2021 03:48: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=vffLvgmfFS9wb4jDPZoMWjW0LBwQ0WKuvPka+EOo+wHTaEQoqLXNa0krIgUSfANdSC xm+qe1WSq+ks3g0kr5SpLhoAD5X/JqgQ6xhLCsb8+yUIh7wPrXjcFaGz7KyCdFKkcVML rSRuHJv5poyBWjwjZBDg/o7p2T8tVSwRirHkcRfTAbYwbvxbrQeahMN8Xxtdh56z+lmu dlNbR2RB39F7TdbWEJEvd72wPphJ918hgCmwFevaZlh1UGM5sA2jYH9hY7423Wz+W/US ZoyJWaI/sZIMv6Ic/FMc5pMXrnoQLM2dy2MuN1adpdBx5g2ZKoGxV9c3yQ5FCH2Jp42H GQyA== 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=WvgJXLiMvuwKvDsfwqd5PmpQtdhCiXpovDPgO/q6JVZmkwnY4bTl6KwWsF5nUc/55h k9Xlf/3HFwAB2RqpXNUXzsX0rBi1rlzIxUQKNDTtkecxrcuGZKso3TSLygqqzznQBz9r i1JftzjjLJfGOQTIqNp627My32GWHY6Hv0h/kiA7b5olIeQge9b/eyF4GSVWDBoo3xU2 dbWQDvJXsVCtzvjvz+EA/bTilgxea+xpOMi1MDUql6JgDvAa1qp77jSUIl5qXGkfay8E EJsyR15UXeYKuOIDROn2ucdWmdFUGzvNBwzEq7U4kO6TiS1qxDFuY0773osVeFtPJ9Ya eLtg== X-Gm-Message-State: AOAM533j0keroaw7eNrbfkG8nK9W63fdDO4MGhkCjZMPVdJHm0LzMoKl U5UBNB70Bz9I49shVDK0YY1ZFc+EWzpaIA== X-Google-Smtp-Source: ABdhPJy0azPHDK2RrGwVbt4sMCfrEirKPKBQK+Y2d1my647pc9zV2WycIUx+EGedH2IqSBNkuePjTA== X-Received: by 2002:a05:6808:8a:: with SMTP id s10mr2336623oic.66.1621939699149; Tue, 25 May 2021 03:48:19 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id m19sm3431802oov.10.2021.05.25.03.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48: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 v3 10/12] doc: asciidoctor: improve string handling Date: Tue, 25 May 2021 05:48:00 -0500 Message-Id: <20210525104802.158336-11-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 Tue May 25 10:48: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: 12278475 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.8 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 8C6E0C4707F for ; Tue, 25 May 2021 10:48:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71BE56142B for ; Tue, 25 May 2021 10:48:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231330AbhEYKuF (ORCPT ); Tue, 25 May 2021 06:50:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231304AbhEYKtw (ORCPT ); Tue, 25 May 2021 06:49:52 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61010C061756 for ; Tue, 25 May 2021 03:48:21 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id 36-20020a9d0ba70000b02902e0a0a8fe36so28116751oth.8 for ; Tue, 25 May 2021 03:48: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=Q9HZ9oCexh3Kf4FWf3thisfwtcnYOXpP5rm5b/4QcuqnAwoAKIlKb55EAh5mPqVduE WQVMQAmAm4hK5tMBYvqv8a0Qp/RPd2/fNQdj+8bAuUupElShuU8mNpccYlVUGGDSsaQG 3bvykG9W6CUOhz+oGsktsDlzoCkCEDEPHMKEAtlxuENcCqKGAfXnyXcv6fO1pDvvSCcP E1eo0KUHT3kSIHWLjAmurxDKg+x/1OBySNY9Jp0m3cQppvHaxFzflP0gL9mQK/wx6Wyl /4KghYoN19hge+PWE73mZa8yFIVe/baf1Rgf6vCd+vQHWJqDGKuCr32yyOYUcilzDeE4 LWyQ== 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=BlQDSRLt8aOU1e+eGXLNFxYlSSBgsItEl7Qgx59JT2EXBhR//WR9cjEKlAwEsxrIry tTA08owWTAo7AmEaoTu8WbdAXV/gMm+7SxqIWTEiEyBb7TZcOOWw3kncVbgYDixM5QLu eiSDWVkqiKwDeUur4ErK576Ro2kZrkuWhRH6lTaGOTE6uayG3uU0ewJe43QGJyrqESVz MoOSZmIFAqK0F1GBS6+d0tWBG7zIdkfuSzAraHcRPnk7BwixaoqjwpA1oRfLhSDgeKay lUWnkWQElv+P++rQHgbc0g5AxkV+Z6MaFMheuzMXwiRMSejbzd7CdB6e8MX4zxHWP2aH 06ow== X-Gm-Message-State: AOAM5329QgmIiKqLejh+MzboMgvVx60eh8LnNDptJJ7y59i/Lj2EyB6z 75mrFuwQDxJCktpezC+2owunFmjSWH4anQ== X-Google-Smtp-Source: ABdhPJzeHZBfgUAIOsyOxO85ZfhnxfmaVn1o7B1178yVuJlJQt68kNvjqMVLUzYDArb5j5fX9iPikg== X-Received: by 2002:a9d:121:: with SMTP id 30mr12438575otu.299.1621939700517; Tue, 25 May 2021 03:48:20 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id q14sm3397470ota.31.2021.05.25.03.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48: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 v3 11/12] doc: asciidoctor: split the format from the code Date: Tue, 25 May 2021 05:48:01 -0500 Message-Id: <20210525104802.158336-12-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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 Tue May 25 10:48:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12278477 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.8 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 1878EC2B9F8 for ; Tue, 25 May 2021 10:48:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0004361430 for ; Tue, 25 May 2021 10:48:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231522AbhEYKuG (ORCPT ); Tue, 25 May 2021 06:50:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231182AbhEYKty (ORCPT ); Tue, 25 May 2021 06:49:54 -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 C486CC06138B for ; Tue, 25 May 2021 03:48:22 -0700 (PDT) Received: by mail-ot1-x336.google.com with SMTP id 66-20020a9d02c80000b02903615edf7c1aso6282991otl.13 for ; Tue, 25 May 2021 03:48:22 -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=kqs8i7EMmMJH70sAXhEGsjy3wgMaxSyv1ONIiVBCJobWUXfzPbP4VI8gF3FNHGDBLz XXC+DtaAcxfggVewTrPw+MzYgBFqBbwBo436RaOR0lbpgHWI8PVfKUtl6euuwAx9ln8l x8owwQRm+3w+I/IEx2/txB7aKJcYXZ17zX+mwictqEGSmyZqh2fUJw8Hx33tsl1lUMFZ 2hZnvjGXfVBuyk0pzWtxxz6WD4ZeHqP1dW85BujYskjp6hwNgHwujTIw+EcrbVePMmom bG1blZsR73k7BH9a/pvTp8MDyOqCnxXbgSTSlxZLqIYxrcn/IX7W1FEFMtSrIJvjEEpZ rcIw== 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=kCus1t3w0A9I0akCvkBpM0YxfHD6aMGoL2WvrqnHodIYpf+vvEiItFff1Lm8Vjrhx4 FpHzewOlQrrfBgTKAmtyVzfR83A3IbpzOJxZG2BmXcj3bPDUwEp+iuP3k287QzMJK0gd ufknSCQgi/KHAxEubF47vzmKESrztBQxzHS7W70XzmVCChHm1kBKe/yNm9ce+4ULIngq ma8cWsQGD7SmEdhBHt098O3vgTp/z1pSdW/0a9dcIb356pxvGhnLJYMq0X/0kpCbwiZb ZZ17Hl7Z2jma8ofbjx6KAOTceErRGzFL0w3Qr7jyBazd/E9Od0yx45EmdRX2SF/ECDvk zfrA== X-Gm-Message-State: AOAM530V/B15zWei5HpcwHqUFxtqRtKS2DrqpjB+oPm/Ai4POqPVFdAq IMeMx+D2Xx5r5XeDO49l1XAz+j8IfSit4g== X-Google-Smtp-Source: ABdhPJzCO2V72GfekOLwduBdtUJn/WoG6V2q6ObyZfaNZcibI6Vby7J9BSozK1Fco9+C8snZEAiG0A== X-Received: by 2002:a05:6830:140c:: with SMTP id v12mr22384530otp.310.1621939701997; Tue, 25 May 2021 03:48:21 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id x5sm3572646otg.76.2021.05.25.03.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 03:48: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 v3 12/12] doc: asciidoctor: specify name of our group Date: Tue, 25 May 2021 05:48:02 -0500 Message-Id: <20210525104802.158336-13-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210525104802.158336-1-felipe.contreras@gmail.com> References: <20210525104802.158336-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