This document describes contribution process for OpenToonz User Manual.
-
Install Git for Windows
Git Bash will be installed accordingly.
-
Install Python
Command Prompt will work if Python is added to PATH.
-
(Optional) Install Anaconda
Confirmed working with Anaconda distribution Python 2.7 version. Python 3.6 version should work, I guess.
Anaconda Prompt will be installed accordingly. Command Prompt will work if the Python is added to PATH on installation.
-
fork
OpenToonz to your GitHub account fromopentoonz/opentoonz_docs
.- click the
fork
button at the top-right corner of https://github.com/opentoonz/opentoonz_docs
- click the
-
clone
the repository. (w/ Git Bash)-
Launch Git Bash.
-
Move to the folder you would like to make your local repository.
$ cd C:path/to/the/parent/folder
-
Clone
$ git clone https://github.com/your_github_account_name/opentoonz_docs.git
The folder
opentoonz_docs
will be created under the current folder. -
Move into opentoonz local repository
$ cd opentoonz_docs
-
Set the
upstream
, in order to synchronize your repository with the latest version.$ git remote add upstream https://github.com/opentoonz/opentoonz_docs.git
-
-
Prepare Python and Sphinx (w/ Command Prompt)
-
Install Sphinx
$ pip install sphinx sphinx-autobuild
-
Install
sphinx_rtd_theme
theme$ pip install sphinx_rtd_theme
-
Install internationalization(i18n) package
$ pip install sphinx-intl
-
-
Try building the HTML (w/ Command Prompt)
-
Move to
opentoonz_docs
folder usingcd
command -
Make HTML
$ make html
The result HTML files will be generated under
build/html/
-
First , launch Git Bash and move to opentoonz_docs
folder using cd
command
-
Synchronize the local repository with the latest code from
upstream
(w/ Git Bash)-
Change the current branch to
master
$ git checkout master
-
Obtain the latest code
$ git pull upstream master
-
Synchronize your
origin
with the local repository$ git push origin master
-
-
Checkout the branch and modify the code (w/ Git Bash)
-
$ git checkout -b your-branch-name
your-branch-name
is a name of your modifications, say,typo_fix
,how_to_install
or something. -
Fix codes (see the Editing reStructuredText below).
-
$ git status
can show a list of files you have modified -
$ gitk
can show details of modification -
$ make html
to check the generated HTML locally
-
-
Commit (w/ Git Bash)
-
Do one of the followings:
-
$ git status
to see the files you have modified.$ git add path/to/file
for all the files you would like to register in the commit$ git commit -m "some_good_commit_message"
-
Use
-a
option to commit all the modified files$ git commit -a -m "some_good_commit_message"
-
-
-
Fix conflict (w/ Git Bash)
-
In order to make sure your modification will not conflict with the current upstream,
pull
the latest changes form themaster
branch of the upstream.git pull upstream master
orgit pull --rebase upstream master
-
If there is conflicts, message will appear like;
CONFLICT (content): Merge conflict in path/to/conflicted/file.rst
-
Use
$ git status
to list conflicted files -
Open the conflicted file and resolve the coflicted part (appears as below) manually
path/to/conflicted/file.rst <<<<<<< HEAD CHANGES_IN_YOUR_COMMIT ======= CHANGES_IN_UPSTREAM >>>>>>> [commit id]
-
$ git add path/to/conflicted/file.rst
for all conflicted files -
$ git commit
-
-
Push your branch and make a pull request (w/ Git Bash)
-
$ git push origin your-branch-name
-
Make a pull request
Access https://github.com/opentoonz/opentoonz_docs and click Pull Request Button.
-
Also you can refer to the git documentation.
Please see Sphinx/reStructuredText documentation for details.
- In order to avoid getting mess, please put image files in the folder with the same name as .rst file.
For example, if you add an image to
source/installing_opentoonz.rst
, then make a folder namedinstalling_opentoonz
undersource/_static
and store the image file in it (i.e.source/_static/installing_opentoonz/some_image.png
).
-
On Anaconda Prompt, move to
opentoonz_docs
folder usingcd
command -
Generate the message catalogue (.pot)
$ make gettext
.pot files will be generated in
build/gettext
. -
Copy .pot to your language's locale folder
$ sphinx-intl update -p build/gettext -l ja
Please replace
ja
by the language you would like to translate. See the sphinx manual for supported languages.Then .po files will be generated in
source/locale/ja/LC_MESSAGES
. -
To update .po to the latest version, do the same commands again;
$ make gettext $ sphinx-intl update -p build/gettext -l ja
-
Translate the document in .po files
In .po files, there are list of messages like:
#: ../../source/index.rst:7 msgid "OpenToonz User Manual" msgstr ""
Input translation into
msgstr
like as follows:#: ../../source/index.rst:7 msgid "OpenToonz User Manual" msgstr "OpenToonz ユーザマニュアル"
Note: Make sure to maintain the syntax of reStructuredText in your translated text.
-
Generate the translated-version HTML locally
$ make SPHINXOPTS="-D language='ja'" html
or$ set SPHINXOPTS=-D language=ja $ make.bat html
-
NOTE : To include the translation to the User Manual, some settings in Read the Docs is needed. Please let me (@shun-iwasawa) know when you firstly merge your language translation.