Skip to content

Commit

Permalink
update config and docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
mobiusklein committed Nov 17, 2024
1 parent 237bc25 commit d39851e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/_static/img/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lark-railroad-diagram.svg
15 changes: 13 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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"),
)


Expand Down
3 changes: 3 additions & 0 deletions docs/implementations/python/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit d39851e

Please sign in to comment.