diff --git a/myst.yml b/myst.yml index f4482dfc..866a0b72 100644 --- a/myst.yml +++ b/myst.yml @@ -98,7 +98,7 @@ project: - file: index.md - file: examples/index.md children: - - pattern: examples/**/*.md + - pattern: examples/*/*.md - file: schemas/index.md children: - pattern: schemas/*.md diff --git a/pre_build.py b/pre_build.py index aa7af6cd..a969ec79 100644 --- a/pre_build.py +++ b/pre_build.py @@ -4,6 +4,7 @@ from pathlib import Path import jsonc as json import logging +from _version import __version__ # Suppress warnings from json-schema-for-humans about unresolvable URLs logging.getLogger().setLevel(logging.ERROR) @@ -51,7 +52,7 @@ def build_json_examples(): for json_file in json_files: print(f'Processing {json_file}...') - crossref = f"examples:{category}:{Path(json_file).stem}" + crossref = f"{__version__}-examples-{category}-{Path(json_file).stem}" index_md += f"- [{Path(json_file).stem}](#{crossref})\n" json_file_name = Path(json_file).stem @@ -118,7 +119,7 @@ def build_json_schemas(): # insert mySt cross-reference at top of markdown files with open(output_path_md, 'r', encoding='utf-8') as md_file: md_content = md_file.read() - crossref = f"schemas:{Path(schema_file).stem}" + crossref = f"{__version__}-schemas-{Path(schema_file).stem}" md_content = f"""--- author: "" ---