|
| 1 | +# Sphinx configuration file. |
| 2 | +# |
| 3 | +# - import original configurations from cpython/Doc/conf.py |
| 4 | +# - append the path considering the cpython submodule is at ./cpython |
| 5 | +# - create the symbolic links under ./cpython/locale/es/LC_MESSAGES |
| 6 | +# - make the build to work under Read the Docs |
| 7 | +# |
| 8 | +# The git submodule was created using this Stack Overflow answer |
| 9 | +# to fetch only the commit that I needed and avoid clonning the whole history |
| 10 | +# https://stackoverflow.com/a/27445058 |
| 11 | +# |
| 12 | +# This can be built locally using `sphinx-build` by running |
| 13 | +# |
| 14 | +# $ sphinx-build -b html -n -d _build/doctrees -D language=es . _build/html |
| 15 | + |
| 16 | +import sys, os, time |
| 17 | +sys.path.append(os.path.abspath('cpython/Doc/tools/extensions')) |
| 18 | +sys.path.append(os.path.abspath('cpython/Doc/includes')) |
| 19 | + |
| 20 | +# Import all the Sphinx settings from cpython |
| 21 | +sys.path.append(os.path.abspath('cpython/Doc')) |
| 22 | +from conf import * |
| 23 | + |
| 24 | +version = '3.7' |
| 25 | +release = '3.7.7' |
| 26 | + |
| 27 | +project = 'Python en Español' |
| 28 | +copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y') |
| 29 | + |
| 30 | +html_theme_path = ['cpython/Doc/tools'] |
| 31 | +templates_path = ['cpython/Doc/tools/templates'] |
| 32 | +html_static_path = ['cpython/Doc/tools/static'] |
| 33 | + |
| 34 | +os.system('mkdir -p cpython/locales/es/') |
| 35 | +os.system('ln -nfs `pwd` cpython/locales/es/LC_MESSAGES') |
| 36 | + |
| 37 | +gettext_compact = False |
| 38 | +locale_dirs = ['../locales', 'cpython/locales'] # relative to the sourcedir |
| 39 | + |
| 40 | +def setup(app): |
| 41 | + # Change the sourcedir programmatically because Read the Docs always call it with `.` |
| 42 | + app.srcdir = 'cpython/Doc' |
0 commit comments