mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
Refactor html docs build process to use new template and env variable
This commit is contained in:
parent
028d02ba7a
commit
48c2620e3e
5 changed files with 56 additions and 48 deletions
14
docs/source/_templates/versions.html
Normal file
14
docs/source/_templates/versions.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{% if mamedev_site %}
|
||||
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Downloads') }}">
|
||||
<span class="rst-current-version" data-toggle="rst-current-version">
|
||||
<span class="fa fa-book">Downloads</span>
|
||||
<span class="fa fa-caret-down"></span>
|
||||
</span>
|
||||
<div class="rst-other-versions">
|
||||
<dl>
|
||||
<dd><a href="https://docs.mamedev.org/_files/MAME.pdf">PDF</a></dd>
|
||||
<dd><a href="https://docs.mamedev.org/_files/MAME.epub">EPUB</a></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
|
@ -262,3 +262,12 @@ texinfo_documents = [
|
|||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# Add download links at bottom left when the MAMEDEV environment
|
||||
# varaible is set. See versions.html in the _template folder.
|
||||
try:
|
||||
html_context
|
||||
except NameError:
|
||||
html_context = dict()
|
||||
if os.getenv("MAMEDEV") != None:
|
||||
html_context['mamedev_site'] = True
|
||||
|
|
1
docs/themes/sphinx_rtd_theme/theme.conf
vendored
1
docs/themes/sphinx_rtd_theme/theme.conf
vendored
|
@ -18,4 +18,3 @@ prev_next_buttons_location = bottom
|
|||
style_external_links = False
|
||||
style_nav_header_background =
|
||||
vcs_pageview_mode =
|
||||
mamedevorg = True
|
||||
|
|
19
docs/themes/sphinx_rtd_theme/versions.html
vendored
19
docs/themes/sphinx_rtd_theme/versions.html
vendored
|
@ -1,6 +1,6 @@
|
|||
{% if READTHEDOCS %}
|
||||
{# Add rst-badge after rst-versions for small badge style. #}
|
||||
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Versions') }}">
|
||||
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Versions') }}">
|
||||
<span class="rst-current-version" data-toggle="rst-current-version">
|
||||
<span class="fa fa-book"> Read the Docs</span>
|
||||
v: {{ current_version }}
|
||||
|
@ -30,20 +30,5 @@
|
|||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{# This section only gets used when mamedevorg is set to anything in theme.conf #}
|
||||
{% if theme_mamedevorg %}
|
||||
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="{{ _('Downloads') }}">
|
||||
<span class="rst-current-version" data-toggle="rst-current-version">
|
||||
<span class="fa fa-book">Downloads</span>
|
||||
<span class="fa fa-caret-down"></span>
|
||||
</span>
|
||||
<div class="rst-other-versions">
|
||||
<dl>
|
||||
<dd><a href="https://docs.mamedev.org/_files/MAME.pdf">PDF</a></dd>
|
||||
<dd><a href="https://docs.mamedev.org/_files/MAME.epub">EPUB</a></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
@ -12,7 +12,8 @@ elif [ $LOCAL = $BASE ]; then
|
|||
echo "Need to pull"
|
||||
git pull
|
||||
make clean
|
||||
make site
|
||||
# The environment variable added here adds bottom left download pane.
|
||||
MAMEDEV=1 make site
|
||||
elif [ $REMOTE = $BASE ]; then
|
||||
echo "Need to push"
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue