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

Make it easy to open a documentation bug from the docs themselves #680

Merged
merged 4 commits into from
Feb 25, 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
50 changes: 29 additions & 21 deletions docs/_static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,18 @@ h2 .headerlink:hover {
opacity: 0.3;
}

#file-issue {
position: absolute;
right: 20px;
top: 20px;
display: none;
}

#file-issue-secondary {
margin-top: 1em;
display: inline-block;
}

.v-list {
color: rgba(0,0,0,0.2);
}
Expand Down Expand Up @@ -1022,26 +1034,6 @@ h2 .headerlink:hover {

}

@media only screen and (min-width: 45em) {

/*
Docs Header
*/

.versions {
position: absolute;
top: 6em;
right: 2em;
margin: 0;
}

.v-btn {
font-size: 0.7em;
line-height: normal;
}

}

@media only screen and (min-width: 50em) {

/*
Expand All @@ -1062,6 +1054,14 @@ h2 .headerlink:hover {
line-height: 70px;
}

#file-issue {
display: inline;
}

#file-issue-secondary {
display: none;
}

/*
Logo
*/
Expand Down Expand Up @@ -1133,7 +1133,15 @@ h2 .headerlink:hover {
}

.versions {
top: 7em;
position: absolute;
top: 6em;
right: 2em;
margin: 0;
}

.v-btn {
font-size: 0.7em;
line-height: normal;
}

/*
Expand Down
13 changes: 13 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ <h1 class="logo">
</li>
</ul>
</nav><!-- end of .main-nav -->
{%- if show_source and has_source and pagename %}
{%- set issue_uri = issue_uri_template.format(pagename|urlencode, release|urlencode) %}
{%- endif %}
<a href="{{ issue_uri }}" target="_blank" class="v-btn" id="file-issue">
<img src="_static/images/icon-link-github.svg" />
Report an Issue
</a>
</header><!-- end of .page-header -->
{% endblock %}

Expand All @@ -101,6 +108,12 @@ <h1 class="page-title">Python</h1>
Version History ({{ release|e }})
</a>
</div><!-- end of .versions -->
<div>
<a href="{{ issue_uri }}" target="_blank" class="v-btn" id="file-issue-secondary">
<img src="_static/images/icon-link-github.svg" />
Report an Issue
</a>
</div>
</header>

<section class="content">
Expand Down
14 changes: 14 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from pkg_resources import get_distribution
import sys, os
import urllib

# 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
Expand Down Expand Up @@ -179,6 +180,8 @@
# Output file base name for HTML help builder.
htmlhelp_basename = 'gclouddoc'

html_context = {}


# -- Options for LaTeX output --------------------------------------------------

Expand Down Expand Up @@ -257,3 +260,14 @@
# This pulls class descriptions from the class docstring,
# and parameter definitions from the __init__ docstring.
autoclass_content = 'both'

issue_uri = ('https://github.com/GoogleCloudPlatform/gcloud-python/issues/'
'new?' + urllib.urlencode({'title': '[Documentation Issue] '}))
issue_uri_template = (
issue_uri + '&' + urllib.urlencode({'body': 'Page Name: '}) + '{0}' +
urllib.quote('\nRelease: ') + '{1}')

html_context.update(
issue_uri=issue_uri,
issue_uri_template=issue_uri_template,
)