Skip to content
Snippets Groups Projects
Commit 75c7b51f authored by Dhruva Gowda Storz's avatar Dhruva Gowda Storz
Browse files

Merge branch 'master' of https://github.com/BhallaLab/moose

parents f5d2ff57 acdce3ce
No related branches found
No related tags found
1 merge request!233Documentation update 2
...@@ -35,7 +35,12 @@ Released under the WTFPL (http://sam.zoy.org/wtfpl/). ...@@ -35,7 +35,12 @@ Released under the WTFPL (http://sam.zoy.org/wtfpl/).
from docutils import nodes from docutils import nodes
from docutils.parsers.rst import directives from docutils.parsers.rst import directives
from sphinx.directives.code import CodeBlock from sphinx.directives.code import CodeBlock
from sphinx.util.compat import make_admonition
# Fixes from https://github.com/abakan/ablog/commit/413566341b36d2b855fdebe133e15edcd4542785
try:
from sphinx.util.compat import make_admonition
except ImportError as e:
from docutils.parsers.rst.directives.admonitions import BaseAdmonition as make_admonition
HCB_COUNTER = 0 HCB_COUNTER = 0
...@@ -82,6 +87,41 @@ class HiddenCodeBlock(CodeBlock): ...@@ -82,6 +87,41 @@ class HiddenCodeBlock(CodeBlock):
hcb.line = self.lineno hcb.line = self.lineno
return [hcb] return [hcb]
def visit_hcb_tex( self, node ):
global HCB_COUNTER
# We want to use the original highlighter so that we don't
# have to reimplement it. However it raises a SkipNode
# error at the end of the function call. Thus we intercept
# it and raise it again later.
try:
self.visit_literal_block(node)
except nodes.SkipNode:
pass
## The last element of the body should be the literal code
## block that was just made.
#code_block = self.body[-1]
#fill_header = {'divname': 'hiddencodeblock{0}'.format(HCB_COUNTER),
# 'startdisplay': 'none' if node['starthidden'] else 'block',
# 'label': node.get('label'),
# }
#divheader = ("""<a href="javascript:showhide(document.getElementById('{divname}'))">"""
# """{label}</a><br />"""
# '''<div id="{divname}" style="display: {startdisplay}">'''
# ).format(**fill_header)
#code_block = js_showhide + divheader + code_block + "</div>"
## reassign and exit
#self.body[-1] = code_block
raise nodes.SkipNode
def depart_hcb_tex( self, node ):
pass
def visit_hcb_html(self, node): def visit_hcb_html(self, node):
"""Visit hidden code block""" """Visit hidden code block"""
...@@ -122,8 +162,7 @@ def depart_hcb_html(self, node): ...@@ -122,8 +162,7 @@ def depart_hcb_html(self, node):
"""Depart hidden code block""" """Depart hidden code block"""
# Stub because of SkipNode in visit # Stub because of SkipNode in visit
def setup(app): def setup(app):
app.add_directive('hidden-code-block', HiddenCodeBlock) app.add_directive('hidden-code-block', HiddenCodeBlock)
app.add_node(hidden_code_block, html=(visit_hcb_html, depart_hcb_html)) app.add_node(hidden_code_block, html=(visit_hcb_html, depart_hcb_html))
app.add_node(hidden_code_block, latex=(visit_hcb_tex, depart_hcb_tex))
...@@ -22,17 +22,19 @@ import sys ...@@ -22,17 +22,19 @@ import sys
import sphinx_rtd_theme import sphinx_rtd_theme
import mock import mock
conf_dir_ = os.path.dirname( __file__ )
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../python')) sys.path.insert(0, os.path.abspath('../python'))
sys.path.insert(0, os.path.abspath('./Extensions'))
sys.path.append(os.path.abspath('../../moose-examples/snippets')) sys.path.append(os.path.abspath('../../moose-examples/snippets'))
sys.path.append(os.path.abspath('../../moose-examples/tutorials/ChemicalOscillators')) sys.path.append(os.path.abspath('../../moose-examples/tutorials/ChemicalOscillators'))
sys.path.append(os.path.abspath('../../moose-examples/tutorials/ChemicalBistables')) sys.path.append(os.path.abspath('../../moose-examples/tutorials/ChemicalBistables'))
sys.path.append(os.path.abspath('../../moose-examples/tutorials/ExcInhNet')) sys.path.append(os.path.abspath('../../moose-examples/tutorials/ExcInhNet'))
sys.path.append(os.path.abspath('../../moose-examples/neuroml/lobster_pyloric')) sys.path.append(os.path.abspath('../../moose-examples/neuroml/lobster_pyloric'))
sys.path.append(os.path.abspath('../../moose-examples/tutorials/ExcInhNetCaPlasticity')) sys.path.append(os.path.abspath('../../moose-examples/tutorials/ExcInhNetCaPlasticity'))
sys.path.append(os.path.join(conf_dir_, 'Extensions') )
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
...@@ -66,7 +68,7 @@ master_doc = 'index' ...@@ -66,7 +68,7 @@ master_doc = 'index'
# General information about the project. # General information about the project.
project = u'MOOSE' project = u'MOOSE'
copyright = u'2016, Upinder Bhalla, Niraj Dudani, Aditya Gilra, Aviral Goel, Subhasis Ray, Harsha Rani and Dilawar Singh' copyright = u'2018, Upinder Bhalla, Niraj Dudani, Subhasis Ray, Aditya Gilra,Harsha Rani, Aviral Goel, Dilawar Singh, Malav Shah, Dhruva Gowda storz'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
...@@ -208,7 +210,7 @@ latex_elements = { ...@@ -208,7 +210,7 @@ latex_elements = {
# (source start file, target name, title, author, documentclass [howto/manual]). # (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [ latex_documents = [
('index', 'MOOSE.tex', u'MOOSE Documentation', ('index', 'MOOSE.tex', u'MOOSE Documentation',
u'Upinder Bhalla, Niraj Dudani, Aditya Gilra, Aviral Goel, Subhasis Ray,Harsha Rani and Dilawar Singh', 'manual'), u'Upinder Bhalla, Niraj Dudani, Subhasis Ray, Aditya Gilra,Harsha Rani, Aviral Goel, Dilawar Singh, Malav Shah, Dhruva Gowda storz', 'manual'),
] ]
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
...@@ -238,7 +240,7 @@ latex_domain_indices = True ...@@ -238,7 +240,7 @@ latex_domain_indices = True
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [
('index', 'moose', u'MOOSE Documentation', ('index', 'moose', u'MOOSE Documentation',
[u'Upinder Bhalla, Niraj Dudani, Aditya Gilra, Aviral Goel, Subhasis Ray,Harsha Rani and Dilawar Singh'], 1) [u'Upinder Bhalla, Niraj Dudani, Subhasis Ray, Aditya Gilra,Harsha Rani, Aviral Goel, Dilawar Singh, Malav Shah, Dhruva Gowda storz'], 1)
] ]
# If true, show URL addresses after external links. # If true, show URL addresses after external links.
...@@ -252,7 +254,7 @@ man_pages = [ ...@@ -252,7 +254,7 @@ man_pages = [
# dir menu entry, description, category) # dir menu entry, description, category)
texinfo_documents = [ texinfo_documents = [
('index', 'MOOSE', u'MOOSE Documentation', ('index', 'MOOSE', u'MOOSE Documentation',
u'Upinder Bhalla, Niraj Dudani, Aditya Gilra, Aviral Goel, Subhasis Ray,Harsha Rani and Dilawar Singh', 'MOOSE', 'MOOSE is the Multiscale Object-Oriented Simulation Environment.', u' Upinder Bhalla, Niraj Dudani, Subhasis Ray, Aditya Gilra,Harsha Rani, Aviral Goel, Dilawar Singh, Malav Shah, Dhruva Gowda storz', 'MOOSE', 'MOOSE is the Multiscale Object-Oriented Simulation Environment.',
'Science'), 'Science'),
] ]
...@@ -283,16 +285,9 @@ autodoc_mock_imports = [ 'numpy' , 'moose.sbml' , 'moose.genesis' , 'moose.LIF' ...@@ -283,16 +285,9 @@ autodoc_mock_imports = [ 'numpy' , 'moose.sbml' , 'moose.genesis' , 'moose.LIF'
exclude_patterns = ['/docs/source/user/py/references/*.rst'] exclude_patterns = ['/docs/source/user/py/references/*.rst']
#run the doxygen thingy #run the doxygen thingy
# read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
#
# if read_the_docs_build:
#
# subprocess.call('cd ../../doxygen; doxygen', shell=True)
import subprocess, os import subprocess, os
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
if read_the_docs_build: if not read_the_docs_build:
subprocess.call('cd doxygen; echo HELLO......................; doxygen Doxyfile', shell=True) subprocess.call('cd doxygen; echo HELLO......................; doxygen Doxyfile', shell=True)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment