{"thread":{"id":"37816","subject":"[PATCH 1/2] Documentation: refactor common operations into variables","startedAt":"2014-10-27T00:13:41Z","lastAt":"2014-10-27T05:07:43Z","messageCount":4,"participants":["brian m. carlson","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"251079","messageId":"1414368823-427216-1-git-send-email-sandals@crustytoothpaste.net","threadId":"37816","inReplyTo":null,"subject":"[PATCH 0/2] Followup patches for Asciidoctor","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-10-27T00:13:41Z","receivedAt":"2014-10-27T00:13:41Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"This series is essentially the same as the previous v2, but against next\ninstead.  It moves most of the AsciiDoc operations into a set of\nvariables (TXT_TO_HTML and TXT_TO_XML) as Junio suggested, and removes\nthe extensions.rb file, as it is not needed.\n\nI did note Peff's suggestion to add a macro to enable the use of\nAsciidoctor, but I want to defer that until a later point.  There isn't\na released version of Asciidoctor with the necessary changes and I'd\nlike to avoid confusing users by making them think it will work when it\nprobably won't.\n\nbrian m. carlson (2):\n  Documentation: refactor common operations into variables\n  Documentation: remove Asciidoctor linkgit macro\n\n Documentation/Makefile      | 22 +++++++++++-----------\n Documentation/extensions.rb | 39 ---------------------------------------\n 2 files changed, 11 insertions(+), 50 deletions(-)\n delete mode 100644 Documentation/extensions.rb\n\n-- \n2.1.1\n"},{"id":"251077","messageId":"1414368823-427216-2-git-send-email-sandals@crustytoothpaste.net","threadId":"37816","inReplyTo":"1414368823-427216-1-git-send-email-sandals@crustytoothpaste.net","subject":"[PATCH 1/2] Documentation: refactor common operations into variables","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-10-27T00:13:42Z","receivedAt":"2014-10-27T00:13:42Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"The Makefile performs several very similar tasks to convert AsciiDoc\nfiles into either HTML or DocBook.  Move these items into variables to\nreduce the duplication.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n Documentation/Makefile | 22 +++++++++++-----------\n 1 file changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 4cdef45..2f6b6aa 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -102,6 +102,10 @@ ASCIIDOC_EXTRA =\n ASCIIDOC_HTML = xhtml11\n ASCIIDOC_DOCBOOK = docbook\n ASCIIDOC_CONF = -f asciidoc.conf\n+ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF) \\\n+\t\t-agit-version=$(GIT_VERSION)\n+TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)\n+TXT_TO_XML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_DOCBOOK)\n MANPAGE_XSL = manpage-normal.xsl\n XMLTO = xmlto\n XMLTO_EXTRA =\n@@ -309,14 +313,12 @@ clean:\n \n $(MAN_HTML): %.html : %.txt asciidoc.conf\n \t$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \\\n-\t$(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage $(ASCIIDOC_CONF) \\\n-\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \\\n+\t$(TXT_TO_HTML) -d manpage -o $@+ $< && \\\n \tmv $@+ $@\n \n $(OBSOLETE_HTML): %.html : %.txto asciidoc.conf\n \t$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \\\n-\t$(ASCIIDOC) -b $(ASCIIDOC_HTML) $(ASCIIDOC_CONF) \\\n-\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \\\n+\t$(TXT_TO_HTML) -o $@+ $< && \\\n \tmv $@+ $@\n \n manpage-base-url.xsl: manpage-base-url.xsl.in\n@@ -328,13 +330,12 @@ manpage-base-url.xsl: manpage-base-url.xsl.in\n \n %.xml : %.txt asciidoc.conf\n \t$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \\\n-\t$(ASCIIDOC) -b $(ASCIIDOC_DOCBOOK) -d manpage $(ASCIIDOC_CONF) \\\n-\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \\\n+\t$(TXT_TO_XML) -d manpage -o $@+ $< && \\\n \tmv $@+ $@\n \n user-manual.xml: user-manual.txt user-manual.conf\n \t$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \\\n-\t$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b $(ASCIIDOC_DOCBOOK) -d article -o $@+ $< && \\\n+\t$(TXT_TO_XML) -d article -o $@+ $< && \\\n \tmv $@+ $@\n \n technical/api-index.txt: technical/api-index-skel.txt \\\n@@ -343,8 +344,7 @@ technical/api-index.txt: technical/api-index-skel.txt \\\n \n technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../\n $(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf\n-\t$(QUIET_ASCIIDOC)$(ASCIIDOC) -b $(ASCIIDOC_HTML) $(ASCIIDOC_CONF) \\\n-\t\t$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt\n+\t$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt\n \n XSLT = docbook.xsl\n XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css\n@@ -391,7 +391,7 @@ howto-index.txt: howto-index.sh $(wildcard howto/*.txt)\n \tmv $@+ $@\n \n $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt\n-\t$(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b $(ASCIIDOC_HTML) $*.txt\n+\t$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt\n \n WEBDOC_DEST = /pub/software/scm/git/docs\n \n@@ -399,7 +399,7 @@ howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../\n $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt\n \t$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \\\n \tsed -e '1,/^$$/d' $< | \\\n-\t$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b $(ASCIIDOC_HTML) - >$@+ && \\\n+\t$(TXT_TO_HTML) - >$@+ && \\\n \tmv $@+ $@\n \n install-webdoc : html\n-- \n2.1.1\n"},{"id":"251078","messageId":"1414368823-427216-3-git-send-email-sandals@crustytoothpaste.net","threadId":"37816","inReplyTo":"1414368823-427216-1-git-send-email-sandals@crustytoothpaste.net","subject":"[PATCH 2/2] Documentation: remove Asciidoctor linkgit macro","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-10-27T00:13:43Z","receivedAt":"2014-10-27T00:13:43Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Asciidoctor provides an extension implementing a backend-independent\nmacro for dealing with manpage links just like the linkgit macro.  As\nthis is more likely to be up-to-date with future changes in Asciidoctor,\nprefer using it over reimplementing in Git.\n\nThis reverts commit 773ee47c2b9c691d9758b2bea6cac10e3f0c4e12.\n---\n Documentation/extensions.rb | 39 ---------------------------------------\n 1 file changed, 39 deletions(-)\n delete mode 100644 Documentation/extensions.rb\n\ndiff --git a/Documentation/extensions.rb b/Documentation/extensions.rb\ndeleted file mode 100644\nindex c33a50d..0000000\n--- a/Documentation/extensions.rb\n+++ /dev/null\n@@ -1,39 +0,0 @@\n-require 'asciidoctor'\n-require 'asciidoctor/extensions'\n-\n-module Git\n-  module Documentation\n-    class LinkGitProcessor < Asciidoctor::Extensions::InlineMacroProcessor\n-      use_dsl\n-\n-      named :chrome\n-\n-      def process(parent, target, attrs)\n-        if parent.document.basebackend? 'html'\n-          generate_html(parent, target, attrs)\n-        elsif parent.document.basebackend? 'docbook'\n-          generate_docbook(parent, target, attrs)\n-        end\n-      end\n-\n-      private\n-\n-      def generate_html(parent, target, attrs)\n-        section = attrs.has_key?(1) ? \"(#{attrs[1]})\" : ''\n-        prefix = parent.document.attr('git-relative-html-prefix') || ''\n-        %(<a href=\"#{prefix}#{target}.html\">#{target}#{section}</a>\\n)\n-      end\n-\n-      def generate_docbook(parent, target, attrs)\n-        %(<citerefentry>\n-<refentrytitle>#{target}</refentrytitle><manvolnum>#{attrs[1]}</manvolnum>\n-</citerefentry>\n-)\n-      end\n-    end\n-  end\n-end\n-\n-Asciidoctor::Extensions.register do\n-  inline_macro Git::Documentation::LinkGitProcessor, :linkgit\n-end\n-- \n2.1.1\n"},{"id":"251085","messageId":"20141027050742.GA2996@peff.net","threadId":"37816","inReplyTo":"1414368823-427216-1-git-send-email-sandals@crustytoothpaste.net","subject":"Re: [PATCH 0/2] Followup patches for Asciidoctor","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-10-27T05:07:43Z","receivedAt":"2014-10-27T05:07:43Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Oct 27, 2014 at 12:13:41AM +0000, brian m. carlson wrote:\n\n> I did note Peff's suggestion to add a macro to enable the use of\n> Asciidoctor, but I want to defer that until a later point.  There isn't\n> a released version of Asciidoctor with the necessary changes and I'd\n> like to avoid confusing users by making them think it will work when it\n> probably won't.\n\nThanks for considering it; your analysis makes sense to me.\n\n-Peff\n"}]}