[master] 4c9f9e0 Fix rendering of varnishd -? in sphinx

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Mar 13 18:31:05 CET 2017


commit 4c9f9e08295ef86bc79ed389cf9ee85e24258e56
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Mon Mar 13 18:23:59 2017 +0100

    Fix rendering of varnishd -? in sphinx
    
    Apparently rst2man and sphinx don't have the same opinion on what an
    option is or isn't. Looking at the RST spec it doesn't seem to allow a
    question mark [1] in an option list. Among the various kind of options
    we can see:
    
        Short POSIX options consist of one dash and an option letter.
    
    To work around that I introduced a crude hack using sed. It satisfies
    my OCD but I'm not even remotely proud of that.
    
    [1] http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#option-lists

diff --git a/doc/sphinx/Makefile.am b/doc/sphinx/Makefile.am
index 255ce4e..a4303be 100644
--- a/doc/sphinx/Makefile.am
+++ b/doc/sphinx/Makefile.am
@@ -46,6 +46,8 @@ all: link_srcdir
 
 html: sphinx_prereq
 	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@sed -i 's/Q.*UESTION_MARK_HACK/?/' \
+	    $(BUILDDIR)/html/reference/varnishd.html
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
 
diff --git a/doc/sphinx/reference/varnishd.rst b/doc/sphinx/reference/varnishd.rst
index 3b34004..7bb27e9 100644
--- a/doc/sphinx/reference/varnishd.rst
+++ b/doc/sphinx/reference/varnishd.rst
@@ -85,7 +85,7 @@ For these options, `varnishd` prints information to standard output
 and exits. When a -x option is used, it must be the only option (it
 outputs documentation in reStructuredText, aka RST).
 
--?
+-QUESTION_MARK_HACK
 
   Print the usage message.
 
diff --git a/man/Makefile.am b/man/Makefile.am
index 2b61fbb..312d0b3 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -46,6 +46,7 @@ varnishd.1: \
 	$(top_builddir)/doc/sphinx/reference/varnishd.rst \
 	$(top_builddir)/doc/sphinx/include/params.rst
 	${RST2MAN} $(RST2ANY_FLAGS) $(top_builddir)/doc/sphinx/reference/varnishd.rst $@
+	@sed -i 's/Q.*UESTION_MARK_HACK/?/' $@
 
 varnishncsa.1: \
 	$(top_builddir)/doc/sphinx/reference/varnishncsa.rst \



More information about the varnish-commit mailing list