diff --git a/.gitignore b/.gitignore index cd1f2c9439..3398763c1c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.mo +/_build/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..f5517ef7c9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,5 @@ +[submodule "cpython"] + path = cpython + url = https://github.com/python/cpython.git + branch = 3.7 + shallow = true diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000000..f333eb794b --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,19 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: conf.py + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.7 + install: + - requirements: requirements.txt + +submodules: + include: all diff --git a/conf.py b/conf.py new file mode 100644 index 0000000000..b5edfd203d --- /dev/null +++ b/conf.py @@ -0,0 +1,42 @@ +# Sphinx configuration file. +# +# - import original configurations from cpython/Doc/conf.py +# - append the path considering the cpython submodule is at ./cpython +# - create the symbolic links under ./cpython/locale/es/LC_MESSAGES +# - make the build to work under Read the Docs +# +# The git submodule was created using this Stack Overflow answer +# to fetch only the commit that I needed and avoid clonning the whole history +# https://stackoverflow.com/a/27445058 +# +# This can be built locally using `sphinx-build` by running +# +# $ sphinx-build -b html -n -d _build/doctrees -D language=es . _build/html + +import sys, os, time +sys.path.append(os.path.abspath('cpython/Doc/tools/extensions')) +sys.path.append(os.path.abspath('cpython/Doc/includes')) + +# Import all the Sphinx settings from cpython +sys.path.append(os.path.abspath('cpython/Doc')) +from conf import * + +version = '3.7' +release = '3.7.7' + +project = 'Python en EspaƱol' +copyright = '2001-%s, Python Software Foundation' % time.strftime('%Y') + +html_theme_path = ['cpython/Doc/tools'] +templates_path = ['cpython/Doc/tools/templates'] +html_static_path = ['cpython/Doc/tools/static'] + +os.system('mkdir -p cpython/locales/es/') +os.system('ln -nfs `pwd` cpython/locales/es/LC_MESSAGES') + +gettext_compact = False +locale_dirs = ['../locales', 'cpython/locales'] # relative to the sourcedir + +def setup(app): + # Change the sourcedir programmatically because Read the Docs always call it with `.` + app.srcdir = 'cpython/Doc' diff --git a/cpython b/cpython new file mode 160000 index 0000000000..48ef06b626 --- /dev/null +++ b/cpython @@ -0,0 +1 @@ +Subproject commit 48ef06b62682c19b7860dcf5d9d610e589a49840 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000..7cec904a1c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +Sphinx==2.2.0 +setuptools +blurb +python-docs-theme