Skip to content

Add useful resources to the index page #54

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

Merged
merged 3 commits into from
May 4, 2020
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
File renamed without changes.
11 changes: 11 additions & 0 deletions .overrides/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Overrides
=========

This directory is recursively copied into `cpython/Doc`.
It needs to have the same structure than `cpython/Doc`.

It allows us

- to have our own `CONTRIBUTING.rst` guide
- change the index sidebar with links that are interesting for translators
- etc
13 changes: 13 additions & 0 deletions .overrides/tools/templates/customsourcelink.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{%- if show_source and has_source and sourcename %}
<div role="note" aria-label="source link">
<h3>{{ _('This Page') }}</h3>
<ul class="this-page-menu">
<li><a href="{{ pathto('bugs') }}">{% trans %}Report a Bug{% endtrans %}</a></li>
<li>
<a href="https://github.com/PyCampES/python-docs-es/blob/{{ version }}/{{ sourcename|replace('.rst.txt', '.po') }}"
rel="nofollow">{{ _('Show Source') }}
</a>
</li>
</ul>
</div>
{%- endif %}
11 changes: 11 additions & 0 deletions .overrides/tools/templates/indexsidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<h3>¡Ayúdanos a traducir!</h3>
<ul>
<li><a href="CONTRIBUTING.html">Guía para contribuir</a></li>
</ul>

<h3>Recursos</h3>
<ul>
<li><a href="https://mail.python.org/mailman3/lists/docs-es.python.org/">Lista de correos</a></li>
<li><a href="https://t.me/python_docs_es">Canal de Télegram</a></li>
<li><a href="https://github.com/PyCampES/python-docs-es">Repositorio GitHub</a></li>
</ul>
17 changes: 16 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,22 @@

os.system('mkdir -p cpython/locales/es/')
os.system('ln -nfs `pwd` cpython/locales/es/LC_MESSAGES')
os.system('ln -nfs `pwd`/CONTRIBUTING.rst cpython/Doc/CONTRIBUTING.rst')


# Override all the files from ``.overrides`` directory
import glob
for root, dirs, files in os.walk('.overrides'):
for fname in files:
if fname == 'README.rst' and root == '.overrides':
continue
destroot = root.replace('.overrides', '').lstrip('/')
outputdir = os.path.join(
'cpython',
'Doc',
destroot,
fname,
)
os.system(f'ln -nfs `pwd`/{root}/{fname} {outputdir}')

gettext_compact = False
locale_dirs = ['../locales', 'cpython/locales'] # relative to the sourcedir
Expand Down