Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-documentation in Forge #67

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/forge
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def main():
parser.add_option("--ident", dest="gen_ident", action="store_true", default=False, help="enable identity generation (re-generate a Forge spec)")
parser.add_option("--no-delite", dest="gen_delite", action="store_false", default=True, help="disable delite generation")
parser.add_option("--no-lib", dest="gen_lib", action="store_false", default=True, help="disable library generation")
parser.add_option("--no-doc", dest="gen_doc", action="store_false", default=True, help="disable Sphinx document generation")

(opts, args) = parser.parse_args()
if len(args) < 1:
Expand Down Expand Up @@ -92,6 +93,8 @@ def stage(runner, params, opts):
java_opts = java_opts + " -Dforge.gen.delite=false"
if opts.gen_lib == False:
java_opts = java_opts + " -Dforge.gen.lib=false"
if opts.gen_doc == False:
java_opts = java_opts + " -Dforge.gen.sphinx=false"

#add classpaths
cp = " -cp "
Expand Down
23 changes: 23 additions & 0 deletions bin/update
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ usage() {
echo " -s <n> skip to step n in the update process"
echo " -j use jars instead of local class files"
echo " -f (re-)generate forge specification"
echo " -S disable Sphinx documentation generation"
echo " -g <gen> generate only the specified version"
echo " -r <app> run the specified application after compiling"
echo " -d run delite after compiling"
Expand All @@ -38,6 +39,7 @@ SKIP=0
DELITE=false
INTERACTIVE=false
IDENT=false
DOC=true
TARGET=""
USE_JARS=""

Expand All @@ -51,6 +53,7 @@ do
s) SKIP=$OPTARG;;
j) USE_JARS="--use-jars";;
f) IDENT=true;;
S) DOC=false;;
g) TARGET="$OPTARG";;
r) APP_RUNNER="$OPTARG"
NUM_STEPS=$(($NUM_STEPS+1))
Expand Down Expand Up @@ -96,6 +99,10 @@ then
then
FORGE_FLAGS="$FORGE_FLAGS --no-lib"
fi
if [ $DOC == false ];
then
FORGE_FLAGS="$FORGE_FLAGS --no-doc"
fi

echo "forge $DSL_RUNNER $FORGE_FLAGS (2/$NUM_STEPS)"
$FORGE_HOME/bin/forge $DSL_RUNNER $FORGE_FLAGS
Expand All @@ -116,6 +123,22 @@ if [ $SKIP -le 4 ];
then
echo "sbt compile (4/$NUM_STEPS)"
sbt compile

#pushd .
#echo "cd sphinx"
#cd "sphinx"
#echo "sphinx-build -b latex source build"
#sphinx-build -b latex source build
#pushd .
#cd build
#make clean all > /dev/null
#popd
#popd
#cp "sphinx/build/$DSL_NAME.pdf" ./Manual.pdf
#pushd .
#cd "sphinx"
#sphinx-build -b html source build
#popd
fi

if [ $SKIP -le 5 ] && [ $INTERACTIVE == true ];
Expand Down
78 changes: 0 additions & 78 deletions docs/optiwrangler/README.md

This file was deleted.

19 changes: 19 additions & 0 deletions docs/source/_static/colors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.black { color:black; }
.gray { color:gray; }
.silver { color:silver; }
.white { color:white; }
.maroon { color:maroon; }
.red { color:red; }
.fuchsia { color:fuchsia; }
.pink { color:pink; }
.orange { color:orange; }
.yellow { color:yellow; }
.lime { color:lime; }
.green { color:green; }
.olive { color:olive; }
.teal { color:teal; }
.cyan { color:cyan; }
.aqua { color:aqua; }
.blue { color:blue; }
.navy { color:navy; }
.purple { color:purple; }
47 changes: 47 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import os
import sys
from sphinx.highlighting import PygmentsBridge
from pygments.formatters.latex import LatexFormatter
class CustomLatexFormatter(LatexFormatter):
def __init__(self, **options):
super(CustomLatexFormatter, self).__init__(**options)
self.verboptions = r"formatcom=\footnotesize"
PygmentsBridge.latex_formatter = CustomLatexFormatter

templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'OptiML'
copyright = u'2016,Stanford PPL'
version = '0.1'
release = '0.1'
highlight_language = 'none'


#### HTML Info ###
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
htmlhelp_basename = 'OptiMLDoc'

### LaTex Info ###
latex_documents = [
('index', 'OptiML.tex', u'OptiML Documentation',
u'Stanford PPL', 'manual'),
]
latex_elements = {
'classoptions': ',openany,oneside',
'babel': '\\usepackage[english]{babel}'
}

### Manpage Info ###
man_pages = [
('index', 'optiml', u'OptiML Documentation',
[u'Stanford PPL'], 1)
]

### TexInfo ###
texinfo_documents = [
('index', 'OptiML', u'OptiML Documentation',
u'Stanford PPL', 'OptiML', 'One line description of project.',
'Miscellaneous'),
]
43 changes: 43 additions & 0 deletions docs/source/datastructs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Data Structures
===============

.. toctree::
ops/binaryfeature
ops/csrgraph
ops/csrngbr
ops/complex
ops/computestream
ops/continuousfeature
ops/ddfgfedge
ops/ddfgffactor
ops/ddfgfvariable
ops/ddfgfweight
ops/decisiontree
ops/densematrix
ops/densematrixview
ops/densetrainingset
ops/densevector
ops/densevectorview
ops/discretefeature
ops/factorgraph
ops/filestream
ops/grayscaleimage
ops/hashstream
ops/indexvector
ops/keyvaluestore
ops/randomforest
ops/replicated
ops/sparsematrix
ops/sparsematrixbuildable
ops/sparsetrainingset
ops/sparsevector
ops/sparsevectorview
ops/tup2
ops/tup3
ops/tup4
ops/tup5
ops/tup6
ops/tup7
ops/tup8
ops/tup9
ops/utriangle
17 changes: 17 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

OptiML 0.1 Documentation
========================

Contents:

.. toctree::
:maxdepth: 3

intro
typeclasses
datastructs
objects
primitives
typeparams
otherops

8 changes: 8 additions & 0 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Introduction
============

<stub>

This document was auto-generated using `Sphinx <http://www.sphinx-doc.org/en/stable/>`_.
For corrections, post an issue on `GitHub Issues <https://github.com/stanford-ppl/Forge/issues/>`_ .

6 changes: 6 additions & 0 deletions docs/source/objects.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Objects
=======

.. toctree::
ops/datefeature
ops/math
Loading