You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.3 kB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # 快速入门 fastNLP 文档编写
  2. 本教程为 fastNLP 文档编写者创建,文档编写者包括合作开发人员和文档维护人员。您在一般情况下属于前者,
  3. 只需要了解整个框架的部分内容即可。
  4. ## 合作开发人员
  5. FastNLP的文档使用基于[reStructuredText标记语言](http://docutils.sourceforge.net/rst.html)的
  6. [Sphinx](http://sphinx.pocoo.org/)工具生成,由[Read the Docs](https://readthedocs.org/)网站自动维护生成。
  7. 一般开发者只要编写符合reStructuredText语法规范的文档并通过[PR](https://help.github.com/en/articles/about-pull-requests),
  8. 就可以为fastNLP的文档贡献一份力量。
  9. 如果你想在本地编译文档并进行大段文档的编写,您需要安装Sphinx工具以及sphinx-rtd-theme主题:
  10. ```bash
  11. fastNLP/docs> pip install sphinx
  12. fastNLP/docs> pip install sphinx-rtd-theme
  13. ```
  14. 然后在本目录下执行 `make dev` 命令。该命令只支持Linux和MacOS系统,期望看到如下输出:
  15. ```bash
  16. fastNLP/docs> make dev
  17. rm -rf build/html && make html && make server
  18. Running Sphinx v1.5.6
  19. making output directory...
  20. ......
  21. Build finished. The HTML pages are in build/html.
  22. cd build/html && python -m http.server
  23. Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
  24. ```
  25. 现在您浏览器访问 http://localhost:8000/ 查看文档。如果你在远程服务器尚进行工作,则访问地址为 http://{服务器的ip地址}:8000/ 。
  26. 但您必须保证服务器的8000端口是开放的。如果您的电脑或远程服务器的8000端口被占用,程序会顺延使用8001、8002……等端口。
  27. 当你结束访问时,您可以使用Control(Ctrl) + C 来结束进程。
  28. 我们在[这里](./source/user/example.rst)列举了fastNLP文档经常用到的reStructuredText语法(网页查看请结合Raw模式),
  29. 您可以通过阅读它进行快速上手。FastNLP大部分的文档都是写在代码中通过Sphinx工具进行抽取生成的,
  30. ## 文档维护人员
  31. 文档维护人员需要了解 Makefile 中全部命令的含义,并了解到目前的文档结构
  32. 是在 sphinx-apidoc 自动抽取的基础上进行手动修改得到的。
  33. 文档维护人员应进一步提升整个框架的自动化程度,并监督合作开发人员不要破坏文档项目的整体结构。