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

Using caption with different toc sections instead of JS/CSS hack. #1025

Merged
merged 1 commit into from
Aug 5, 2015
Merged
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
12 changes: 12 additions & 0 deletions docs/_static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,18 @@ h2 .headerlink:hover {
margin-top: 2em;
}

.side-nav > ul > li.toctree-l1 {
padding-left: 2em;
}

p.caption {
padding-left: 2em;
}

span.caption-text {
font-weight: bold;
}

.external-links img {
margin-right: 0.3em;
opacity: 0.3;
Expand Down
10 changes: 0 additions & 10 deletions docs/_static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ $('.headerlink').parent().each(function() {
);
});

$('.side-nav').children('ul:nth-child(2)').children().each(function() {
var itemName = $(this).text();
if (itemName !== 'Datastore' &&
itemName !== 'Storage' &&
itemName !== 'Pub/Sub' &&
itemName !== 'BigQuery') {
$(this).css('padding-left','2em');
}
});

var apiQsSection;
// don't even ask me why
if ($('#cloud-datastore-in-10-seconds').length)
Expand Down
1 change: 0 additions & 1 deletion docs/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ <h1 class="page-title">Python</h1>
{% block body %} {% endblock %}
</section><!-- end of .content -->
<nav class="side-nav">
<ul><li><a href="{{ pathto('index') }}">gcloud</a></li></ul>
{{ toctree(includehidden=True, maxdepth=1, titles_only=True) }}
<ul class="external-links">
<li>
Expand Down
19 changes: 14 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
import sys
import urllib

import sphinx_rtd_theme


ON_READ_THE_DOCS = os.environ.get('READTHEDOCS', None) == 'True'
LOCAL_READ_THE_DOCS = os.environ.get('LOCAL_RTD', None) == '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.
Expand All @@ -38,7 +44,10 @@
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
if ON_READ_THE_DOCS or LOCAL_READ_THE_DOCS:
templates_path = []
else:
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down Expand Up @@ -103,10 +112,10 @@

html_theme = 'classic'

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
html_style = 'default.css'
else:
if LOCAL_READ_THE_DOCS:
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
elif not ON_READ_THE_DOCS:
html_style = 'css/main.css'

# Theme options are theme-specific and customize the look and feel of a theme
Expand Down
25 changes: 25 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
.. toctree::
:maxdepth: 0
:hidden:
:caption: gcloud

gcloud-api

.. toctree::
:maxdepth: 0
:hidden:
:caption: Datastore

datastore-overview
datastore-client
datastore-entities
datastore-keys
datastore-queries
datastore-transactions
datastore-batches

.. toctree::
:maxdepth: 0
:hidden:
:caption: Storage

storage-api
storage-blobs
storage-buckets
storage-acl

.. toctree::
:maxdepth: 0
:hidden:
:caption: Pub/Sub

pubsub-api
pubsub-usage
pubsub-topic
pubsub-subscription

.. toctree::
:maxdepth: 0
:hidden:
:caption: BigQuery

bigquery-usage


Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ commands =
sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
deps =
Sphinx
passenv = {[testenv:system-tests]passenv} SPHINX_RELEASE
passenv = {[testenv:system-tests]passenv} SPHINX_RELEASE READTHEDOCS LOCAL_RTD

[pep8]
exclude = gcloud/datastore/_datastore_v1_pb2.py,docs/conf.py
Expand Down