From 7c030ebf2f51c6800966a2fc2d1b0048f0930f1d Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Mon, 7 Nov 2016 16:32:08 +0000 Subject: [PATCH] Use sed instead of pandoc to insert TOC in schema doc pandoc < 1.14 adds the TOC depth as a float, which is not recognised by Sphinx. Also, move the TOC after the introduction, which looks nicer. --- doc/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 7998b88d914..608133bbdaa 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -48,8 +48,10 @@ schema.md: parse_gx_xsd.py schema_template.md ../lib/galaxy/tools/xsd/galaxy.xsd python parse_gx_xsd.py schema_template.md ../lib/galaxy/tools/xsd/galaxy.xsd > $@ source/dev/schema.rst: schema.md ## Convert Galaxy Tool XSD Markdown docs into reStructuredText (expects pandoc in environment) - pandoc schema.md -f markdown_github-hard_line_breaks -s --toc --toc-depth=2 -o $@ + pandoc schema.md -f markdown_github-hard_line_breaks -s -o $@ sed -i -e 's|.. code:: xml|.. code-block:: xml|g' $@ + # Insert table of contents + sed -i -e '/^``tool``$$/i .. contents:: Table of contents\n :local:\n :depth: 1\n..\n' $@ # might also want to do # cd source/lib; hg revert; rm *.rst.orig; or not.