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

[docs] Add "Edit on GH" links, fix searchbox, widen viewport, better legibility #833

Merged
merged 8 commits into from
Mar 28, 2022
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ js: $(ISSO_JS_DST)
${DOCS_CSS_DST}: $(DOCS_CSS_SRC) $(DOCS_CSS_DEP)
$(SASS) $(DOCS_CSS_SRC) $@

${DOCS_HTML_DST}: $(DOCS_RST_SRC)
${DOCS_HTML_DST}: $(DOCS_RST_SRC) $(DOCS_CSS_DST)
sphinx-build -b dirhtml docs/ $@

site: $(DOCS_HTML_DST)
Expand Down
18 changes: 2 additions & 16 deletions docs/_isso/layout.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
<!DOCTYPE html>
{%- set url_root = pathto('', 1) %}
{# XXX necessary? #}
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}

{%- macro script() %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ url_root }}',
VERSION: '{{ release|e }}',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
HAS_SOURCE: {{ has_source|lower }},
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- for js in script_files %}
{{ js_tag(js) }}
{%- endfor %}
{%- endmacro %}

{%- macro css() %}
<!--link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /-->
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/css/site.css', 1) }}"/>
{%- for cssfile in css_files %}
Expand Down
5 changes: 5 additions & 0 deletions docs/_isso/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ <h1>{{- title -}}</h1>
{% endif %}
</div>
<div class="docs">
{%- if hasdoc(pagename) and display_github %}
<div class="vcs-edit-container">
<a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/{{ theme_vcs_pageview_mode or "blob" }}/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ page_source_suffix or ".html" }}" class="vcs-edit"><img src="{{ pathto('_static/github.svg', 1) }}" /> Edit on GitHub</a>
</div>
{%- endif %}
{{ body }}
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion docs/_isso/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h1>Search</h1>
</header>
{% endblock %}
{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}
{% set script_files = script_files + ['_static/searchtools.js'] + ['_static/language_data.js'] %}
{% block extrahead %}
<script type="text/javascript">
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
Expand Down
4 changes: 4 additions & 0 deletions docs/_isso/sidebar-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@
{{ doc("docs/extras/api", "API") }}
{{ doc("docs/extras/contribs", "Community tools") }}
</ul>

{%- block sidebarsearch %}
{%- include "searchbox.html" %}
{%- endblock %}
63 changes: 44 additions & 19 deletions docs/_static/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ h1, h2, h3, h4, h5, h6 {
font-style: normal; }

body {
font: 14px "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-family: sans-serif;
color: black; }

.wrapper {
Expand All @@ -33,7 +34,7 @@ body {

.header {
*zoom: 1;
max-width: 68em;
max-width: 80em;
margin-left: auto;
margin-right: auto;
padding-top: 1em;
Expand All @@ -44,7 +45,7 @@ body {
.header:after {
clear: both; }
.header a, .header a:visited {
color: #4d4c4c;
color: #151515;
text-decoration: none; }
.header header {
display: block;
Expand Down Expand Up @@ -76,17 +77,17 @@ body {
display: block;
float: right;
margin-left: 2em;
font-weight: 300;
font-weight: bold;
text-transform: uppercase;
color: #444;
letter-spacing: 0.05em; }
color: #151515;
letter-spacing: 0.1em; }

.outer {
background-color: #eeeeee;
box-shadow: inset 0 0 0.5em #c0c0c0; }
.outer header {
*zoom: 1;
max-width: 68em;
max-width: 80em;
margin-left: auto;
margin-right: auto;
padding: 1em 0; }
Expand All @@ -97,12 +98,14 @@ body {
clear: both; }
.outer header h1 {
color: #555;
font: 300 35px Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 300;
font-size: 35px;
font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
text-shadow: 1px 0 #c0c0c0;
letter-spacing: 0.05em; }
.outer footer {
*zoom: 1;
max-width: 68em;
max-width: 80em;
margin-left: auto;
margin-right: auto; }
.outer footer:before, .outer footer:after {
Expand All @@ -112,7 +115,7 @@ body {
clear: both; }
.outer .index {
*zoom: 1;
max-width: 68em;
max-width: 80em;
margin-left: auto;
margin-right: auto;
padding: 1em; }
Expand Down Expand Up @@ -149,7 +152,7 @@ body {
font-size: 18px;
color: black; }
.outer .index ul li p {
color: #5c5c5c; }
color: #2f2f2f; }
.outer .index ul li p + p {
margin-top: 0.5em; }

Expand All @@ -159,7 +162,7 @@ body {

main {
*zoom: 1;
max-width: 68em;
max-width: 80em;
margin-left: auto;
margin-right: auto;
margin-top: 1.6em;
Expand Down Expand Up @@ -190,8 +193,10 @@ main {
margin-top: 0; }
main .links li {
list-style-type: none; }
main .links .search input {
padding: 0.1em 0.4em; }
main .search input {
padding: 0.1em 0.4em;
margin-top: 0.3em;
max-width: 100%; }
main .demo {
display: block;
float: left;
Expand Down Expand Up @@ -225,7 +230,8 @@ main {
main .sidebar strong {
color: #00aac2;
font-weight: bold;
text-transform: uppercase; }
text-transform: uppercase;
letter-spacing: 0.5px; }
main .sidebar ul {
margin-top: 0.5em;
margin-bottom: 1em; }
Expand All @@ -237,22 +243,32 @@ main {
padding-left: 0.75em;
padding-top: 0.25em;
padding-bottom: 0.25em;
font-weight: 300;
font-weight: normal;
list-style-type: none; }
main .sidebar li a {
color: #5c5c5c; }
color: #2f2f2f; }
main .sidebar .active {
border-left-color: #00aac2; }
main .sidebar .active a {
color: #00aac2;
font-weight: bold; }
main .sidebar #searchbox {
color: #2f2f2f; }
main .sidebar #searchbox h2 {
color: #00aac2;
font-weight: bold;
text-transform: uppercase;
font-size: 14px;
/* Disable '»' */ }
main .sidebar #searchbox h2:before {
content: ""; }
main .docs {
display: block;
float: left;
margin-right: 5.8515051827%;
width: 78.8296989635%;
font-size: 15px;
color: #5c5c5c; }
font-size: 16px;
color: #2f2f2f; }
main .docs:last-child {
margin-right: 0; }
main .docs h2, main .docs h3, main .docs h4 {
Expand Down Expand Up @@ -300,6 +316,15 @@ main {
list-style-type: square;
margin-left: 2em;
margin-right: 2em; }
main .docs .vcs-edit {
font-size: 1.16em;
line-height: 1.16em;
float: right; }
main .docs .vcs-edit img {
height: 20px;
width: 20px;
margin-right: 0.2em;
vertical-align: top; }
main a {
text-decoration: none;
color: #00aac2; }
Expand Down
65 changes: 52 additions & 13 deletions docs/_static/css/site.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
@import "bourbon/bourbon";
@import "neat/neat";

// Override bourbon _grid.scss
$max-width: em(1280); // Max-width of the outer container, divided by 16

$blue: #00aac2;
$text: #5c5c5c;
$text: #2f2f2f;
$muted-grey: #151515;

* {
margin: 0;
Expand All @@ -19,7 +23,8 @@ h1, h2, h3, h4, h5, h6 {
}

body {
font: 14px "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-family: sans-serif;
color: black;
}

Expand All @@ -45,7 +50,7 @@ body {
padding-bottom: 1em;

a, a:visited {
color: #4d4c4c;
color: $muted-grey;
text-decoration: none;
}

Expand Down Expand Up @@ -81,11 +86,11 @@ body {
float: right;
margin-left: 2em;

font-weight: 300;
font-weight: bold;
text-transform: uppercase;

color: #444;
letter-spacing: 0.05em;
color: $muted-grey;
letter-spacing: 0.1em;
}
}
}
Expand All @@ -101,7 +106,9 @@ body {

h1 {
color: #555;
font: 300 35px Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 300;
font-size: 35px;
font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
text-shadow: 1px 0 #c0c0c0;
letter-spacing: 0.05em;
}
Expand Down Expand Up @@ -191,11 +198,13 @@ main {
li {
list-style-type: none;
}
}

.search {
input {
padding: 0.1em 0.4em;
}
.search {
input {
padding: 0.1em 0.4em;
margin-top: 0.3em;
max-width: 100%;
}
}

Expand Down Expand Up @@ -234,6 +243,7 @@ main {
color: $blue;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.5px;
}

ul {
Expand All @@ -253,7 +263,7 @@ main {
padding-top: 0.25em;
padding-bottom: 0.25em;

font-weight: 300;
font-weight: normal;
list-style-type: none;

a {
Expand All @@ -269,12 +279,28 @@ main {
font-weight: bold;
}
}

#searchbox {
color: $text;

h2 {
color: $blue;
font-weight: bold;
text-transform: uppercase;
font-size: 14px;

/* Disable '»' */
&:before {
content: "";
}
}
}
}

.docs {
@include span-columns(4 of 5);

font-size: 15px;
font-size: 16px;
color: $text;

h2, h3, h4 {
Expand Down Expand Up @@ -355,6 +381,19 @@ main {
margin-right: 2em;
}
}

// "Edit on Github" link
.vcs-edit {
font-size: 1.16em;
line-height: 1.16em;
float: right;
& img {
height: 20px;
width: 20px;
margin-right: 0.2em;
vertical-align: top;
}
}
}

a {
Expand Down
1 change: 1 addition & 0 deletions docs/_static/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,10 @@

# Output file base name for HTML help builder.
htmlhelp_basename = 'Issodoc'

html_context = {
'display_github': True,
'github_user': 'posativ',
'github_repo': 'isso',
'github_version': 'master/docs/',
}
Loading