Permalink
Browse files

Sphinx docs updates

  • Loading branch information...
1 parent 694b9a6 commit e00fae31a3ec35fe336aab75417e9be79be244a1 R. Saravanan committed Oct 9, 2012
Showing with 79 additions and 28 deletions.
  1. +8 −1 docs/Makefile
  2. +24 −0 docs/_templates/layout.html
  3. +30 −9 docs/conf.py
  4. +17 −18 docs/index.rst
View
@@ -17,10 +17,12 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+.PHONY: help clean cleanpages pages html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
+ @echo " pages to export standalone HTML files to project pages repository"
+ @echo " git_pages to export pages and sync local project pages with Github"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@@ -52,6 +54,11 @@ pages:
@echo
@echo "Build finished. The HTML pages are in $(PAGESDIR)."
+git_pages: pages
+ #cd $(PAGESDIR) && git add . && git commit -a -m "Publishing $(PKGNAME) at `date`" && git push origin gh-pages
+ @echo
+ @echo "Published package $(PKGNAME) at `date`"
+
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@@ -1,5 +1,29 @@
{% extends "!layout.html" %}
+{% block header %}
+ <div class="header-wrapper">
+ <div class="header">
+ {%- if logo %}
+ <p class="logo"><a href="{{ pathto(master_doc) }}">
+ <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
+ </a></p>
+ {%- endif %}
+ {%- block headertitle %}
+ <div class="headertitle">
+ <a href="http://code.mindmeldr.com">code.mindmeldr.com</a>/<a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>
+ </div>
+ {%- endblock %}
+ <div class="rel">
+ {%- for rellink in rellinks|reverse %}
+ <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
+ {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
+ {%- if not loop.last %}{{ reldelim2 }}{% endif %}
+ {%- endfor %}
+ </div>
+ </div>
+ </div>
+{% endblock %}
+
{%- block extrahead %}
{{ super() }}
<script type="text/javascript">
View
@@ -13,10 +13,18 @@
import sys, os
-parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+custom_theme = "sphinx-bootstrap"
+custom_theme = ""
+
+current_dir = os.path.abspath(os.path.dirname(__file__))
+parent_dir = os.path.dirname(current_dir)
pkg_name = os.path.basename(parent_dir)
pkg_dir = os.path.join(parent_dir, pkg_name)
-sys.path.insert(0,pkg_dir)
+sys.path.insert(0, pkg_dir)
+
+if custom_theme:
+ theme_dir = os.path.join(current_dir, '_themes', custom_theme)
+ sys.path.insert(0, theme_dir)
try:
import about
@@ -40,6 +48,9 @@
version = about.version
release = about.version
+def setup(app):
+ app.add_config_value('custom_theme', '', True)
+
# 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
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -52,10 +63,10 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = []
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode']
# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
+templates_path = [] if custom_theme else ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
@@ -78,7 +89,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
-exclude_patterns = []
+exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
@@ -105,22 +116,32 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'agogo'
+html_theme = custom_theme or 'agogo'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
+if html_theme == "sphinx-bootstrap":
+ html_theme_options = {
+ 'analytics_code': 'UA-35342722-1',
+ 'github_user': 'mitotic',
+ 'github_repo': 'graphterm',
+ 'twitter_username': 'graphterm',
+ 'home_url': 'http://code.mindmeldr.com/graphterm',
+ # 'disqus_shortname': 'mindcoder',
+ }
+
# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
+html_theme_path = ['_themes']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
+html_short_title = 'graphterm'
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
@@ -161,7 +182,7 @@
#html_split_index = False
# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
+html_show_sourcelink = False
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
View
@@ -33,7 +33,23 @@ which implemented a terminal using the Mozilla framework and
`AjaxTerm <https://github.com/antonylesuisse/qweb/tree/master/ajaxterm>`_
which is an AJAX/Python terminal implementation. (Another recent
project along these lines is `TermKit <http://acko.net/blog/on-termkit/>`_.)
-
+For more information, see the following:
+
+.. toctree::
+ :maxdepth: 1
+
+ README <README>
+ Using GraphTerm <usage>
+ Troubleshooting <troubleshooting>
+ Implementation <implementation>
+ Screenshots <screenshots>
+ Release Notes <release-notes>
+ Tutorials and talks <tutorials>
+ Demo video <http://youtu.be/TvO1SnEpwfE>
+ PyPI Package Index (for downloading and installing) <http://pypi.python.org/pypi/graphterm>
+ Source code at Github <https://github.com/mitotic/graphterm>
+ advanced
+
A GraphTerm terminal window is just a web page served from the
GraphTerm web server program. Multiple users can connect
simultaneously to the web server to share terminal sessions.
@@ -90,23 +106,6 @@ For updates, join the Google Groups
src="https://platform.twitter.com/widgets/follow_button.html?screen_name=graphterm&count=none"
style="width:130px; height:20px;"></iframe><p>
-For more information, see the following:
-
-.. toctree::
- :maxdepth: 1
-
- README <README>
- Using GraphTerm <usage>
- Troubleshooting <troubleshooting>
- Implementation <implementation>
- Screenshots <screenshots>
- Release Notes <release-notes>
- Tutorials and talks <tutorials>
- Demo video <http://youtu.be/TvO1SnEpwfE>
- PyPI Package Index (for downloading and installing) <http://pypi.python.org/pypi/graphterm>
- Source code at Github <https://github.com/mitotic/graphterm>
- advanced
-
Here is a sample screenshot illustrating graphical ``gls`` and ``cat`` command
output using a 3D perspective theme (captured on OS X Lion, using Google Chrome).

0 comments on commit e00fae3

Please sign in to comment.