19
19
# information, see www.akiban.com or contact licensing@akiban.com.
22
# ---------------------
24
23
# Builds the Akiban Persistit doc set. Currently this process is based on
25
# the asciidoc tool (http://www.methods.co.nz/asciidoc/).
24
# the Sphinx tool (http://sphinx.pocoo.org/).
27
26
# Here are the steps:
28
# 1. Run a Java program AsciiDocPrep to prepare a text asciidoc file.
29
# Among other things, AsciiDocPrep fills in JavaDoc hyperlinks.
30
# 2. Run asciidoc to generate an html file.
31
# 3. Use sed to replace some characters. Turns out asciidoc doesn't like
32
# to link to URLs having spaces, so AsciDocPrep replaces those spaces
33
# with the "`" character. This step converts those back to spaces.
35
# Run this script from the root of the persistit source directory. This
36
# script writes changes only into a directory /tmp/akiban-persistit-doc.
37
# The end-product files, user_guide.html and user_guide.xml are written
40
rm -rf ../../target/sphinx/source
41
mkdir -p ../../target/sphinx/source
42
mkdir -p ../../target/sphinx/classes
43
mkdir -p ../../target/sphinx/html
44
mkdir -p ../../target/sphinx/text
46
cp ../index.rst ../../target/sphinx/source
47
cp ../conf.py ../../target/sphinx/source
27
# 1. Run a Java program SphinxDocPrep to prepare a text rst file.
28
# Among other things, SphinxDocPrep fills in JavaDoc hyperlinks.
29
# 2. Run sphinx-build to generate html files.
30
# 3. Use fold and sed to specially prepare an extra plain text file
31
# for the release notes.
33
# Run this script from the doc/build/ directory of the persistit source
34
# tree. This script writes all output into the ../../target/sphinx
38
APIDOC_INDEX="../../target/site/apidocs/index-all.html"
39
APIDOC_URL=${APIDOC_URL:-"http://www.akiban.com/ak-docs/admin/persistit-api"}
40
DOCPREP_CLASS="SphinxDocPrep"
41
DOCPREP_CLASSPATH="../../target/sphinx/classes:../../target/classes"
44
DOC_TARGET_PATH="../../target/sphinx/source"
45
DOC_FINAL_PATH="../../target/sphinx/html"
59
rm -rf ../../target/sphinx/
60
mkdir -p ../../target/sphinx/{classes,html,source/_static,text}
62
cp ../index.rst ../conf.py ../../target/sphinx/source
49
64
javac -d ../../target/sphinx/classes -cp ../../target/classes/ src/*.java
51
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../ReleaseNotes.rst out=../../target/sphinx/source/ReleaseNotes.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
52
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../BasicAPI.rst out=../../target/sphinx/source/BasicAPI.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
53
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../Configuration.rst out=../../target/sphinx/source/Configuration.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
54
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../GettingStarted.rst out=../../target/sphinx/source/GettingStarted.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
55
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../Management.rst out=../../target/sphinx/source/Management.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
56
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../Miscellaneous.rst out=../../target/sphinx/source/Miscellaneous.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
57
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../PhysicalStorage.rst out=../../target/sphinx/source/PhysicalStorage.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
58
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../Security.rst out=../../target/sphinx/source/Security.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
59
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../Serialization.rst out=../../target/sphinx/source/Serialization.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
60
java -cp ../../target/sphinx/classes:../../target/classes SphinxDocPrep in=../Transactions.rst out=../../target/sphinx/source/Transactions.rst base=http://www.akiban.com/ak-docs/admin/persistit/apidocs index=../../target/site/apidocs/index-all.html
62
sphinx-build -a ../../target/sphinx/source ../../target/sphinx/html
64
fold -s ../../target/sphinx/source/ReleaseNotes.rst | sed 's/``//g' | sed 's/\.\. note:/NOTE/' | sed 's/::/:/' > ../../target/sphinx/text/ReleaseNotes
66
for f in $DOC_FILES; do
67
java -cp "$DOCPREP_CLASSPATH" "$DOCPREP_CLASS" in="${DOC_SOURCE_PATH}/${f}" out="${DOC_TARGET_PATH}/${f}" base="$APIDOC_URL" index="$APIDOC_INDEX"
70
sphinx-build -a "$DOC_TARGET_PATH" "$DOC_FINAL_PATH"
72
fold -s "${DOC_TARGET_PATH}/ReleaseNotes.rst" | sed 's/``//g' | sed 's/\.\. note:/NOTE/' | sed 's/::/:/' > ../../target/sphinx/text/ReleaseNotes