https://github.com/asdf-format/sphinx-asdf
Plugin for sphinx for generating documentation from ASDF schemas
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
3 of 12 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.2%) to scientific vocabulary
Keywords from Contributors
advanced-scientific-data-format
asdf
astronomy
astropy
jwst
astrophysics
photometry
source-detection
astropy-affiliated
drizzle
Last synced: 10 months ago
·
JSON representation
Repository
Plugin for sphinx for generating documentation from ASDF schemas
Basic Info
Statistics
- Stars: 2
- Watchers: 6
- Forks: 9
- Open Issues: 8
- Releases: 13
Created over 7 years ago
· Last pushed 10 months ago
Metadata Files
Readme
Contributing
License
README.rst
sphinx-asdf
===========
.. image:: https://github.com/asdf-format/sphinx-asdf/workflows/CI/badge.svg
:target: https://github.com/asdf-format/sphinx-asdf/actions
:alt: CI Status
``sphinx-asdf`` is a plugin for `sphinx`_ that enables generation of
documentation from `ASDF`_ schemas.
Installation
------------
To install the latest release on PyPI::
$ pip install sphinx-asdf
The latest development version is available from the ``main`` branch `on
github`_. To clone the project:
::
$ git clone https://github.com/asdf-format/sphinx-asdf
To install:
::
$ cd sphinx-asdf
$ pip install .
To install in `development mode`_::
$ pip install -e .
Usage
-----
The ``sphinx-asdf`` plugin provides two `sphinx directives`_,
``asdf-autoschemas`` and ``asdf-schema``.
The plugin also provides several configuration variables:
* ``asdf_schema_path``
* ``asdf_schema_standard_prefix``
* ``asdf_schema_reference_mappings``
Basic Example
*************
Consider a package with the following layout as an example::
mypackage/
setup.py
mypackage/
schemas/
example.org/
custom/
foo/
a.yaml
b.yaml
c.yaml
bar/
x.yaml
y.yaml
z.yaml
...
docs/
conf.py
schemas.rst
This package provides schemas with tags that all have the prefix of
``tag:example.org/custom``. The layout of the schema directory reflects this
naming convention. We wish to provide documentation for all of our schemas.
First, we will add configuration variables to our ``docs/conf.py`` file:
.. code-block:: python
# This variable indicates the top-level directory containing schemas.
# The path is relative to the location of conf.py in the package
asdf_schema_path = "../mypackage/schemas"
# This variable indicates the standard prefix that is common to all schemas
# provided by the package.
asdf_schema_standard_prefix = "example.org/custom"
The variables set in the ``docs/conf.py`` file indicate to ``sphinx-asdf``
where to locate the schemas based on the names we will use in the
documentation.
Now, we use the ``asdf-autoschemas`` directive in ``docs/schemas.rst`` to
create a table of contents for the schema documentation::
.. asdf-autoschemas::
foo/a
foo/b
foo/c
bar/x
bar/y
bar/z
Each item in the list represents the name of a schema to be included in the
documents. The names are **not** paths to the schema files and should not
include the file extension. Resolution of the names to actual schema files is
handled by the ``asdf_schema_path`` and ``asdf_schema_standard_prefix``
configuration variables.
We can also use multiple ``asdf-autoschemas`` directives if we wish::
These schemas are part of foo:
.. asdf-autoschemas::
foo/a
foo/b
foo/c
And these schemas are part of bar:
.. asdf-autoschemas::
bar/x
bar/y
bar/z
When ``sphinx-build`` runs, the ``sphinx-asdf`` plugin will automatically
generate schema documentation for each of the schemas listed in each
``asdf-autoschemas`` directive. In the documentation, each ``asdf-autoschemas``
directive will be replaced with a table of contents that contains links to each
of the listed schema documents.
.. _Directive settings:
Directive settings
******************
While the ``asdf_schema_path`` and ``asdf_schema_standard_prefix``
configuration variables set global schema resolution settings, it is also
possible to set per-directive settings. For example, we could have done the
following::
.. asdf-autoschemas::
:schema_root: ../mypackage/schemas
:standard_prefix: example.org/custom
This would eliminate the need to set global settings. It also allows any
global settings to be overridden on a per-directive basis.
.. note::
The ``:schema_root:`` argument requires a path that is relative to
the ``sphinx`` configuration file.
External References
*******************
Schema references to other schemas in the same package are automatically
converted to links in the generated documentation. (This assumes that all of
the references correspond to schemas that are explicitly generated by an
``asdf-autoschemas`` directive). However, sometimes it is necessary to resolve
references to schemas in other packages. The ``asdf_schema_reference_mapping``
configuration variable is provided for this purpose. It enables a mapping
between references that begin with a particular prefix to a URL indicating
another package's documentation.
For example, to enable references to the ASDF Standard documentation to be
resolved as links, include the following in your ``docs/conf.py`` file:
.. code-block:: python
asdf_schema_reference_mappings = [
(
"tag:stsci.edu:asdf",
"http://asdf-standard.readthedocs.io/en/latest/generated/stsci.edu/asdf/",
),
]
Inline documentation
********************
The ``asdf-autoschemas`` directive automatically generates individual schema
documentation pages and creates a table of contents. However, sometimes it may
be useful to include schema documentation inline inside another document. The
``asdf-schema`` directive is provided for this purpose.
Using the package described above as an example, the ``asdf-schema`` directive
can be used to document a single schema inside of another document::
.. asdf-schema::
foo/a
The behavior of the ``asdf-schema`` directive is also governed by the
``asdf_schema_path`` and ``asdf_schema_standard_prefix`` global configuration
variables. The directive also accepts the same ``:schema_root:`` and
``:standard_prefix:`` arguments as ``asdf-autoschemas`` (see `Directive
settings`_ above) for per-directive configuration.
Contributing
------------
We welcome feedback and contributions to the project. Contributions of
code, documentation, or general feedback are all appreciated. Please
follow the `contributing guidelines `__ to submit an
issue or a pull request.
We strive to provide a welcoming community to all of our users by
abiding to the `Code of Conduct `__.
.. Links
.. _ASDF: https://asdf-standard.readthedocs.io/en/latest
.. _sphinx: https://www.sphinx-doc.org/en/master
.. _on github: https://github.com/asdf-format/sphinx-asdf
.. _development mode: https://packaging.python.org/tutorials/distributing-packages/#working-in-development-mode
.. _sphinx directives: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html
.. _table of contents: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#table-of-contents
Owner
- Name: asdf-format
- Login: asdf-format
- Kind: organization
- Repositories: 19
- Profile: https://github.com/asdf-format
GitHub Events
Total
- Issues event: 2
- Delete event: 2
- Push event: 4
- Pull request review event: 5
- Pull request event: 12
- Create event: 5
Last Year
- Issues event: 2
- Delete event: 2
- Push event: 4
- Pull request review event: 5
- Pull request event: 12
- Create event: 5
Committers
Last synced: about 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Daniel D'Avella | d****a@s****u | 87 |
| Daniel D'Avella | d****a@g****m | 45 |
| pre-commit-ci[bot] | 6****]@u****m | 20 |
| William Jamieson | w****n@s****u | 14 |
| Ed Slavich | e****h@s****u | 6 |
| Cagtay Fabry | 4****y@u****m | 5 |
| Pey Lian Lim | 2****m@u****m | 3 |
| Brett | b****m@g****m | 2 |
| Michael Droettboom | m****m@g****m | 2 |
| Ken MacDonald | 6****i@u****m | 1 |
| Nadia Dencheva | n****a@g****m | 1 |
| Thomas Robitaille | t****e@g****m | 1 |
Committer Domains (Top 20 + Academic)
stsci.edu: 3
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 18
- Total pull requests: 94
- Average time to close issues: over 1 year
- Average time to close pull requests: 19 days
- Total issue authors: 8
- Total pull request authors: 11
- Average comments per issue: 0.89
- Average comments per pull request: 0.4
- Merged pull requests: 85
- Bot issues: 0
- Bot pull requests: 35
Past Year
- Issues: 3
- Pull requests: 13
- Average time to close issues: 12 days
- Average time to close pull requests: 11 days
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.33
- Average comments per pull request: 0.0
- Merged pull requests: 11
- Bot issues: 0
- Bot pull requests: 3
Top Authors
Issue Authors
- braingram (9)
- eslavich (3)
- CagtayFabry (1)
- saimn (1)
- WilliamJamieson (1)
- zacharyburnett (1)
- drdavella (1)
- jdavies-st (1)
Pull Request Authors
- braingram (38)
- pre-commit-ci[bot] (32)
- drdavella (11)
- WilliamJamieson (6)
- dependabot[bot] (6)
- CagtayFabry (5)
- eslavich (2)
- kmacdonald-stsci (1)
- astrofrog (1)
- nden (1)
- saimn (1)
Top Labels
Issue Labels
bug (1)
Pull Request Labels
dependencies (6)
github_actions (6)
bug (1)
Packages
- Total packages: 2
-
Total downloads:
- pypi 3,068 last-month
-
Total dependent packages: 15
(may contain duplicates) -
Total dependent repositories: 8
(may contain duplicates) - Total versions: 22
- Total maintainers: 5
pypi.org: sphinx-asdf
Sphinx plugin for generating documentation from ASDF schemas
- Documentation: https://sphinx-asdf.readthedocs.io/
- License: bsd-3-clause
-
Latest release: 0.3.0
published about 1 year ago
Rankings
Dependent packages count: 0.8%
Dependent repos count: 5.2%
Downloads: 6.4%
Average: 10.3%
Forks count: 11.4%
Stargazers count: 27.8%
Maintainers (5)
Last synced:
10 months ago
conda-forge.org: sphinx-asdf
- Homepage: https://github.com/asdf-format/sphinx-asdf
- License: BSD-3-Clause
-
Latest release: 0.1.4
published almost 4 years ago
Rankings
Dependent repos count: 34.0%
Forks count: 43.4%
Average: 47.2%
Dependent packages count: 51.2%
Stargazers count: 60.1%
Last synced:
10 months ago
Dependencies
.github/workflows/sphinx_asdf_ci.yml
actions
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v1 composite
.github/workflows/publish-to-pypi.yml
actions
pyproject.toml
pypi
setup.py
pypi