Skip to contentSkip to conversation

Convert SubmittingPatches to AsciiDoc

PATCH New brian m. carlson 1 participant 3 messages Nov 12, 2017 Documentation

lore
Share & tools
lore
#0 lore raw

v2 cover Convert SubmittingPatches to AsciiDoc

This series converts SubmittingPatches into AsciiDoc and builds it as part of the technical documentation. The goal is to provide a format that is more easily linkable both from our website and by others, as the Git Project's patch submission standards are widely referenced and used as examples.

Changes from v1:
* Switch all branch names, paths, and commit message trailers to use backticks.
* Move footnotes directly above relevant paragraph.
* Fix quoting of mail message.

brian m. carlson (2):
Documentation: enable compat-mode for Asciidoctor
Documentation: convert SubmittingPatches to AsciiDoc

 Documentation/.gitignore        |   1 +
 Documentation/Makefile          |   6 +
 Documentation/SubmittingPatches | 340 +++++++++++++++++++++-------------------
 3 files changed, 189 insertions(+), 158 deletions(-)
#1 lore raw

PATCH v2 1/2 Documentation: enable compat-mode for Asciidoctor

Asciidoctor 1.5.0 and later have a compatibility mode that makes it more compatible with some Asciidoc syntax, notably the single and double quote handling. While this doesn't affect any of our current documentation, it would be beneficial to enable this mode to reduce the differences between AsciiDoc and Asciidoctor if we make use of those features in the future.

Since this mode is specified as an attribute, if a version of Asciidoctor doesn't understand it, it will simply be ignored.

---
 Documentation/Makefile | 1 +
 1 file changed, 1 insertion(+)
Documentation/Makefile +1 -0
index 471bb29725..d5ad85459e 100644
@@ -181,6 +181,7 @@ ASCIIDOC = asciidoctor
 ASCIIDOC_CONF =
 ASCIIDOC_HTML = xhtml5
 ASCIIDOC_DOCBOOK = docbook45
+ASCIIDOC_EXTRA += -acompat-mode
 ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
 ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
 DBLATEX_COMMON =
#2 lore raw

PATCH v2 2/2 Documentation: convert SubmittingPatches to AsciiDoc

In reply to brian m. carlson

The SubmittingPatches document is often cited by outside parties as an example of good practices to follow, including logical, independent commits; patch sign-offs; and sending patches to a mailing list. Currently, people who want to cite a particular section tend to either refer to it by name and let the interested party search through the document to find it, or link to a given line number on GitHub and hope the file doesn't change.

Instead, convert the document to AsciiDoc. Build it as part of the technical documentation, since it is likely of interest to the same group of people. Provide stable links to the sections which outside parties are likely to want to link to. Make some minor structural changes to organize it so that it can be formatted sanely.

Since the makefile needs a .txt extension in order to build with the rest of the documentation, simply copy the file. Ignore the temporary file so it doesn't get checked in accidentally, and remove it as part of the clean process. Do this instead of renaming the file so that people who have already linked to the documentation (who we're trying to help) don't find their links broken. Avoid symlinking since Windows will not like that.

This allows us to render the document as part of the website for the benefit of others who wish to link to it as well as providing a more nicely formatted display for our community and potential contributors.

---
 Documentation/.gitignore        |   1 +
 Documentation/Makefile          |   5 +
 Documentation/SubmittingPatches | 340 +++++++++++++++++++++-------------------
 3 files changed, 188 insertions(+), 158 deletions(-)
Documentation/.gitignore +1 -0
index 2c8b2d612e..c7096f11f1 100644
@@ -11,3 +11,4 @@ doc.dep
 cmds-*.txt
 mergetools-*.txt
 manpage-base-url.xsl
+SubmittingPatches.txt
Documentation/Makefile +5 -0
index d5ad85459e..2ab65561af 100644
@@ -67,6 +67,7 @@ SP_ARTICLES += howto/maintain-git
 API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt)))
 SP_ARTICLES += $(API_DOCS)
 
+TECH_DOCS += SubmittingPatches
 TECH_DOCS += technical/hash-function-transition
 TECH_DOCS += technical/http-protocol
 TECH_DOCS += technical/index-format
@@ -324,6 +325,7 @@ clean:
 	$(RM) *.pdf
 	$(RM) howto-index.txt howto/*.html doc.dep
 	$(RM) technical/*.html technical/api-index.txt
+	$(RM) SubmittingPatches.txt
 	$(RM) $(cmds_txt) $(mergetools_txt) *.made
 	$(RM) manpage-base-url.xsl
 
@@ -362,6 +364,9 @@ technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../
 $(patsubst %,%.html,$(API_DOCS) technical/api-index $(TECH_DOCS)): %.html : %.txt asciidoc.conf
 	$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt
 
+SubmittingPatches.txt: SubmittingPatches
+	$(QUIET_GEN) cp $< $@
+
 XSLT = docbook.xsl
 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
 
Documentation/SubmittingPatches +182 -158

580 lines not on this page · raw message