forked from dave-shawley/sphinx-jsondomain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See #1
- Loading branch information
Xander Harris
committed
Feb 3, 2023
1 parent
7a4fa3f
commit 0455dc2
Showing
8 changed files
with
110 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
|
||
[dev-packages] | ||
jupyter = "*" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Sphinx JSON Domain | ||
|
||
 | ||
 | ||
 | ||
|
||
> I was surprised that this didn't already exist somewhere when I wanted to | ||
> describe a JSON document outside of using [sphinxcontrib-httpdomain](https://pythonhosted.org/sphinxcontrib-httpdomain/) | ||
> to document one of my APIs. This extension simplifies describing structured | ||
> JSON documents using a new [Sphinx domain](http://www.sphinx-doc.org/en/stable/domains.html#what-is-a-domain). | ||
> | ||
> -- [Dave Shawley](mailto:[email protected]) | ||
```rst | ||
.. 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 | ||
``` | ||
|
||
This will format to something pretty and make references to the JSON object work as expected. | ||
|
||
```rst | ||
:json:object:`Github User` | ||
``` | ||
|
||
See the [online examples](https://sphinx-jsondomain.readthedocs.io/en/latest/examples.html) | ||
for a better idea of what is possible. | ||
|
||
## Quick Start | ||
|
||
Install sphinx and the ``sphinx-jsondomain`` package with [Pipenv](https://pipenv.pypa.io/en/latest/index.html). | ||
|
||
```sh | ||
pipenv install | ||
pipenv shell | ||
``` | ||
|
||
### Documentation | ||
|
||
1. Set up the sphinx documentation root and build your documentation set. | ||
|
||
```sh | ||
sphinx-quickstart | ||
sphinx-build docs docs/_build/html | ||
``` | ||
|
||
2. Add `sphinxjsondomain` to the list of extensions in your configuration file. | ||
3. Add an object directive to one of your source files and run `sphinx-build` again to see the results. | ||
|
||
```rst | ||
.. json:object:: GitHub | ||
``` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env python | ||
|
||
import os.path | ||
from pathlib import Path | ||
|
||
import setuptools | ||
|
||
|
@@ -18,13 +18,20 @@ def read_requirements(name): | |
requirements.append(line) | ||
return requirements | ||
|
||
def long_description(): | ||
"""Return the contents of the readme.""" | ||
r_path=Path('readme.md') | ||
with r_path.open('r', encoding='utf-8') as r_fh: | ||
r_str = r_fh.read() | ||
return r_str | ||
|
||
|
||
setuptools.setup( | ||
name='sphinx-jsondomain', | ||
version='0.0.3', | ||
url='https://github.com/dave-shawley/sphinx-jsondomain', | ||
url='https://github.com/edwardtheharris/sphinx-jsondomain', | ||
description='Describe JSON document structures in sphinx', | ||
long_description='\n'+open('README.rst').read(), | ||
long_description=long_description(), | ||
license='BSD', | ||
author='Dave Shawley', | ||
author_email='[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.3 |