-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Continuation of adding translations to theme #778
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
Closed
Closed
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
caa3373
Continuation of adding translations to theme
agjohnson 3eef5eb
Change code bash to console
agjohnson 69c1e09
Update po file comments, tune installation requirements, alter i18n s…
agjohnson f7a7cd7
Update build directions, better install mechanism, NL locale
agjohnson d216dcf
Fix local path insertion of package, fix more docs
agjohnson 715c0be
Add commands into setup.py and regenerate translations
agjohnson ec77048
Another test
agjohnson 16e36af
Another test
agjohnson 0e0ccff
Replace with requirements file, RTD doesn't handle these patterns well.
agjohnson 5052143
Undoing test fixes
agjohnson ad31326
Some final cleanup
agjohnson 1ef6b5b
Undo gruntfile changes
agjohnson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,5 +1,8 @@ | ||
| build: | ||
| image: latest | ||
| version: 2 | ||
| python: | ||
| version: 3.6 | ||
| requirements_file: docs/requirements.txt | ||
| install: | ||
| - method: pip | ||
| path: . | ||
| extra_requirements: | ||
| - docs |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||
| .. code:: console | ||
|
|
||
| pip install sphinx sphinxcontrib-httpdomain | ||
| pip install -e '.[docs]' | ||
|
|
||
| #. Install sass. | ||
| #. Install SASS. | ||
|
|
||
| .. code:: bash | ||
| .. code:: console | ||
|
|
||
| gem install sass | ||
|
|
||
| #. Install node, bower, grunt, and theme dependencies. | ||
|
|
||
| .. code:: bash | ||
|
|
||
| # Install node | ||
| brew install node | ||
| #. Install Bower, Grunt, and theme dependencies locally. | ||
|
|
||
| # Install bower and grunt | ||
| npm install -g bower grunt-cli | ||
| .. code:: console | ||
|
|
||
| # 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 | ||
| -------------- | ||
|
|
||
| .. code:: | ||
| Changes to the theme can be compiled and tested with the default Grunt task: | ||
|
|
||
| .. code:: console | ||
|
|
||
| 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:: console | ||
|
|
||
| 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:: console | ||
|
|
||
| #. 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. | ||
| npm run 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 ``npm run 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 | ||
| .. code:: console | ||
|
|
||
| $ rm -rf dist/ | ||
| $ python setup.py sdist bdist_wheel | ||
| $ twine upload --sign --identity [email protected] dist/* | ||
| rm -rf dist/ | ||
| python setup.py sdist bdist_wheel | ||
| twine upload --sign --identity [email protected] dist/* |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.