Skip to content

Instantly share code, notes, and snippets.

@dch
Created July 31, 2012 01:22
Show Gist options
  • Save dch/3212532 to your computer and use it in GitHub Desktop.
Save dch/3212532 to your computer and use it in GitHub Desktop.
CouchDB Docs

Pandoc meets CouchDB Docs

Get the source, or just clone this gist instead.

mkdir /tmp/couchdocs && cd /tmp/couchdocs
git clone git://github.com/dch/couchdb.git
git checkout docs
cd share/docs

Install Pandoc

Pandoc is available as packaged binaries for most common platforms. Either in package, or downloadable.

edit docs

In dist/ are sample converted markdown files, including:

  • configuration.md which is the 2 DocBook "chapters" exported to Markdown
  • and the full release.md and manual.md files.

Edit markdown files to heart's content.

Build new HTML5 output

Here's an example that converts the new configuration.md file into HTML5:

pandoc --smart --preserve-tabs --normalize --table-of-contents  \
  --reference-links --chapters --number-section --standalone \
  --from markdown --to html5 \
  --output configuration.html \
  configuration.md

Export all .xml docs file by file to equivalent .rst files:

for xml in *.xml; \
do echo ${xml}; \
pandoc \
    --smart --preserve-tabs --normalize --reference-links --chapters \
    --number-sections --standalone --from docbook --to rst \
    --output ../dist/${xml} ${xml};
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment