Skip to content

Commit

Permalink
docs: Use envvar directive to attach semantics
Browse files Browse the repository at this point in the history
Among other things, this makes the var names linkable with

    :envvar:`…`

and indexes them not just individually but also collectively under
"Environment variables" so the index includes a single list of all
documented vars.

When I originally wrote this page, I didn't yet know about the envvar
directive and role.  I've since used it extensively in Nextstrain CLI's
documentation, though.
  • Loading branch information
tsibley committed Aug 20, 2024
1 parent 988380c commit 68fcdaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion augur/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def write_json(data, file, indent=(None if os.environ.get("AUGUR_MINIFY_JSON") e
file
file path or handle to write to
indent : int or None, optional
JSON indentation level. Default is `None` if the environment variable `AUGUR_MINIFY_JSON`
JSON indentation level. Default is `None` if the environment variable :envvar:`AUGUR_MINIFY_JSON`
is truthy, else 1
include_version : bool, optional
Include the augur version. Default: `True`.
Expand Down
6 changes: 4 additions & 2 deletions docs/usage/envvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ Environment variables
Augur's behaviour can be globally modified by the values of some specific environment variables.
These can be especially useful in the context of an entire pipeline or workflow which uses Augur, as the environment variables can be set once for all Augur commands at the start of the pipeline.

``AUGUR_MINIFY_JSON``
.. envvar:: AUGUR_MINIFY_JSON

Boolean.
If set to a non-empty value, all JSON output produced by Augur will be minified by omitting indentation and newlines.

Minifying the JSON will substantially reduce file sizes, which is helpful for large, deeply nested trees.

``AUGUR_RECURSION_LIMIT``
.. envvar:: AUGUR_RECURSION_LIMIT

Integer.
If set to a non-empty value, the Python recursion limit will be set to the given value early in Augur's execution by calling :func:`sys.setrecursionlimit`.

Expand Down

0 comments on commit 68fcdaf

Please sign in to comment.