From d39851ec03073ef57c3f40e102b829e582e465cf Mon Sep 17 00:00:00 2001 From: Joshua Klein Date: Sat, 16 Nov 2024 22:33:56 -0500 Subject: [PATCH] update config and docstring --- docs/_static/img/.gitignore | 1 + docs/conf.py | 15 +++++++++++++-- docs/implementations/python/api.rst | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 docs/_static/img/.gitignore diff --git a/docs/_static/img/.gitignore b/docs/_static/img/.gitignore new file mode 100644 index 0000000..3981834 --- /dev/null +++ b/docs/_static/img/.gitignore @@ -0,0 +1 @@ +lark-railroad-diagram.svg \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 5aa2081..d7ede39 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,6 +9,11 @@ import pandas as pd +CONF_DIR = Path(__file__).parent +STATIC_DIR = CONF_DIR / '_static' +IMG_DIR = STATIC_DIR / 'img' + + def get_jsonschema_docs(input_json, output_markdown): """Generate markdown documentation from a JSON schema.""" parser = jsonschema2md.Parser() @@ -41,10 +46,16 @@ def get_reference_molecules_md(input_json, output_markdown): "../specification/reference_data/reference_molecules.md" ) -if not Path("_static/img/lark-railroad-diagram.svg").exists(): +if not STATIC_DIR.exists(): + STATIC_DIR.mkdir(exist_ok=True) + +if not IMG_DIR.exists(): + IMG_DIR.mkdir(exist_ok=True) + +if not (IMG_DIR / "lark-railroad-diagram.svg").exists(): shutil.copy( "../specification/grammars/schema_images/Annotation.svg", - "_static/img/lark-railroad-diagram.svg" + (IMG_DIR / "lark-railroad-diagram.svg"), ) diff --git a/docs/implementations/python/api.rst b/docs/implementations/python/api.rst index 860b993..e5ba96d 100644 --- a/docs/implementations/python/api.rst +++ b/docs/implementations/python/api.rst @@ -12,3 +12,6 @@ Python API .. autofunction:: parse_annotation Parse a string into one or more :class:`IonAnnotationBase` instances. + + See :meth:`AnnotationStringParser.__call__` for more details about the implementation + and actual arguments. \ No newline at end of file