Skip to content

Commit b90f884

Browse files
committed
Added GitHub Buttons
1 parent c6bb27c commit b90f884

File tree

3 files changed

+50
-29
lines changed

3 files changed

+50
-29
lines changed

docs/source/_templates/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""
2-
Sphinx Read the Docs theme.
2+
This theme template is nearly entirely based on the Sphinx Read the Docs theme
3+
from https://github.com/ryan-roemer/sphinx-bootstrap-theme.
34
4-
From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
5+
Some minor modifications have been made to the template by Jonah Lawrence.
56
"""
67

78
from os import path
Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,71 @@
11
{%- if meta is defined and meta is not none %}
2-
{%- set check_meta = True %}
2+
{%- set check_meta = True %}
33
{%- else %}
4-
{%- set check_meta = False %}
4+
{%- set check_meta = False %}
55
{%- endif %}
66

77
{%- if check_meta and 'github_url' in meta %}
8-
{%- set display_github = True %}
8+
{%- set display_github = True %}
99
{%- endif %}
1010

1111
{%- if check_meta and 'bitbucket_url' in meta %}
12-
{%- set display_bitbucket = True %}
12+
{%- set display_bitbucket = True %}
1313
{%- endif %}
1414

1515
{%- if check_meta and 'gitlab_url' in meta %}
16-
{%- set display_gitlab = True %}
16+
{%- set display_gitlab = True %}
1717
{%- endif %}
1818

19+
1920
{%- set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %}
2021

21-
{#- Translators: This is an ARIA section label for page links, including previous/next page link and links to GitHub/GitLab/etc. -#}
22+
{#- Translators: This is an ARIA section label for page links, including previous/next page link and links to
23+
GitHub/GitLab/etc. -#}
2224
<div role="navigation" aria-label="{{ _('Page navigation') }}">
2325
<ul class="wy-breadcrumbs">
2426
{%- block breadcrumbs %}
25-
<li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a> &raquo;</li>
26-
{%- for doc in parents %}
27-
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
28-
{%- endfor %}
29-
<li>{{ title }}</li>
27+
<li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a> &raquo;</li>
28+
{%- for doc in parents %}
29+
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
30+
{%- endfor %}
31+
<li>{{ title }}</li>
3032
{%- endblock %}
3133
{%- block breadcrumbs_aside %}
32-
<li class="wy-breadcrumbs-aside">
33-
{%- if hasdoc(pagename) and display_vcs_links %}
34-
<a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}" class="fa fa-github"> {{ _('View on GitHub') }}</a>
35-
{%- endif %}
36-
</li>
34+
<li class="wy-breadcrumbs-aside">
35+
{%- if hasdoc(pagename) and display_vcs_links %}
36+
<!-- <a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}" class="fa fa-github"> {{ _('View on GitHub') }}</a> -->
37+
{%- endif %}
38+
<!-- GitHub badges/links section -->
39+
<div class="github">
40+
<!-- GitHub Sponsors -->
41+
<a class="github-button" href="https://github.com/sponsors/denvercoder1"
42+
data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-heart"
43+
data-size="large" aria-label="Sponsor @denvercoder1 on GitHub">Sponsor</a>
44+
<!-- View on GitHub -->
45+
<a class="github-button" href="https://github.com/denvercoder1/table2ascii"
46+
data-color-scheme="no-preference: light; light: light; dark: dark;" data-size="large"
47+
aria-label="View denvercoder1/table2ascii on GitHub">View on GitHub</a>
48+
<!-- GitHub Star -->
49+
<a class="github-button" href="https://github.com/denvercoder1/table2ascii"
50+
data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-star" data-size="large"
51+
data-show-count="true" aria-label="Star denvercoder1/table2ascii on GitHub">Star</a>
52+
</div>
53+
</li>
3754
{%- endblock %}
3855
</ul>
3956

4057
{%- if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
4158
{#- Translators: This is an ARIA section label for sequential page links, such as previous and next page links. -#}
4259
<div class="rst-breadcrumbs-buttons" role="navigation" aria-label="{{ _('Sequential page navigation') }}">
43-
{%- if prev %}
44-
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
45-
{%- endif %}
46-
{%- if next %}
47-
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n">{{ _('Next') }} <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
48-
{%- endif %}
60+
{%- if prev %}
61+
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}"
62+
accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
63+
{%- endif %}
64+
{%- if next %}
65+
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}"
66+
accesskey="n">{{ _('Next') }} <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
67+
{%- endif %}
4968
</div>
5069
{%- endif %}
51-
<hr/>
52-
</div>
70+
<hr />
71+
</div>

docs/source/_templates/layout.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@
9595
{%- endfor %}
9696
{%- endif %}
9797
<script src="{{ pathto('_static/js/theme.js', 1) }}"></script>
98+
<!-- DarkReader - automatic dark mode -->
9899
<script src="https://cdn.jsdelivr.net/npm/darkreader@4.9.39/darkreader.min.js"></script>
99-
<script>
100-
DarkReader.auto();
101-
</script>
100+
<script>DarkReader.auto();</script>
101+
<!-- GitHub Buttons -->
102+
<script async defer src="https://buttons.github.io/buttons.js"></script>
102103

103104
{#- OPENSEARCH #}
104105
{%- if use_opensearch %}

0 commit comments

Comments
 (0)