在sphinx中描述json文档结构

sphinx-jsondomain的Python项目详细描述


https://img.shields.io/pypi/v/sphinx-jsondomain.svg?maxAge=2592000https://readthedocs.org/projects/sphinx-jsondomain/badge/?version=latesthttps://travis-ci.org/dave-shawley/sphinx-jsondomain.svg?branch=master 我很惊讶,当我想去的时候,这个地方已经不存在了。 在使用sphinxcontrib-httpdomain之外描述json文档 记录我的一个api。此扩展简化了对结构化 使用新Sphinx domain的json文档。

..json:object:: Github User

   What Github's API thinks a user looks like.

   :property string login:the user's login:property integer id:Github assigned unique user identifier:property string avatar_url:url to user's selected avatar image
      or the empty string
   :property string gravatar_url:url to the user's gravatar image
      or the empty string

这将格式化为一些漂亮的东西并引用 :json:object:`github user`按预期工作。见online examples 为了更好地了解什么是可能的。

快速启动

安装sphinx和sphinx-jsondomain包:

$ python3 -mvenv env
$ env/bin/pip install -q sphinx sphinx-jsondomain

设置sphinx文档根目录并构建文档集:

$ env/bin/sphinx-quickstart -p my-project -r 0.0 -v 0.0.0 \
> -a 'Dave Shawley <daveshawley@gmail.com>' --quiet docs
$ env/bin/sphinx-build -b html docs build/sphinx/html

现在,在docs/conf.py中找到extensions定义并添加 sphinxjsondomain结束。将json:object指令添加到 docs/index.rst并再次运行sphinx build以查看结果。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java JPanel不会对键绑定做出反应   当时间大于零时,不得在UI线程上调用java Await   JTextArea的java线程安全。追加   Java用户输入的字和行计数器   java以spreedsheat格式将数据保存到文件中   java构造函数的意义是什么?   java findViewById返回null,尽管组件的ID存在   java如何向按钮添加图像   java如何中断ExecutorService的线程   java如何将属性(例如枚举)绑定到不同类型的组件属性(例如每个枚举的映像)?   随机森林分类器的java实现   html使用java连接到一个站点并发布,HTTP状态代码200   从类访问属性时发生java编译错误   Java自动填充ArrayList,搜索更好的选项