summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2016-10-08 17:30:23 +0100
committerRussell Bryant <russell@ovn.org>2016-10-18 13:57:11 -0400
commit731ee6a998c1dc62d1fb85c96b6a8b81c22f3bad (patch)
treef447a28beeae5cf71077fea52919254f637ea42e
parentc5abeef4204805999177af5a78d3a543afa7bab0 (diff)
downloadopenvswitch-731ee6a998c1dc62d1fb85c96b6a8b81c22f3bad.tar.gz
dist-docs: Add support for rST
This will eventually go away once Sphinx starts doing all this work for us. For now, however, let's make sure we don't break the OVS website. This introduces a new dependency for the dist-docs script - 'rst2html'. This tool is packaged on Ubuntu, Fedora (via 'python-docutils'), etc. and can be installed from pip using the 'docsutils' package. Signed-off-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Russell Bryant <russell@ovn.org>
-rw-r--r--Makefile.am4
-rwxr-xr-xbuild-aux/dist-docs23
2 files changed, 22 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index 49010b3b5..4b017666b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,8 +63,8 @@ CLEAN_LOCAL =
DISTCLEANFILES =
PYCOV_CLEAN_FILES = build-aux/check-structs,cover
-# A list of Markdown-formatted documentation that will automatically be
-# included in the "make dist-docs" output.
+# A list of Markdown- or reStructuredText-formatted documentation that will
+# automatically be included in the "make dist-docs" output.
docs = \
CONTRIBUTING.md \
CodingStyle.md \
diff --git a/build-aux/dist-docs b/build-aux/dist-docs
index a81e4b266..fdaa06692 100755
--- a/build-aux/dist-docs
+++ b/build-aux/dist-docs
@@ -35,6 +35,7 @@ search_path () {
}
search_path man
search_path markdown
+search_path rst2html
search_path ps2pdf
# Create dist-docs directory.
@@ -61,9 +62,9 @@ cat >&3 <<EOF
<table>
EOF
-# Add top-level documentation to index.html, giving it .txt extensions so
-# that the webserver doesn't serve it as Markdown and make your web browser
-# try to invoke some kind of external helper you don't have installed.
+# Add top-level documentation to index.html, giving it .txt extensions so that
+# the webserver doesn't serve it as Markdown/rST and make your web browser try
+# to invoke some kind of external helper you don't have installed.
#
# Also translate documentation to HTML.
for file
@@ -92,6 +93,22 @@ EOF
EOF
;;
+ *.rst)
+ title=`grep -A 1 -e "^=" $srcdir/$file | sed -n 2p`
+ cp "$srcdir/$file" "$distdir/$file.txt"
+ ln -s $(basename "$file.txt") "$distdir/$file"
+ rst2html "$distdir/$file.txt" --stylesheet-path="style.css" \
+ --link-stylesheet --title="$file (Open vSwitch $VERSION)" \
+ > "$distdir/$file.html"
+ cat <<EOF
+<tr>
+ <td>$file</td>
+ <td>$title</td>
+ <td><a href="$file.html">HTML</a>, <a href="$file.txt">plain text</a></td>
+</tr>
+EOF
+ ;;
+
*)
cp "$srcdir/$file" "$distdir/$file"
cat <<EOF