From patchwork Tue Jun 8 09:00:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305909 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.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,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 B29ADC47082 for ; Tue, 8 Jun 2021 09:00:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C7426127A for ; Tue, 8 Jun 2021 09:00:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbhFHJCc (ORCPT ); Tue, 8 Jun 2021 05:02:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230425AbhFHJCZ (ORCPT ); Tue, 8 Jun 2021 05:02:25 -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 A4ABBC061789 for ; Tue, 8 Jun 2021 02:00:31 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id u11so20888617oiv.1 for ; Tue, 08 Jun 2021 02:00:31 -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=kqH8wwsHCWokbeTva2op1ZqKhg5E6HsIYHzw6wTYOhQ=; b=Brj0WF/PPJb8elDa+O5P9MEkSAo/N9zTAW2DKl9ttGwG+GFMo3YlN4mkjXnGrQVAlF oyO/CenU7OK1hqrT9WT0V0OcehIWs3RYsKwIW7nNojU97ryK24sPC4bfefWiQlbCkAHc X0Oq0npL8aiMbvgxcVDtkFJ553txld7GT0OCCrDixy+gIjTR4sqBVGb9DP9D7oL4c/KX VvcvV0SX7EaeqffA8RKP2tUHV25hTiGe8EuZfYB+Ok2OpRBZXZ7EhMosNc24ZiE47U22 rKy1QrzqwXlVN6winGBKLWFwW2HZAFVOax/XN6TOmW+WT6r0UaRhIV1diiyIUf09nOJ/ pJ4Q== 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=kqH8wwsHCWokbeTva2op1ZqKhg5E6HsIYHzw6wTYOhQ=; b=FU8ADO2Yp4ya/Jv5Nv06qhNUlHYPI2xerRJuxSS3OpFv+QxPfeirIo4lIjb3Narsa+ htd2qsmKU0jnTLO6X/lhkjDVS0+FUwizihrW5T5coYFqD7+nNJ8K7kMG+43xdl2t8f4u pMV/BYdi8/eGwivCzpwJnoYujUW90PRclabYRWpIWmlArIBy3pJMduGNH0Ha1A/6V2Tx n4YP57ha30gzt2P5GJm9G71wUs1Cml+j7RlzFitx7f5cHw+sEFspm+PAi38Geyok+DB6 CvBgJCUK5ActnYRhb4QlPZca+8pWQ6OJbcUu2Ov2/x2hsvdH7GeK3XeNla9VIEg3rYy5 Otng== X-Gm-Message-State: AOAM531Aj1nPIYq6SDRSOMBVqdSGCP2DX7cs/R3qY3LKkGZA4PqpTTlS 5bFMrLIQynNVSOCn+fsaYkwe9Ojgcduugg== X-Google-Smtp-Source: ABdhPJwnhEKBwlXfqqg0MwBavSRA1BfKrCRN2fjizPQ8KYXWd9bb9JV+lCky0XNDxEjQv0elQYnQRA== X-Received: by 2002:a54:448a:: with SMTP id v10mr2160390oiv.133.1623142830797; Tue, 08 Jun 2021 02:00:30 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id w13sm2935251otp.10.2021.06.08.02.00.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:30 -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 v4 01/12] doc: remove GNU troff workaround Date: Tue, 8 Jun 2021 04:00:15 -0500 Message-Id: <20210608090026.1737348-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 c3565fc0f8..7588c43f05 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 Jun 8 09:00:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305907 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,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 31D8EC48BCD for ; Tue, 8 Jun 2021 09:00:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 194836101A for ; Tue, 8 Jun 2021 09:00:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230396AbhFHJCa (ORCPT ); Tue, 8 Jun 2021 05:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230432AbhFHJC0 (ORCPT ); Tue, 8 Jun 2021 05:02:26 -0400 Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE54CC06178B for ; Tue, 8 Jun 2021 02:00:33 -0700 (PDT) Received: by mail-oo1-xc32.google.com with SMTP id j17-20020a0568200231b029024900620310so3577700oob.7 for ; Tue, 08 Jun 2021 02:00:33 -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=h8/eyV1qb+6mgBqjY/qSKB6syPC8l5ytbfE60lrcFfM=; b=U1eGASghxaSOhfgJcuk8gTDtaPuaqJvDqByDd0awyY2iH1lj24F/61zlNsdu0tCdAK NP9SKk9nViDrUbu7qPscSUXHqyVrRN7Mvy7Jx+lpHSNvkuzl9B2usCmGwif5HX8ZJ6I7 F7B93QlipJLDmdnvyf1/HzoV96X9UawM0F8nu/iSOcE0zwflMEuXJ6MQntDaiASwXT+i yWP8mMMrh+ZKbgCMyqtZ+vmDSgdh7hQYq4ltzy49VP4DaFaw5DpBF9HShdB4OuUTP7Ng FYrV2a1YbNDGYqYK1z05n+YGX+CbvYouZt/0pD9aaI57+LiO83SAOaw5UUGtyzEVIZf4 gjpg== 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=h8/eyV1qb+6mgBqjY/qSKB6syPC8l5ytbfE60lrcFfM=; b=TYzgGHky6wx5MBf3pw0KRM85ULseQSt3Dwq+78CObKujgofkENG4m/ZVWIA2eGpMcV 2Hv+Tq6q6I2sERuUiXRTvDk3ZenRxDE6ofeekxKUTQ2iT1q9fFlA38zYeDl/wcuiexNO VFwyEx1bWsjV9teEaGrOAcPMAkqguUB/CEx9P/IZ6dPPyOgrY55UCbZqntMPxHRNci+u wCEESk0EzPHn81SVFsNF0TS9N1rHEYzB0eJfybZPBip6mlmDWTn62KvUfzkQVz1HwfdC +nuIsgc1gX3xpTR6D6eL1fgWDtbP3gGNZeyL0PQDX9gUu+WisLDeOmFZRNgnubqbPwoE T76A== X-Gm-Message-State: AOAM531WGfLeCHzXpqu8n922a6ux+cJ8NGBzZaU8L0dMwIgsKT+ABpka ub2KCo3nPE0bwgzRsB+98fkDVhv1jHnxiA== X-Google-Smtp-Source: ABdhPJznJD26wR6l0UF1ZFuMCYBNdD+uS+5//waLrRANXV3s72iuOU7WJtxFLNEydoSF+QCbCT1SSA== X-Received: by 2002:a4a:3e8e:: with SMTP id t136mr16642151oot.83.1623142832811; Tue, 08 Jun 2021 02:00:32 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id x2sm1803950oog.10.2021.06.08.02.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:32 -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 v4 02/12] doc: use --stringparam in xmlto Date: Tue, 8 Jun 2021 04:00:16 -0500 Message-Id: <20210608090026.1737348-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305919 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 2F1B1C47082 for ; Tue, 8 Jun 2021 09:00:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B9426101A for ; Tue, 8 Jun 2021 09:00:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231219AbhFHJCp (ORCPT ); Tue, 8 Jun 2021 05:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231192AbhFHJCo (ORCPT ); Tue, 8 Jun 2021 05:02:44 -0400 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A4C3C061795 for ; Tue, 8 Jun 2021 02:00:35 -0700 (PDT) Received: by mail-ot1-x32c.google.com with SMTP id w23-20020a9d5a970000b02903d0ef989477so15224703oth.9 for ; Tue, 08 Jun 2021 02:00:35 -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=FPhgeea0hgSTeQX95DzXixHWi+cAG4FdK580HtwyJbE=; b=lp8XlWc5o37x4LqL0+c2zPU4XdBcGT26Ch9V/zXWJuZDO4AhjPQ8DmPWI1x3XQhHee fGelUDrHFvNRjHNAWB9t1cCUWsocnIc9czLi36gg6bnIQmisNkA0LP75YztgBWgd13PH OBytxHZaR7Wn28y18RuWXk0KkH4Rw9PW4HWHLSmPhtO1Zoh9YmcgBr0Uo0wcwOklcpAn lphxBEJlo9mvXUqAomlwzwNtXKVTj5NJpLcP2Y9J1hidyztwkLajvH5EsrCbhOUTUZXc Dh2BTAOD4bkmSpHs93J50PWHlT3se3KQw5zWmPRDgfGk2n0vxaQ9tqB1k2ocB8gp8dXr UQaA== 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=FPhgeea0hgSTeQX95DzXixHWi+cAG4FdK580HtwyJbE=; b=iOd7iljjKdaLY6TefCsDVd8PAQEDIAWv1ZXFSi4mjT2OqgQ4EKK4z2U+CW7Yj/d3lI rhKwDDz/MxBXz6e4XMcsKroAIx2qiWb0uXGZeRU2If1CShUyeXI7NShKhKvKGOTYUDRG TT+7mcVWQxo7fdG/v2LHXucpErTSR9W2ght0fe7zj0iKefl/t5MdP5gR1tVEdFCHGVVo 0Zl+2g4LoNKyxyeKepsHAG3w2ZJwyKSba63441D1l7lDSsZrwxYfjeD688sAJWGhWK0F 8ZCicHauIrQgdoptoQSLFKSPeni9sJf80v+jDCaQ7l+wrk9KpYl30+ADOtqm1kXqfbFG gf1Q== X-Gm-Message-State: AOAM531ORA9YOMRowKOIr90Jq3ESAopPy3/K0gS+CQbkZI4qiR6eDwUt C9rnIhpNH79Po0zCtTiZre44HMex3AqfSQ== X-Google-Smtp-Source: ABdhPJwb1SzwLSC1hxkgOxc2bxQjhzDpQaIHvZNYTxz44t3Mq9SGVbSMhhL3b6FsWK3KJJOTz4KB/g== X-Received: by 2002:a9d:8c2:: with SMTP id 60mr17299895otf.217.1623142834369; Tue, 08 Jun 2021 02:00:34 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id 102sm2935130otf.37.2021.06.08.02.00.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:34 -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 v4 03/12] doc: simplify version passing Date: Tue, 8 Jun 2021 04:00:17 -0500 Message-Id: <20210608090026.1737348-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305911 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 21AD1C47082 for ; Tue, 8 Jun 2021 09:00:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 042C461263 for ; Tue, 8 Jun 2021 09:00:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231160AbhFHJCh (ORCPT ); Tue, 8 Jun 2021 05:02:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230475AbhFHJC3 (ORCPT ); Tue, 8 Jun 2021 05:02:29 -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 26414C061574 for ; Tue, 8 Jun 2021 02:00:37 -0700 (PDT) Received: by mail-oi1-x22a.google.com with SMTP id m137so16988619oig.6 for ; Tue, 08 Jun 2021 02:00:37 -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=a5KgwGlwLHzGtv5uxkotd1A0NZNABRJclx5c3gKg/7s=; b=dDvUErif9y7Bk7Uua63iT91t8vPtoqDd/PaAwOTrTw+OQCEU2upXrJy3fNuNW+lijM TJbHw9Z6ub0nFthgkCAHtEoGWgaQW5zuohmNFlSJ8kZHZ7ehRLlwY5PmZtR/udE/6stu ztjWlxccuDLaAlLnAAWl4EjdpvyMBr+hruHgoZrqZAKKkH/FvEfsHKdpGJ6V5YKuV3/h grcyLXglb+43PSfQmO5sGJRCTVhomm5iGTqrCtu6m1uQtUIH1DW9Peid9NZjf/jaPs1e Yob4oqjP9cyEvsDJKoNhvvJqp8WA85GCUxBREjEKGEhaDTTgnuqnIpQ8GBmcn+5Eq5mV 0ZyQ== 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=a5KgwGlwLHzGtv5uxkotd1A0NZNABRJclx5c3gKg/7s=; b=sjpGv81FDA4IxlpOh2ApJMX3nxOpx3NBET3sj2UjcxcgVJOmqvKz1+Ce/T0TOzAECw SX/jy/DYPX/Lrpvk2CmSFlf1qVSamVZz9kqzNXWyr74eRxzbFmumD8K962TedV5I0raZ QRX6B1VLLXWOpR2lTA242MXMmDiAvGK4d73cII3DSWjnUz28Kkx7c5b8/52y3aux2HTU 1HvvOtoLZgEn8WvK7hAhWWqOPdSx+qQ3TvXDIBHcG8RelJIBpru7x7VPvxxWY5jV1YtB 0DxCznbYI+o8pVdQPzVma0OL8ClAeyKaFcJKnDqdUb48Lm/rBYv8quE0IKle/KdouB/A HJqQ== X-Gm-Message-State: AOAM530TyxfZDg4u0yCPQ2gdXQvIPW/Vkil6OWQlLIGT9dVTubks2kHd vQhA0+5M1B8csiLseRpYUcvAVFybz/0Brg== X-Google-Smtp-Source: ABdhPJys5yAVMEYhJXIjO/UpousmfHU65keXegzch03ROfQ+06aFwKJ1k1qCTh8TECCBbvno0YD3rg== X-Received: by 2002:aca:39d4:: with SMTP id g203mr2110017oia.158.1623142836338; Tue, 08 Jun 2021 02:00:36 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id q16sm31052ott.56.2021.06.08.02.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:35 -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 v4 04/12] doc: asciidoc: remove unnecessary attribute Date: Tue, 8 Jun 2021 04:00:18 -0500 Message-Id: <20210608090026.1737348-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305913 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 93854C4743D for ; Tue, 8 Jun 2021 09:00:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75DA56124B for ; Tue, 8 Jun 2021 09:00:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230438AbhFHJCi (ORCPT ); Tue, 8 Jun 2021 05:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230432AbhFHJCb (ORCPT ); Tue, 8 Jun 2021 05:02:31 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF42EC061789 for ; Tue, 8 Jun 2021 02:00:38 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id c13so15324260oib.13 for ; Tue, 08 Jun 2021 02:00:38 -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=X8ZnKz3xfrhMWL3GYiDOz5gzuaiMqVIYBIb2dnJ3AXw=; b=m6s0nim9QNnR+lSuf8U6vcF1vS4XOQaRRF7L1nlMuNkTDgqfyql4SZbSRZVx6piqea yqlA7+L/0V98B1OtLFlXYvNHkw4/BftZS/QafT4UIgjeBUFvjZopiQthlyK4GuZdcQTk QVK/5ttIZw/rsKUhv/07WRVBRip7vo3k00uSBZXuSYgaz4v8oqjYSfb/rj/CO5TGrObZ 7FTHpvN+3etNJWmknCyzT3zHYnukioh2752QHmNVNMYeEyuhpjdM1aDbuQXDdnFVgHtC tRw31GG1i+LA6mZaBThT9LnJ7Yy/KDCfDgJWJURlXleHIkfKlMvUhJO1EqYGyxSnEilZ /Cxw== 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=X8ZnKz3xfrhMWL3GYiDOz5gzuaiMqVIYBIb2dnJ3AXw=; b=bH6Avp9783fUl8AAJl0bYNHFVP8WkP2ws3TesR5znRdttzWY3ZBCXKLZZRGGuH6yDZ cSvitR2YvtTOgH9OdSOie0obaZnCbZbF+Bgb91+LBZ/7QqnD6Nwc98Gn4/On9AC4v1tN K4H7670keK7nujh98qrLFmw0PRSUpOppHbYNoLV894ef/UsBIWlOTdb/71Z6SPmV31x3 ov2knP/4yy8zGTy99LImxy1P6a6SwZEh2tnDcZFgaqEi0D7OKHnM3WeqP5XLQ4p1TnkE eWGlfdABSy2BbSIdhT6/ayMo6kHOEAwrmioE+C+thkxBTs2sv9Wa61LJInB0kbWJspSv nEgw== X-Gm-Message-State: AOAM5329kBu7/5KWnwDSMgHHiMwR+LoWsOv7w96nAYO0Kyo/tNxcHiM8 nl/lkfJGumlLzs+213mJbEBjU8s2p8XL/Q== X-Google-Smtp-Source: ABdhPJxYSS6N7Df8CVRLxsxr5JvqU2yJXjBeBGqTXdDojUCaw38VIT/mT0gUM8usGXAPNuJYRZ1otA== X-Received: by 2002:a05:6808:48e:: with SMTP id z14mr2056937oid.34.1623142838155; Tue, 08 Jun 2021 02:00:38 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id 22sm197076otv.8.2021.06.08.02.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:37 -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 v4 05/12] doc: asciidoctor: remove unnecessary require Date: Tue, 8 Jun 2021 04:00:19 -0500 Message-Id: <20210608090026.1737348-6-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305921 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 A8ABAC4743D for ; Tue, 8 Jun 2021 09:00:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92DDB61263 for ; Tue, 8 Jun 2021 09:00:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbhFHJCq (ORCPT ); Tue, 8 Jun 2021 05:02:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230522AbhFHJCp (ORCPT ); Tue, 8 Jun 2021 05:02:45 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47387C06178B for ; Tue, 8 Jun 2021 02:00:41 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id j11-20020a9d738b0000b02903ea3c02ded8so6031115otk.5 for ; Tue, 08 Jun 2021 02:00:41 -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=+HiXRJzWoSCCsCEp32rzDC0Al1zgvKH07HmijAfP2EQ=; b=Mi6h33Ik4sqH112q3SjZgFMseL9BN+yqiAR5LOOVq9Kf5HHZcc+wVUK3k8PCOFkauV P9oMpiWxGYx7XmhDm5S8w3Xlu0KcN6mdQ3x2cTMneOvXJIjewsa20qw3mKk8GDNWTGrl 2sj0zj/FiSiq55tFCH1r8om8vmgmlLgUfBNcDgvF3vD1BMDbT2nY+b8JqZEpD+X7DGop ADg8c7DA/Nf5NIExAyoGNmWsRDkvwrT/YTPlv0wxlRROpporhPmwMtnQ7X3kQ1ew8abG IK+q/yuHmQYFZuJL4NXcCf23UapDxV7mfmyzuUjGOleuvC/wjNcGxxdM3iPzd6mWb6/K kNtw== 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=+HiXRJzWoSCCsCEp32rzDC0Al1zgvKH07HmijAfP2EQ=; b=ntD9trbeJp7w0m5sKb/sum/+oX0KwWtXpFUynRoR2F25Hx1C+/1my9IbQBEy3YBaca a8fd3vtHiRSr+qMk1L705gKXn2E9TIsVAOLJO4uuogAB/7YRvJJU93ijDKTtLiPnKAeo nH3Dr96E/kJnuub8Ui8oLii2c/uRfSIqeJQlJqfpI0FlKg3fT8G95WIYKF4i+xdJSJ2f O+Fwjfcu1uroycZu8h7/Pd/y5dNf6tQBUgpvfIM8Ixlw31Bf/ERIIjqz5aXyCWzaBpRZ R3nlGbuhhI1lZPmv/HbCLpZTvVoM/tcFlTFzZJ3GimyP7yADnwV9MFAPYWV+378X+WbF ys+w== X-Gm-Message-State: AOAM531zqYFperpz4pqDQRtmkbgWRnjtp7i3H33oOgXIe2SbumpUnr+W WU5bmi1NsORQOBIiCy2Ue+waIoB3adv18Q== X-Google-Smtp-Source: ABdhPJxs2Xf1+I1uF5W+Udot14Cp4wyjosyJaGikpU6T1/Z4LwPQPTAA3lwr0kUA25ylD8WN9mWgmQ== X-Received: by 2002:a9d:6453:: with SMTP id m19mr17643522otl.63.1623142840509; Tue, 08 Jun 2021 02:00:40 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id n11sm571313otq.63.2021.06.08.02.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:40 -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 v4 06/12] doc: asciidoctor: remove cruft Date: Tue, 8 Jun 2021 04:00:20 -0500 Message-Id: <20210608090026.1737348-7-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305917 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 ACA33C47082 for ; Tue, 8 Jun 2021 09:00:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DFE46101A for ; Tue, 8 Jun 2021 09:00:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230405AbhFHJCn (ORCPT ); Tue, 8 Jun 2021 05:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231169AbhFHJCm (ORCPT ); Tue, 8 Jun 2021 05:02:42 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C72D4C0617A6 for ; Tue, 8 Jun 2021 02:00:43 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id h24-20020a9d64180000b029036edcf8f9a6so19647463otl.3 for ; Tue, 08 Jun 2021 02:00:43 -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=tYqVKGFDzhF3oKkFkIFyWHNPSjXukCSwLZ4oy0905Nk=; b=K6d3YK1W22lwyVZkh8eN0tTDo4axE84Sz7Lly4G2y0HiTzWx+jVKvZbNbEd5eSkoX6 OC/TpnIwHeP6f+JdCZJiVHtVo1hvg9i5dMfNlkEtZM35ZF3PmKXRheFIOIevLAHSvQiR cqRX3Lh+bS9AMFeaWfsxUkn3IVUm5GoBX7jScKjyxHYAyg8zvdzvO91PsuO47c1HtGKK eJeCPV7Y3HrHuR0UB19Q/IaoYdayNYTcynPiNXjWw/sjdUXCJBuz+irPu5m48uRATXQp bKZwQJ+iZNqY5KEJCIfGOP4993cNKUVEMyKq23CIj7y/RSpHnHV78ihaGZIYMGJntawO Xnag== 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=tYqVKGFDzhF3oKkFkIFyWHNPSjXukCSwLZ4oy0905Nk=; b=nxLsYYTe+eDMKPhgiIxbNGE8eONeO99oZnYZRB2fsug6rjAszH5P4wkfsv6y5UmiTI u+QlLsgTWBBYrjysBAmIPDhBEtIPKxXrPEE1WZKltDPgckjiQAWYTh6rHwut3jOzAWUn Ktf5GpNkczJ0/F+q7INmMl7XxqWDWkZBrZZLhvoz5ZPO2du/f6HhAea6LIhHg4FGH3cM GHHOni5sVdwcG3XmIgngW+k+ZAr1y2DwOwQQpJrQfjBfNGc+itNrgWjBIQBNEO+je+qv 2qjZAsu5NQ7V2AFWIXO05Wxb09OyjSADu78A54vKF5KCpikLh15WQObEPByDmBwUFqcX ofxQ== X-Gm-Message-State: AOAM532aYqlX9+VSkp0r2j+j/33u8eX163bz8eqN5Czbk5l+ZcDbelRd fSvoWyo5MY8z3Tf9LEGkuZ/IOnM7kAWnrQ== X-Google-Smtp-Source: ABdhPJw6UkOVxjC1XZKZ6/uUxcHIy57gHlfgvmN9SHJiRNSm/5j6avy18FmsEj2IgPCUX1KluMuHMQ== X-Received: by 2002:a05:6830:118c:: with SMTP id u12mr9959519otq.82.1623142843003; Tue, 08 Jun 2021 02:00:43 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id 3sm42082otu.52.2021.06.08.02.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:41 -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 v4 07/12] doc: asciidoctor: reorganize extensions Date: Tue, 8 Jun 2021 04:00:21 -0500 Message-Id: <20210608090026.1737348-8-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305927 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 C2E20C47082 for ; Tue, 8 Jun 2021 09:01:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 99FDF6124B for ; Tue, 8 Jun 2021 09:01:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230321AbhFHJDi (ORCPT ); Tue, 8 Jun 2021 05:03:38 -0400 Received: from mail-ot1-f48.google.com ([209.85.210.48]:45632 "EHLO mail-ot1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbhFHJDh (ORCPT ); Tue, 8 Jun 2021 05:03:37 -0400 Received: by mail-ot1-f48.google.com with SMTP id 6-20020a9d07860000b02903e83bf8f8fcso6604535oto.12 for ; Tue, 08 Jun 2021 02:01:45 -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=eaDsQYfkMbT/iOJTVoIrfWA9/K4LWKG47YzxXAjIOOE=; b=X/UdI6LqUBHK/Z+ixV9JXiXlM7U3GnWzz16kZ6UTWzxSTy1B0TGzVNWOchuQ+0t0D9 bLd+I+kqJAESh3v3Ae7XWAfUAhwMY+H5244sZw0S/s/bcWC/0e+RkRjrqm2Sg4jM99Ez /9KC2rV3xj0Syap2oGKCvdDVKm6Pc14Ppz+0HS3xIC5k9Y8rW2MK6CBIbO6pFL4tfL/h oVIz7UG6y0GLUvCK15qeFuFj7r6+GpXje9DmPmFaklafG+ZkYz4a8rPyHScfd7nqMPns 3wag2aWYtGOxfvlXVFNFnqmMdZ/tvYMHweoS+SlpIqAfe+Hkk63pVOMs76rVPmAiuaQt sWeQ== 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=eaDsQYfkMbT/iOJTVoIrfWA9/K4LWKG47YzxXAjIOOE=; b=iyfra1LbwTlZGuHwpEx/E5dcSQngo0qJ1FHAJAh1lmL1LSYp1lZ1inWOxZUb1p7Bnx /LQvx0MMpj1LDXbnVlm0MxpPN4XR9cwD+ACIYdPSpE1OCl2r2jhqjVAwLUuaSG2A2jcc wHDPo8kLeQLHWzu3nJGUbq6Jr9B7FUO1351y3Cse8W2Td07lyBOFCTij6F07bVOrcCAQ 4PfY7yu3MFNk8J6iTiFwluhkHr6rgqO1zLj/P7h6y+6aZTawb5R+/JGAxbGCj1foW4cl TpEnyNOrXU1Hzjpaxy7bvbAz48hbVufsVeI7NUaJXDLmLNCH1pArIo6eIzrSPppGGmPN MZWQ== X-Gm-Message-State: AOAM531nFykrLOUNRM3kw8QHB7lzj/fKKrlDmtv08uVOyNwEMxUlnrQU 00iLgAh+dXhLaZgJRpPc7ObpPs3g3DoETg== X-Google-Smtp-Source: ABdhPJy1JegH4+ltQXId/Mj0tKWL0Z5zlBcMvFyL/RD4UsBF8lU4vvtaR75HTI47zLLe6hCEv0srHg== X-Received: by 2002:a05:6830:270a:: with SMTP id j10mr5390945otu.26.1623142844636; Tue, 08 Jun 2021 02:00:44 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id o14sm2787564oik.29.2021.06.08.02.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:44 -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 v4 08/12] doc: asciidoctor: use html-prefix only for html Date: Tue, 8 Jun 2021 04:00:22 -0500 Message-Id: <20210608090026.1737348-9-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305923 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 4C8C7C47082 for ; Tue, 8 Jun 2021 09:00:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37B0A61263 for ; Tue, 8 Jun 2021 09:00:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231192AbhFHJCu (ORCPT ); Tue, 8 Jun 2021 05:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230522AbhFHJCt (ORCPT ); Tue, 8 Jun 2021 05:02:49 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCBBCC061574 for ; Tue, 8 Jun 2021 02:00:46 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id w23-20020a9d5a970000b02903d0ef989477so15225293oth.9 for ; Tue, 08 Jun 2021 02:00:46 -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=f1t7zOZhVPCUxouHSRryjqnFh7JxXhD3yg2wCAlDRtI=; b=Vio/GiZW3XQXH583MSCMNHSv/s8Oq4gAUWtBqWMww/8k/4Hnqf55mtBozXc7i+IrKx 85He8AZmeIceD9QCkOIskpvyAsjKk4QcpCOJPQLDNvPbiw6OPRKYy3au2ZZrJ1Il15OJ zzc+LOHMdG5ByW7tT01L1p679AKKfg4ti0p2ksDYgnKbgF37ZLZrDWTp3e2aIYFllpcT qckaVQ+9RRwqhQWhoX3++JCB+lHjvjr9Sp3jkLHRJ0YlpwDhGOGhp3KTSygji3JcZRs+ zA1pe0umtnXByFzWKGIZo7G2kAUWLxiRG+yeMMGYPVYIjSNTTy/zBl19Yl3j1eosf4gz EoNA== 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=f1t7zOZhVPCUxouHSRryjqnFh7JxXhD3yg2wCAlDRtI=; b=OOYwBMnygdWH4hBw/+n6Vxtr2eGNNAzwP1xZhCZRx9CZJ29p5YghBVJdvAJIfq53Np YnpSCoqqVtJ71f/IlOZLp/pl0qWo9Wz+CgN3o0a+ZORifYdsqa0UMqwWKXtBbNYTeTGt WMBJgZy3wVUC54gHv5z3Oi7HT0dH9bekckiYOpDg1mMGZ8Py9cVhzT8L/uRXjLy4VH1d kxXt06JuvF1nW24u37IIfKf93cIXJOr7oPfvpEo32bGu4cPg5b1DcTVnV+O7tH6aUYSz 0QCFVfcbBTT4DKrvlMv3JVdtug3PriZQG5M5Kp3765ZO4UKXcmGwsOfPULh5rQbzVoVB AWLw== X-Gm-Message-State: AOAM5322cpvSSrG/mw4B58dOLccYO6AhRxinMvOEo9ozduP9nplKCZEN Nh4pGxCDIKQNP23Z34IBHBGbAq5oruAk/A== X-Google-Smtp-Source: ABdhPJxh0Mk/2SnrpHP8NVD1rwWkls+UrUur/hJlBZo6Y7Fb1OD9imdX3jN/Jrj2os9H0JA1P5Aybg== X-Received: by 2002:a9d:4c0a:: with SMTP id l10mr18132914otf.363.1623142846082; Tue, 08 Jun 2021 02:00:46 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id c205sm2744962oib.20.2021.06.08.02.00.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:45 -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 v4 09/12] doc: asciidoctor: refactor macro registration Date: Tue, 8 Jun 2021 04:00:23 -0500 Message-Id: <20210608090026.1737348-10-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305931 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 617EBC47082 for ; Tue, 8 Jun 2021 09:01:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4393F61184 for ; Tue, 8 Jun 2021 09:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231166AbhFHJDs (ORCPT ); Tue, 8 Jun 2021 05:03:48 -0400 Received: from mail-ot1-f44.google.com ([209.85.210.44]:39591 "EHLO mail-ot1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230444AbhFHJDr (ORCPT ); Tue, 8 Jun 2021 05:03:47 -0400 Received: by mail-ot1-f44.google.com with SMTP id 5-20020a9d01050000b02903c700c45721so18554576otu.6 for ; Tue, 08 Jun 2021 02:01:47 -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=MG+nHSv+dAQUSETR0CayNJHgev0YVpT7DORiYJSc43o=; b=jE1UHhP7QoURy2ETELexWQcMb3xVAoTPxfXCBlUKT2UNnSSVxE405LloEJI+Uss/SH yHzMe5G6qCs5EMQ1Apw2A03WQKY5HqP6c4WexN6Zb/7/08W1REW2APwMwzy7FpLEThqv B5kr2H8R8PWaRt1PVwf3kFDlLx5dLUDP4V8CT1VcDTn8uZUXxNJJ/N1aiQT5J0T/EQAU cGnrAbIqwMnz9sg2jyqfWFzQD0XtUU1h9RDHO5WMPzLHsoxN4sb+GEXrCgW1hXQtVHFj ds3m9fawv3fz2Tl3MQ6skzQlKYVmynsc+p7SRQgYQghHMkoyGYIZFzVLvRlqk79+WK3z tEQw== 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=MG+nHSv+dAQUSETR0CayNJHgev0YVpT7DORiYJSc43o=; b=YmviDGGIoTR9Ao2qS8FQ3BO7GFu9CfF2tfSByiecBm3oT1KOZFLNkqGHi76wLput3J s8/z24+KiWtgqcJz8ggl3ey0Tn52Zwlpzckt4A91l5km1G6SmSRn1laVSYCIIbh2ryi+ dopTjtAb7OOx2MGyMMnKZP3KxNY/mmY3JvAOiuzVk1sJ2rq4AL9PfMvPNG9khJ6/Pdx3 qUnWe5Ou/qPqjvxA7EoOb2KsWDpnFKvFirv0KXzZYh9rLuQgLClAD8rrObV2UPZPoXoj D0VuwyqA1fQWCxYJ9KC0qxaoatY7nuPLeSs/2GVAv932gP/4CE05XW7TcelAnFequgMc TnbQ== X-Gm-Message-State: AOAM533j7vu/68blHyJrx60oyEGkCVYagqyGREjr53Y+CZHsrFkXZ4u1 MKkzsKkwFr1UYWPva5XO5mejpFzAfjq92w== X-Google-Smtp-Source: ABdhPJzaOrV0X89g+57QbHsSoMf9lb3zUE4yNIEG6FrTTG2FdWYuaV7ug420IwAKs91cITGWWQCgvg== X-Received: by 2002:a9d:542:: with SMTP id 60mr17274745otw.143.1623142847507; Tue, 08 Jun 2021 02:00:47 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id r1sm829379oth.19.2021.06.08.02.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:47 -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 v4 10/12] doc: asciidoctor: improve string handling Date: Tue, 8 Jun 2021 04:00:24 -0500 Message-Id: <20210608090026.1737348-11-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305929 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 C559BC47082 for ; Tue, 8 Jun 2021 09:01:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A906061184 for ; Tue, 8 Jun 2021 09:01:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230475AbhFHJDn (ORCPT ); Tue, 8 Jun 2021 05:03:43 -0400 Received: from mail-oi1-f174.google.com ([209.85.167.174]:43726 "EHLO mail-oi1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230444AbhFHJDm (ORCPT ); Tue, 8 Jun 2021 05:03:42 -0400 Received: by mail-oi1-f174.google.com with SMTP id x196so20482431oif.10 for ; Tue, 08 Jun 2021 02:01:49 -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=KmD+5dtCCLMEdfFbyjK4kgRAyRTMUWSMUYBmSL4WVIU=; b=QLI/11wVvaUod/HWrSIZ6RMEKteD2QKek9Zfx6oJ+fnXLyYZn60Zm7AbdYUvBzMCQc n/qq7fsZTIY30TjV11tfWVLKD0aNHImEZZYiyo+I2g/30h9b/yWJYRq0xiKYRIF7Jmwe vCE6J4M+jT92VZ9dqqitrRGHU3vQMTGkYaKkf+y+BeOeXJoEvanKvk8Q0noqGVss5Xdg 8NgvBWnI6AujZLyprvBqcYCAGbj94mP7DD8c9JU6f+AD/yTwCvfV9pNnU32/qiMMdSbd c2GqsBQxyYfvMMks0ovOzXwTAPGFzOrA/Vp35b+rF0g3ugsPCXjhghG4CaGFOoMvoTPf ohfQ== 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=KmD+5dtCCLMEdfFbyjK4kgRAyRTMUWSMUYBmSL4WVIU=; b=peKa8zQG0LYJ9+GXFrX58Q5W/I5BhBe6yH8TDN4NVhpxl3c9SPrV4Vrr0HzfHJi4QZ ohjtjRG5cxouuUIBh9VHUN0CBXbHLIKVlIiE/bDCGi1PyvB5kwE+FO6xkbIKbNi9M/Y0 hrPktvBZtCCA/8BTRf7k4jzpCLiFLgYNcgn0CZamhnl0lIk8YDBGCwkxmzh0j6I8RoDU dxAHOD/4mhHclKqJVXKPcDFg5sYj+D2e9jjk+Mr0u5J7m6rR51T20ajGdniL2LOpsb6M 0XFnIxMsSe7bSPufUX+Nofc6Q63PFYaOf+PsqeSPCcZC2HyVL2bOOeyQI5vmjWsikEYC DWQQ== X-Gm-Message-State: AOAM531exKa/1j3lm4CdahXuxBR6VtcYBLuDvX4kHdaf/YtQ4BoZ3E/t 4cM+3m7gBa/y0tCrEg5onQ7ZYdWhwgKg1w== X-Google-Smtp-Source: ABdhPJwjpCX/a9ef8ohiOqdiWVcUw5ejuK84GxV1PmGk3+2Lc3+Di95NzQtJoOmpPvxEyz3OLs/usQ== X-Received: by 2002:aca:4795:: with SMTP id u143mr2021076oia.165.1623142849288; Tue, 08 Jun 2021 02:00:49 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id h2sm1198881oog.16.2021.06.08.02.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:48 -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 v4 11/12] doc: asciidoctor: split the format from the code Date: Tue, 8 Jun 2021 04:00:25 -0500 Message-Id: <20210608090026.1737348-12-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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 Jun 8 09:00:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 12305925 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 A7A06C47082 for ; Tue, 8 Jun 2021 09:01:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 903306124B for ; Tue, 8 Jun 2021 09:01:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231261AbhFHJC6 (ORCPT ); Tue, 8 Jun 2021 05:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbhFHJC4 (ORCPT ); Tue, 8 Jun 2021 05:02:56 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8654FC061787 for ; Tue, 8 Jun 2021 02:00:51 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id h9so20883348oih.4 for ; Tue, 08 Jun 2021 02:00:51 -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=CL6MtsaVIn8Y0nCHQe+rTnd4ME8ALZMwqbKEtbIDr4U=; b=eODs2nv1xa4yC5n+eP3TDwTREQH7qTQbs7vqZEvGs2Vpk7KRM1phDbu6FtKMb5DcPg kXAXDdf6VulWSl5r/IgasYfDx/v7VaZPpOaHoG2bUEuxUtA1jOLot3X4W5Dygk+3NLhd GM/6xbQcKTLQ9Rv/drq05l+Q7FPqoctySqwG/gVB6/L4kH87wOY3ru/+Jg5uQdd6+V+N dL3D9KAUIVrocD/39cYkhKFgMQSqn+nr4Td+WU94UfJj0Asmo5EmdOJTU5kW/DpqQBro Vh4ywPJO81tCAU7UU8awtah20qx3IDvwyubWPp2FLzE6/ZiwxT2rZAP22R2Z9/G+qMVD C4uw== 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=CL6MtsaVIn8Y0nCHQe+rTnd4ME8ALZMwqbKEtbIDr4U=; b=J8Dppq5r7q4cImU/W/oxRbgbKI/vphV65El3bQJ/8MmD9iP8uWXRU4JvdN31NKv6lf c8dzgKwHvTwygUfnS+x1n+ym4GYtR9XKAgjja/KmmLhpr7/ROqbnaBQMOeKKg+NFh5va e0AmrGz0f6K2k7sn3xNyQN48HXP6k2axh5t0Vz/UBa99boi2BHk8VEZfp6QezWj4lUYm 2eCboR2mBm3+t2xEGwwuAWtQTF1pcZzu+k8RG/lGqvrymo2KJdD+hxKYhuGlx4i2xzX+ JI+PSWCE4NEDLtC1HXaFc5Mvt/I0BP/JxIDABON9o9usBS+OTbpS5u9X19kl868K7jyv vIGQ== X-Gm-Message-State: AOAM530aSErO3j89GlAbacgwpnwjXdyKzVZ11skouhOjacs59gUYmHs8 QUk9Wbcy4Rtbs0ck9V8XVQTqpa7OduuVTg== X-Google-Smtp-Source: ABdhPJwBX3ei3BGjbVwaDYcVfYgRxChq2Ux0JuvyGnBkWR/+rWWLPw5Jn3xqcjHcSVmNlS9+obbjPQ== X-Received: by 2002:aca:bd86:: with SMTP id n128mr2208810oif.75.1623142850761; Tue, 08 Jun 2021 02:00:50 -0700 (PDT) Received: from localhost (fixed-187-188-155-231.totalplay.net. [187.188.155.231]) by smtp.gmail.com with ESMTPSA id l24sm1851564oii.45.2021.06.08.02.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 02:00:50 -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 v4 12/12] doc: asciidoctor: specify name of our group Date: Tue, 8 Jun 2021 04:00:26 -0500 Message-Id: <20210608090026.1737348-13-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.2.g41be0a4e50 In-Reply-To: <20210608090026.1737348-1-felipe.contreras@gmail.com> References: <20210608090026.1737348-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