From cc3849a17f2cfcfafb89edc80ee9dbd9b5fe1725 Mon Sep 17 00:00:00 2001 From: Vincent Catalano Date: Sat, 29 Mar 2014 16:43:53 -0700 Subject: [PATCH] Documentation changes for Github pages --- .gitignore | 1 + docs/Makefile | 4 +- docs/source/_static/bootstrap-sphinx.css_t | 240 +++++++++++++++++++++ docs/source/_templates/globaltoc.html | 1 + docs/source/_templates/layout.html | 22 ++ docs/source/_templates/navbar.html | 40 ++++ docs/{ => source}/address.rst | 0 docs/{ => source}/advanced.rst | 0 docs/{ => source}/bank_account.rst | 0 docs/{ => source}/batch.rst | 0 docs/{ => source}/conf.py | 44 ++-- docs/{ => source}/credit_card.rst | 0 docs/{ => source}/customer.rst | 0 docs/{ => source}/development.rst | 0 docs/{ => source}/getting_started.rst | 0 docs/{ => source}/index.rst | 2 +- docs/{ => source}/install.rst | 0 docs/{ => source}/recurring.rst | 0 docs/{ => source}/transaction.rst | 0 19 files changed, 333 insertions(+), 21 deletions(-) create mode 100644 docs/source/_static/bootstrap-sphinx.css_t create mode 100644 docs/source/_templates/globaltoc.html create mode 100644 docs/source/_templates/layout.html create mode 100644 docs/source/_templates/navbar.html rename docs/{ => source}/address.rst (100%) rename docs/{ => source}/advanced.rst (100%) rename docs/{ => source}/bank_account.rst (100%) rename docs/{ => source}/batch.rst (100%) rename docs/{ => source}/conf.py (88%) rename docs/{ => source}/credit_card.rst (100%) rename docs/{ => source}/customer.rst (100%) rename docs/{ => source}/development.rst (100%) rename docs/{ => source}/getting_started.rst (100%) rename docs/{ => source}/index.rst (98%) rename docs/{ => source}/install.rst (100%) rename docs/{ => source}/recurring.rst (100%) rename docs/{ => source}/transaction.rst (100%) diff --git a/.gitignore b/.gitignore index 358ed4c..51a5560 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .DS_Store docs/_build/ build/ +_build/ dist/ *.egg-info/ diff --git a/docs/Makefile b/docs/Makefile index 8ad95ae..8fb8466 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -15,9 +15,9 @@ endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source # the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext diff --git a/docs/source/_static/bootstrap-sphinx.css_t b/docs/source/_static/bootstrap-sphinx.css_t new file mode 100644 index 0000000..b23242c --- /dev/null +++ b/docs/source/_static/bootstrap-sphinx.css_t @@ -0,0 +1,240 @@ +/* +* bootstrap-sphinx.css +* ~~~~~~~~~~~~~~~~~~~~ +* +* Sphinx stylesheet -- Twitter Bootstrap theme. +*/ + +.navbar-inverse .brand { + color: #FFF; +} + +.page-top { + top: 0px; +} + +{% if theme_bootstrap_version == "2" %} +@media (min-width: 980px) { +{% endif %} + {% if theme_navbar_fixed_top == 'true' %} + body { + {% if theme_bootswatch_theme %} + padding-top: 60px; + {% else %} + padding-top: 40px; + {% endif %} + } + .page-top { + {% if theme_bootswatch_theme %} + top: 60px; + {% else %} + top: 40px; + {% endif %} + } +{% if theme_bootstrap_version == "2" %} +} +{% endif %} + +.navbar-inner { + padding-left: 12px !important; + padding-right: 12px !important; +} +{% endif %} + +table { + border: 0; +} + +.highlighttable .code pre { + font-size: 12px; +} + +.highlighttable .linenos pre { + word-break: normal; + font-size: 12px; +} + +div.highlight { + background: none; +} + +a.footnote-reference { + vertical-align: super; + font-size: 75%; +} + +table.footnote td.label { + font-size: 100%; + display: block; + line-height: normal; + background: inherit; +} + +table.footnote { + width: auto; + margin-bottom: 0px; +} + +table.field-list { + width: auto; +} + +.footer { + text-align: center; + width: 100%; + border-top: 1px solid #ccc; + padding-top: 10px; +} + +.bs-sidenav form, .bs-sidenav #sourcelink { + padding: 5px 20px; +} + +{% if theme_bootstrap_version == "3" %} + +/* The code below is based on the bootstrap website sidebar */ + +.bs-sidenav.affix { + position: static; +} + +/* First level of nav */ +.bs-sidenav { + margin-top: 30px; + margin-bottom: 30px; + padding-top: 10px; + padding-bottom: 10px; + text-shadow: 0 1px 0 #fff; + background-color: #f7f5fa; + border-radius: 5px; +} + +/* All levels of nav */ +.bs-sidenav .nav > li > a { + display: block; + color: #716b7a; + padding: 5px 20px; +} +.bs-sidenav .nav > li > a:hover, +.bs-sidenav .nav > li > a:focus { + text-decoration: none; + background-color: #e5e3e9; + border-right: 1px solid #dbd8e0; +} +.bs-sidenav .nav > .current > a, +.bs-sidenav .nav > .current:hover > a, +.bs-sidenav .nav > .current:focus > a { + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-right: 1px solid #563d7c; +} + +.bs-sidenav .nav .nav > li > a { + padding-top: 3px; + padding-bottom: 3px; + padding-left: 30px; + font-size: 90%; +} + +.bs-sidenav .nav .nav .nav > li > a { + padding-top: 3px; + padding-bottom: 3px; + padding-left: 40px; + font-size: 90%; +} + +.bs-sidenav .nav .nav .nav .nav > li > a { + padding-top: 3px; + padding-bottom: 3px; + padding-left: 50px; + font-size: 90%; +} + +/* Show and affix the side nav when space allows it */ +@media screen and (min-width: 992px) { + .bs-sidenav .nav > .active > ul { + display: block; + } + /* Widen the fixed sidenav */ + .bs-sidenav.affix, + .bs-sidenav.affix-bottom { + width: 213px; + } + .bs-sidenav.affix { + position: fixed; /* Undo the static from mobile first approach */ + top: 80px; + } + .bs-sidenav.affix-bottom { + position: absolute; /* Undo the static from mobile first approach */ + } + .bs-sidenav.affix-bottom .bs-sidenav, + .bs-sidenav.affix .bs-sidenav { + margin-top: 0; + margin-bottom: 0; + } +} +@media screen and (min-width: 1200px) { + /* Widen the fixed sidenav again */ + .bs-sidenav.affix-bottom, + .bs-sidenav.affix { + width: 263px; + } +} + + +{% else %} + +.bs-sidenav { + width: 228px; + margin: 30px 0 0; + padding: 10px 0 0 5px; +} + +.bs-sidenav ul{ + list-style-type: none; + padding-left: 25px; + margin-left: 0; /* bootstrap 2 compatability. */ +} + +@media (min-width: 1200px) { + .bs-sidenav { + width: 258px; + } +} + +/* Desktop +------------------------- */ +@media (max-width: 980px) { + .bs-sidenav { + width: 218px; + margin-top: 30px; + margin-right: 0; + } +} + +/* Tablet to desktop +------------------------- */ +@media (min-width: 768px) and (max-width: 979px) { + .bs-sidenav { + width: 166px; + margin-top: 20px; + } +} + +/* Tablet +------------------------- */ +@media (max-width: 767px) { + .navbar-version { + padding-left: 5px; + } + .bs-sidenav { + width: auto; + margin-bottom: 20px; + } + .bs-sidenav.affix { + position: static; + top: 0; + } +} +{% endif %} \ No newline at end of file diff --git a/docs/source/_templates/globaltoc.html b/docs/source/_templates/globaltoc.html new file mode 100644 index 0000000..1db9e21 --- /dev/null +++ b/docs/source/_templates/globaltoc.html @@ -0,0 +1 @@ +{{ toctree(maxdepth=theme_globaltoc_depth|toint, collapse=True, includehidden=theme_globaltoc_includehidden|tobool) }} \ No newline at end of file diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html new file mode 100644 index 0000000..141f615 --- /dev/null +++ b/docs/source/_templates/layout.html @@ -0,0 +1,22 @@ +{% extends "!layout.html" %} + +{# Custom CSS overrides #} +{# set bootswatch_css_custom = ['_static/my-styles.css'] #} + +{# Add github banner (from: https://github.com/blog/273-github-ribbons). #} +{% block header %} + {{ super() }} + + +{% endblock %} \ No newline at end of file diff --git a/docs/source/_templates/navbar.html b/docs/source/_templates/navbar.html new file mode 100644 index 0000000..3ad6f87 --- /dev/null +++ b/docs/source/_templates/navbar.html @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/docs/address.rst b/docs/source/address.rst similarity index 100% rename from docs/address.rst rename to docs/source/address.rst diff --git a/docs/advanced.rst b/docs/source/advanced.rst similarity index 100% rename from docs/advanced.rst rename to docs/source/advanced.rst diff --git a/docs/bank_account.rst b/docs/source/bank_account.rst similarity index 100% rename from docs/bank_account.rst rename to docs/source/bank_account.rst diff --git a/docs/batch.rst b/docs/source/batch.rst similarity index 100% rename from docs/batch.rst rename to docs/source/batch.rst diff --git a/docs/conf.py b/docs/source/conf.py similarity index 88% rename from docs/conf.py rename to docs/source/conf.py index 96dd17f..0e166a3 100644 --- a/docs/conf.py +++ b/docs/source/conf.py @@ -11,7 +11,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys +import os +import sphinx_bootstrap_theme # 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 @@ -41,7 +43,7 @@ # General information about the project. project = u'Py-Authorize' -copyright = u'2013, Vincent Catalano' +copyright = u'2014, Vincent Catalano' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -94,15 +96,21 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'bootstrap' # 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 = {} +html_theme_options = { + 'bootswatch_theme': 'flatly', + + # Global TOC depth for "site" navbar tab. (Default: 1) + # Switching to -1 shows all levels. + 'globaltoc_depth': 2, +} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -134,7 +142,7 @@ #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +html_sidebars = {'**': ['globaltoc.html', 'searchbox.html']} # Additional templates that should be rendered to pages, maps page names to # template names. @@ -167,27 +175,27 @@ #html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'Py-Authorizedoc' +htmlhelp_basename = 'Py-AuthorizeDoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'Py-Authorize.tex', u'Py-Authorize Documentation', - u'Vincent Catalano', 'manual'), + ('index', 'Py-Authorize.tex', u'Py-Authorize Documentation', + u'Vincent Catalano', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -230,9 +238,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'Py-Authorize', u'Py-Authorize Documentation', - u'Vincent Catalano', 'Py-Authorize', 'One line description of project.', - 'Miscellaneous'), + ('index', 'Py-Authorize', u'Py-Authorize Documentation', + u'Vincent Catalano', 'Py-Authorize', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/docs/credit_card.rst b/docs/source/credit_card.rst similarity index 100% rename from docs/credit_card.rst rename to docs/source/credit_card.rst diff --git a/docs/customer.rst b/docs/source/customer.rst similarity index 100% rename from docs/customer.rst rename to docs/source/customer.rst diff --git a/docs/development.rst b/docs/source/development.rst similarity index 100% rename from docs/development.rst rename to docs/source/development.rst diff --git a/docs/getting_started.rst b/docs/source/getting_started.rst similarity index 100% rename from docs/getting_started.rst rename to docs/source/getting_started.rst diff --git a/docs/index.rst b/docs/source/index.rst similarity index 98% rename from docs/index.rst rename to docs/source/index.rst index 57313b7..27bca56 100644 --- a/docs/index.rst +++ b/docs/source/index.rst @@ -47,7 +47,7 @@ Py-Authorize is released under the `MIT License`_. Contents: .. toctree:: - :maxdepth: 2 + :maxdepth: 1 install getting_started diff --git a/docs/install.rst b/docs/source/install.rst similarity index 100% rename from docs/install.rst rename to docs/source/install.rst diff --git a/docs/recurring.rst b/docs/source/recurring.rst similarity index 100% rename from docs/recurring.rst rename to docs/source/recurring.rst diff --git a/docs/transaction.rst b/docs/source/transaction.rst similarity index 100% rename from docs/transaction.rst rename to docs/source/transaction.rst