Skip to content

Commit

Permalink
update doc test for asdf.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
alphasentaurii committed Dec 4, 2024
1 parent 4f7dd98 commit 8df39f7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/source/asdf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ ASDF Schema

.. _asdf-schema-1.1.0:

.. asdf-autoschemas::
:schema_root: ../../resources/schemas
:standard_prefix: stsci.edu/asdf

asdf-schema-1.1.0
.. asdf-schema::
:schema_root: ../../resources/schemas/stsci.edu
:standard_prefix:

asdf/asdf-schema-1.1.0
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ def add_schemas(path, prefix, result):
if len(possible_id) > 0:
result.append(f"{prefix}{possible_id}")
i += 1
elif lines[i].startswith(".. asdf-schema::"):
i += 1
while i < len(lines) and (lines[i].strip() == "" or lines[i].startswith(" ")):
if ":schema_root:" in lines[i].strip() or ":standard_prefix:" in lines[i].strip():
i += 1
else:
possible_id = lines[i].strip()
if len(possible_id) > 0:
possible_id = possible_id.split("/")[-1]
result.append(f"{prefix}{possible_id}")
i += 1
else:
i += 1

Expand Down

0 comments on commit 8df39f7

Please sign in to comment.