Bookmark this to keep an eye on my project updates!
:information_source: Click HERE to open Presenter View
ReadtheDocs simplifies software documentation by automating building, versioning, and hosting of your docs for you;
Link: Read the Docs Homepage
Link: Sphinx Python Documenation Generator
Link: reStructuredText
Upon install Python3, type the comments below in your comment prompt to check whether `Python` and `Pip` has been installed correctly:
python --version
pip --version
install `Sphinx` using `pip` tool using the code:
pip install sphinx
Executes the comment below in a specific folder to further create a sphinx docs project:
sphinx-quickstart
Opens Cygwin and install `make` & `chere` packages accordingly. Runs `make html` in the same file path, then you will find your first readthedoc documentation.
Upon installed python3, type the following command in Terminal to check if it is installed correctly:
python3 --version
If it is correctly installed, you will be able to see the version number of your python3.
To install Homebrew to MacOS, type the following command in your Terminal
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
You can download Xcode from Apple store. If Command Line Tools is not installed together with your Xcode, you can use the following command to install Command Line Tools:
xcode-select --install
After the installation of all required softwares, install `Sphinx` using `brew` tool using the command:
brew install sphinx-doc
At the end of the installation, you may see a warning that shows sphinx is “keg-only” and is not by default put in your `PATH`, use the follwoing command to link it to `PATH`:
brew link sphinx-doc --force
Use below command to check if you have successfully installed `sphinx`:
sphinx-build --version
Execute the following command in a specific folder to create a sphinx docs project:
sphinx-quickstart
Open Terminal in the same folder that contains makefile, and execute the command `make html`, now you will find your first ReadtheDocs documentation in /build/html/index.html
Please edit in index.rst
and make html
You will find the expected html view in the build
folder, and under the html
folder, you can see there is a file name called index.html
.
Passsing
means the process is successful while a Failing
means that something have gone wrong or any setup is wrong during the process.
View Docs
Now your file is fully uploaded into ReadtheDocs server and can be viewed by everyone that knows your hyperlink.
.pot portable object template
.po portable object files (for translator)
.mo machine object files
Step 1.
pip install sphinx-intl
Step 2. Add configuration to conf.py
locale_dirs = ['locale/'] #path is example but not recommended.
gettext_compact = False #optional
Step 3. Extract translatable messages into pot files.
$ make gettext
.pot
files will be placed in the build/gettext
directory.Step 4. Generate .po
files
We will use the pot files generated in the above step.
$ sphinx-intl update -p build/gettext -l zh_CN -l zh_TW
Once completed, the generated .po
files will be placed in the below directories:
../locale/zh_CN/LC_MESSAGES/
../locale/zh_TW/LC_MESSAGES/
Step 5. Translate .po
files
Step 6 Build translated document
make -e SPHINXOPTS-" -D language='zh_TW'html