Why
Deep Learning is a fast-growing field with too many models(papers), methods, algorithms and applications. It’s easy to forget what you’ve learned or mix things up if you don’t take notes. And documentation is a very good way to collect knowledge, organize notes and share thinking about deep learning. That’s why I choose to build a documentation with Sphinx, Github and ReadtheDocs.
What
This is my Deep Learning Notes documentation, very welcome to visit and share your thoughts through Github fork of the project.
How
Actually, I met many errors(from powershell and ReadtheDocs platform) during building this website. So here I want to show you the simplest way:
- Install Sphinx through pip.
- (better to do)create a new environment for your project using conda.
conda create -n myenv python=3.7 # choose your own environment name and python version conda activate myenv
- install the library
#if you're in China, because of Great Firewall, use "pip install sphinx -i https://pypi.tuna.tsinghua.edu.cn/simple/" instead. pip install sphinx
- (better to do)create a new environment for your project using conda.
- Start a project
sphinx-quickstart
You will be asked several questions to finish the initialization:
Separate source and build directories (y/n) [n]: y Project name: your_project_name Author name(s): your name Project version: 1.0.0 Project language [en]:en
-
Create a rst file called “hello.rst” under source directory. Write as follows (actually, this is the rst grammer you must know):
This is a Title =============== Subject Subtitle ---------------- Lists can be unnumbered like: * Item Foo * Item Bar Words can have *emphasis in italics* or be **bold** and you can define code samples with back quotes, like when you talk about a command: ``sudo`` gives you super user powers!
- Add a Table of Contents in the index page
Contents: .. toctree:: :maxdepth: 2 :numbered: hello
- Build the html files
make html
Then we can see there are two new directories under build directory— doctrees and html. Now you can just open the html files to see what your website is like.
- Upload your project to Github
- Create a new public repository on your Github
- Connect your local project with this repository
# be sure you're already in the project root directory git init git branch -M main git remote add origin git@github.com:yourgithubaccount/yourrepositoryname.git git add . git commit -m "init" git push origin main
- Connect your Github with ReadtheDocs
- Sign up ReadtheDocs(click) by “Sign up with Github” and authorize it.
- click “import a project”
- choose a repository from you github repository list
- click next, then build
- Dalaaa! Now you have your documentation that you can edit locally, push to Github and build on ReadtheDocs.