-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continuation of adding translations to theme
This builds on top of #405, addressing the outstanding review feedback. It: * Moves workflow to our standard Transifex workflow, drops recommendation for running babel commands by hand * Configures Transifex * Moves all of the commands needed to maintain translations into Grunt * Sets up docs for translation testing * Covers installation in docs better * Drops recommendation for installation through submodules * Drops superfluous translation documentation * Cleans up some of the code * Updates a lot of related documentation * Updates files at Transifex and brings in full translations back to the translation files in the repository
- Loading branch information
Showing
20 changed files
with
539 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
*.pyc | ||
*.egg-info | ||
*.egg | ||
*.mo | ||
*build/ | ||
.tox | ||
.coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[sphinx-rtd-theme.sphinx-rtd-theme] | ||
file_filter = sphinx_rtd_theme/locale/<lang>/LC_MESSAGES/sphinx.po | ||
source_file = sphinx_rtd_theme/locale/en/LC_MESSAGES/sphinx.po | ||
source_lang = en | ||
|
||
[main] | ||
host = https://www.transifex.com | ||
type = PO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,113 @@ | ||
************ | ||
Contributing | ||
************ | ||
|
||
*********************************** | ||
Contributing or modifying the theme | ||
*********************************** | ||
This project follows the Read the Docs :doc:`code of conduct | ||
<rtd:code-of-conduct>`. If you are not familiar with our code of conduct policy, | ||
take a minute to read the policy before starting with your first contribution. | ||
|
||
The sphinx_rtd_theme is primarily a sass_ project that requires a few other sass libraries. I'm | ||
using bower_ to manage these dependencies and sass_ to build the css. The good news is | ||
I have a very nice set of grunt_ operations that will not only load these dependencies, but watch | ||
for changes, rebuild the sphinx demo docs and build a distributable version of the theme. | ||
The bad news is this means you'll need to set up your environment similar to that | ||
of a front-end developer (vs. that of a python developer). That means installing node and ruby. | ||
|
||
.. seealso:: | ||
Modifying the theme | ||
=================== | ||
|
||
If you are unsure of appropriate actions to take while interacting with our | ||
community please read our :doc:`Code of Conduct <rtd:code-of-conduct>`. | ||
The styles for this theme use SASS_ and a custom CSS framework called Wyrm_. We | ||
use Bower_ to manage these dependencies and SASS_ to build the CSS. Grunt_ is | ||
used to watch for changes, rebuild the static assets, and rebuild the Sphinx | ||
demo documentation. | ||
|
||
.. note:: | ||
The installation of Ruby and Node is outside the scope of this | ||
documentation. You will need both in order to make changes to this theme. | ||
|
||
Set up your environment | ||
======================= | ||
----------------------- | ||
|
||
#. Install sphinx_ into a virtual environment. | ||
#. Install Sphinx_ and documentation build dependencies. | ||
|
||
.. code:: bash | ||
pip install sphinx sphinxcontrib-httpdomain | ||
pip install -r docs/requirements.txt | ||
#. Install sass. | ||
#. Install SASS. | ||
|
||
.. code:: bash | ||
gem install sass | ||
#. Install node, bower, grunt, and theme dependencies. | ||
#. Install Bower, Grunt, and theme dependencies locally. | ||
|
||
.. code:: bash | ||
# Install node | ||
brew install node | ||
# Install bower and grunt | ||
npm install -g bower grunt-cli | ||
# Now that everything is installed, let's install the theme dependencies. | ||
npm install | ||
Now that our environment is set up, make sure you're in your virtual environment, go to | ||
this repository in your terminal and run grunt: | ||
Making changes | ||
-------------- | ||
|
||
Changes to the theme can be compiled and tested with the default Grunt task: | ||
|
||
.. code:: | ||
grunt | ||
This default task will do the following **very cool things that make it worth the trouble**: | ||
This default task will do the following: | ||
|
||
#. Install and update any Bower dependencies. | ||
#. Build the static CSS from SASS source files. | ||
#. Build the demo documentation. | ||
#. Watch for changes to the SASS files and documentation and rebuild everything | ||
on any detected changes. | ||
|
||
Alternatively, if you don't need to watch the files, Grunt can be called with | ||
the same task used for releases: | ||
|
||
.. code:: bash | ||
grunt build | ||
.. _Bower: http://www.bower.io | ||
.. _SASS: http://www.sass-lang.com | ||
.. _Wyrm: http://www.github.com/snide/wyrm/ | ||
.. _Grunt: http://www.gruntjs.com | ||
.. _Sphinx: http://www.sphinx-doc.org/en/stable/ | ||
|
||
Translations | ||
============ | ||
|
||
Translations are managed using `Transifex`_. You can join any of the existing | ||
language teams or request a new language is added to the project. For more | ||
information on our translation standards, see our docs on | ||
:doc:`rtd:development/i18n` | ||
|
||
Periodically, core team should update the translation files outside our normal | ||
releases. Someone from the core team, with write access to Transifex, should run | ||
the following: | ||
|
||
.. code:: bash | ||
#. Install and update any bower dependencies. | ||
#. Run sphinx and build new docs. | ||
#. Watch for changes to the sass files and build css from the changes. | ||
#. Rebuild the sphinx docs anytime it notices a change to ``.rst``, ``.html``, ``.js`` | ||
or ``.css`` files. | ||
grunt i18n | ||
.. _bower: http://www.bower.io | ||
.. _sass: http://www.sass-lang.com | ||
.. _wyrm: http://www.github.com/snide/wyrm/ | ||
.. _grunt: http://www.gruntjs.com | ||
.. _node: http://www.nodejs.com | ||
.. _sphinx: http://www.sphinx-doc.org/en/stable/ | ||
This will extract new messages, upload the messages to Transifex, and will | ||
update our local translation files. Changes can be checked in to a branch and | ||
put up for review. | ||
|
||
.. _Transifex: https://www.transifex.com/readthedocs/sphinx-rtd-theme | ||
|
||
Releasing the Theme | ||
Releasing the theme | ||
=================== | ||
|
||
When you release a new version, | ||
you should do the following: | ||
To release a new version of the theme, core team will take the following steps: | ||
|
||
#. Bump the version in ``sphinx_rtd_theme/__init__.py``, ``bower.json`` and ``package.json`` -- | ||
we try to follow `semver <http://semver.org/>`_, so be careful with breaking changes. | ||
#. Update the changelog (``docs/changelog.rst``) with the version information. | ||
#. Run a ``grunt build`` to rebuild all the theme assets. | ||
#. Run ``grunt build`` to rebuild all the theme assets. | ||
#. Run ``grunt i18n`` to compile new translation files and update Transifex | ||
#. Commit that change. | ||
#. Tag the release in git: ``git tag $NEW_VERSION``. | ||
#. Push the tag to GitHub: ``git push --tags origin``. | ||
#. Upload the package to PyPI: | ||
|
||
.. code:: bash | ||
$ rm -rf dist/ | ||
$ python setup.py sdist bdist_wheel | ||
$ twine upload --sign --identity security@readthedocs.org dist/* | ||
rm -rf dist/ | ||
python setup.py sdist bdist_wheel | ||
twine upload --sign --identity security@readthedocs.org dist/* |
Oops, something went wrong.