1*7ab6e6acSAndroid Build Coastguard Workeresnet-gh-pages-base 2*7ab6e6acSAndroid Build Coastguard Worker=================== 3*7ab6e6acSAndroid Build Coastguard Worker 4*7ab6e6acSAndroid Build Coastguard WorkerBase templates for ESnet's GitHub pages. These pages are created using the 5*7ab6e6acSAndroid Build Coastguard WorkerSphinx_ documentation package using the sphinx-bootstrap-theme_ with some 6*7ab6e6acSAndroid Build Coastguard Workerpages. This repo is meant to be included into a project using git subtree and 7*7ab6e6acSAndroid Build Coastguard Workerprovides the overrides and customizations to the base theme. 8*7ab6e6acSAndroid Build Coastguard Worker 9*7ab6e6acSAndroid Build Coastguard Worker.. _Sphinx: http://sphinx-doc.org 10*7ab6e6acSAndroid Build Coastguard Worker.. _sphinx-bootstrap-theme: https://github.com/ryan-roemer/sphinx-bootstrap-theme 11*7ab6e6acSAndroid Build Coastguard Worker 12*7ab6e6acSAndroid Build Coastguard WorkerInstallation 13*7ab6e6acSAndroid Build Coastguard Worker------------ 14*7ab6e6acSAndroid Build Coastguard Worker 15*7ab6e6acSAndroid Build Coastguard Worker1. Install Sphinx and sphinx-bootstrap-theme. See the instructions below for 16*7ab6e6acSAndroid Build Coastguard Worker installing these either using the Mac OS X base system python or MacPorts. 17*7ab6e6acSAndroid Build Coastguard Worker2. ``cd $PROJECT_ROOT`` 18*7ab6e6acSAndroid Build Coastguard Worker3. ``mkdir docs`` 19*7ab6e6acSAndroid Build Coastguard Worker4. ``git subtree add --prefix docs/_esnet https://github.com/esnet/esnet-gh-pages-base.git master --squash`` 20*7ab6e6acSAndroid Build Coastguard Worker5. ``cd docs`` 21*7ab6e6acSAndroid Build Coastguard Worker6. ``sphinx-quickstart`` 22*7ab6e6acSAndroid Build Coastguard Worker7. ``ln -s ../_esnet/static _static/esnet`` 23*7ab6e6acSAndroid Build Coastguard Worker8. edit ``conf.py`` as described in the next section 24*7ab6e6acSAndroid Build Coastguard Worker 25*7ab6e6acSAndroid Build Coastguard WorkerEditing conf.py 26*7ab6e6acSAndroid Build Coastguard Worker^^^^^^^^^^^^^^^ 27*7ab6e6acSAndroid Build Coastguard Worker 28*7ab6e6acSAndroid Build Coastguard Worker``sphinx-quickstart`` creates a basic conf.py file, however to use the ESnet 29*7ab6e6acSAndroid Build Coastguard Workertheme we need to make some changes. Make the following changes to conf.py:: 30*7ab6e6acSAndroid Build Coastguard Worker 31*7ab6e6acSAndroid Build Coastguard Worker # add this with the imports at the top of the file 32*7ab6e6acSAndroid Build Coastguard Worker import sphinx_bootstrap_theme 33*7ab6e6acSAndroid Build Coastguard Worker 34*7ab6e6acSAndroid Build Coastguard Worker # change templates_path to this 35*7ab6e6acSAndroid Build Coastguard Worker templates_path = ['_esnet/templates'] 36*7ab6e6acSAndroid Build Coastguard Worker 37*7ab6e6acSAndroid Build Coastguard Worker # add _esnet to exclude_patterns 38*7ab6e6acSAndroid Build Coastguard Worker exclude_patterns = ['_build', '_esnet'] 39*7ab6e6acSAndroid Build Coastguard Worker 40*7ab6e6acSAndroid Build Coastguard Worker # change html_theme and html_theme_path: 41*7ab6e6acSAndroid Build Coastguard Worker html_theme = 'bootstrap' 42*7ab6e6acSAndroid Build Coastguard Worker html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() 43*7ab6e6acSAndroid Build Coastguard Worker 44*7ab6e6acSAndroid Build Coastguard Worker # add html_theme options: 45*7ab6e6acSAndroid Build Coastguard Worker html_theme_options = { 46*7ab6e6acSAndroid Build Coastguard Worker "navbar_pagenav": False, 47*7ab6e6acSAndroid Build Coastguard Worker "nosidebar": False, 48*7ab6e6acSAndroid Build Coastguard Worker "navbar_class": "navbar", 49*7ab6e6acSAndroid Build Coastguard Worker "navbar_site_name": "Section", 50*7ab6e6acSAndroid Build Coastguard Worker "source_link_position": "footer", 51*7ab6e6acSAndroid Build Coastguard Worker "navbar_links": [ 52*7ab6e6acSAndroid Build Coastguard Worker ("Index", "genindex"), 53*7ab6e6acSAndroid Build Coastguard Worker ("ESnet", "https://www.es.net", True), 54*7ab6e6acSAndroid Build Coastguard Worker ], 55*7ab6e6acSAndroid Build Coastguard Worker } 56*7ab6e6acSAndroid Build Coastguard Worker 57*7ab6e6acSAndroid Build Coastguard Worker # add html_logo and html_sidebars 58*7ab6e6acSAndroid Build Coastguard Worker html_logo = "_esnet/static/logo-esnet-ball-sm.png" 59*7ab6e6acSAndroid Build Coastguard Worker html_sidebars = {'index': None, 'search': None, '*': ['localtoc.html']} 60*7ab6e6acSAndroid Build Coastguard Worker html_favicon = "_esnet/static/favicon.ico" 61*7ab6e6acSAndroid Build Coastguard Worker html_context = { 62*7ab6e6acSAndroid Build Coastguard Worker "github_url": "https://github.com/esnet/PROJNAME", 63*7ab6e6acSAndroid Build Coastguard Worker } 64*7ab6e6acSAndroid Build Coastguard Worker 65*7ab6e6acSAndroid Build Coastguard WorkerThat's it! 66*7ab6e6acSAndroid Build Coastguard Worker 67*7ab6e6acSAndroid Build Coastguard WorkerSphinx Installation using Mac OS X Base Python 68*7ab6e6acSAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 69*7ab6e6acSAndroid Build Coastguard Worker 70*7ab6e6acSAndroid Build Coastguard Worker1. sudo /usr/bin/easy_install pip 71*7ab6e6acSAndroid Build Coastguard Worker2. sudo /usr/local/bin/pip install sphinx sphinx-bootstrap-theme 72*7ab6e6acSAndroid Build Coastguard Worker 73*7ab6e6acSAndroid Build Coastguard WorkerSphinx Installation using MacPorts 74*7ab6e6acSAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 75*7ab6e6acSAndroid Build Coastguard Worker 76*7ab6e6acSAndroid Build Coastguard Worker1. port install python27 py27-pip py27-sphinx 77*7ab6e6acSAndroid Build Coastguard Worker2. port select pip py27-pip 78*7ab6e6acSAndroid Build Coastguard Worker3. port select sphinx py27-sphinx 79*7ab6e6acSAndroid Build Coastguard Worker4. pip install sphinx sphinx-bootstrap-theme # make sure this is 80*7ab6e6acSAndroid Build Coastguard Worker /opt/local/bin/pip 81*7ab6e6acSAndroid Build Coastguard Worker 82*7ab6e6acSAndroid Build Coastguard WorkerCreating Content, Previewing and Publishing 83*7ab6e6acSAndroid Build Coastguard Worker------------------------------------------- 84*7ab6e6acSAndroid Build Coastguard Worker 85*7ab6e6acSAndroid Build Coastguard WorkerThe files are in the ``docs`` directory. Take a look at the content of 86*7ab6e6acSAndroid Build Coastguard Worker``index.rst``. Take a look at the docs from other projects and review the 87*7ab6e6acSAndroid Build Coastguard Workerdocumentation for Sphinx_. 88*7ab6e6acSAndroid Build Coastguard Worker 89*7ab6e6acSAndroid Build Coastguard WorkerBuilding HTML 90*7ab6e6acSAndroid Build Coastguard Worker^^^^^^^^^^^^^ 91*7ab6e6acSAndroid Build Coastguard Worker 92*7ab6e6acSAndroid Build Coastguard WorkerIn the ``docs`` directory run ``make clean html``. 93*7ab6e6acSAndroid Build Coastguard Worker 94*7ab6e6acSAndroid Build Coastguard WorkerPreviewing the site 95*7ab6e6acSAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^ 96*7ab6e6acSAndroid Build Coastguard Worker 97*7ab6e6acSAndroid Build Coastguard Worker``open _build/html/index.html`` 98*7ab6e6acSAndroid Build Coastguard Worker 99*7ab6e6acSAndroid Build Coastguard Workeror 100*7ab6e6acSAndroid Build Coastguard Worker 101*7ab6e6acSAndroid Build Coastguard Worker``open -a /Application/Google\ Chrome.app _build/html/index.html`` 102*7ab6e6acSAndroid Build Coastguard Worker 103*7ab6e6acSAndroid Build Coastguard WorkerPublishing the site 104*7ab6e6acSAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^ 105*7ab6e6acSAndroid Build Coastguard Worker 106*7ab6e6acSAndroid Build Coastguard WorkerFrom the ``docs`` directory run ``_esnet/deploy.sh``. It will be visible at: 107*7ab6e6acSAndroid Build Coastguard Worker``http://github.com/esnet/PROJECT``. 108