diff --git a/.gitignore b/.gitignore index 5fcb3c9..71b18c8 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ package.json node_modules **/*.quarto_ipynb + +docs/doc-repo.json \ No newline at end of file diff --git a/_quarto.yml b/_quarto.yml index be470f6..2ce3d99 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -2,6 +2,10 @@ project: type: website preview: port: 4200 + resources: + - docs/** + pre-render: + - scripts/build_doc_repo.py website: favicon: assets/img/logos/apex_icon_blue.svg @@ -114,6 +118,7 @@ website: - href: interoperability/algohostingenv.md - href: interoperability/geospatial_explorer.qmd - href: interoperability/businessmodel.md + - href: docs/overview.md format: html: diff --git a/css/components/_datatable.scss b/css/components/_datatable.scss new file mode 100644 index 0000000..0b39482 --- /dev/null +++ b/css/components/_datatable.scss @@ -0,0 +1,11 @@ +#docTable { + margin-top: 1rem; +} + +#docTable_length { + margin-bottom: 1rem; +} + +#docTable_info { + margin-top: 1rem; +} \ No newline at end of file diff --git a/css/custom.scss b/css/custom.scss index fccdbd8..22678ec 100644 --- a/css/custom.scss +++ b/css/custom.scss @@ -18,6 +18,7 @@ @import "./components/headings"; @import "./components/references"; @import "./components/listings"; +@import "./components/datatable"; /*-- scss:rules --*/ @@ -57,4 +58,4 @@ url("./assets/fonts/NotesEsa-BoldItalic.woff2") format("woff2"), url("./assets/fonts/NotesEsa-BoldItalic.woff") format("woff"); font-display: swap; -} +} \ No newline at end of file diff --git a/docs/apex/APEx_D01_PMP_Project Management Plan_3.1.pdf b/docs/apex/APEx_D01_PMP_Project Management Plan_3.1.pdf new file mode 100644 index 0000000..3a0e2b0 Binary files /dev/null and b/docs/apex/APEx_D01_PMP_Project Management Plan_3.1.pdf differ diff --git a/docs/apex/APEx_D01_PMP_Project Management Plan_3.1.yml b/docs/apex/APEx_D01_PMP_Project Management Plan_3.1.yml new file mode 100644 index 0000000..085d28c --- /dev/null +++ b/docs/apex/APEx_D01_PMP_Project Management Plan_3.1.yml @@ -0,0 +1,4 @@ +project: Application Propagation Environments +title: Project Management Plan +tags: + - Project Management Plan \ No newline at end of file diff --git a/docs/apex/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.pdf b/docs/apex/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.pdf new file mode 100644 index 0000000..65d69e1 Binary files /dev/null and b/docs/apex/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.pdf differ diff --git a/docs/apex/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.yml b/docs/apex/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.yml new file mode 100644 index 0000000..1d8277f --- /dev/null +++ b/docs/apex/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.yml @@ -0,0 +1,2 @@ +project: Application Propagation Environments +title: Interoperability and Compliance Guidelines \ No newline at end of file diff --git a/docs/apex/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.pdf b/docs/apex/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.pdf new file mode 100644 index 0000000..b96a2db Binary files /dev/null and b/docs/apex/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.pdf differ diff --git a/docs/apex/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.yml b/docs/apex/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.yml new file mode 100644 index 0000000..461a745 --- /dev/null +++ b/docs/apex/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.yml @@ -0,0 +1,2 @@ +project: Application Propagation Environments +title: Instantiation Services & Specifications \ No newline at end of file diff --git a/docs/overview.md b/docs/overview.md new file mode 100644 index 0000000..a1fabc1 --- /dev/null +++ b/docs/overview.md @@ -0,0 +1,182 @@ +--- +title: "Document Repository" +format: html +--- +```{=html} + + + + + + + +
+
+
+

Projects

+
+
+
+ +
+

+ + + + + +
TitleFile
+
+
+ + + + +``` diff --git a/docs/test/APEx_D01_PMP_Project Management Plan_3.1.pdf b/docs/test/APEx_D01_PMP_Project Management Plan_3.1.pdf new file mode 100644 index 0000000..3a0e2b0 Binary files /dev/null and b/docs/test/APEx_D01_PMP_Project Management Plan_3.1.pdf differ diff --git a/docs/test/APEx_D01_PMP_Project Management Plan_3.1.yml b/docs/test/APEx_D01_PMP_Project Management Plan_3.1.yml new file mode 100644 index 0000000..714a689 --- /dev/null +++ b/docs/test/APEx_D01_PMP_Project Management Plan_3.1.yml @@ -0,0 +1,4 @@ +project: Test +title: TEST Project Management Plan +tags: + - Project Management Plan diff --git a/docs/test/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.pdf b/docs/test/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.pdf new file mode 100644 index 0000000..65d69e1 Binary files /dev/null and b/docs/test/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.pdf differ diff --git a/docs/test/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.yml b/docs/test/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.yml new file mode 100644 index 0000000..a222c0b --- /dev/null +++ b/docs/test/APEx_D09_ICG_Interoperability and Compliance Guidelines_3.1.yml @@ -0,0 +1,2 @@ +project: Test +title: TEST Interoperability and Compliance Guidelines diff --git a/docs/test/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.pdf b/docs/test/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.pdf new file mode 100644 index 0000000..b96a2db Binary files /dev/null and b/docs/test/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.pdf differ diff --git a/docs/test/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.yml b/docs/test/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.yml new file mode 100644 index 0000000..b71345b --- /dev/null +++ b/docs/test/APEx_D11_ISS_APEx Instantiation Services & Specifications_2.1.yml @@ -0,0 +1,2 @@ +project: Test +title: TEST Instantiation Services & Specifications diff --git a/scripts/build_doc_repo.py b/scripts/build_doc_repo.py new file mode 100644 index 0000000..5048a83 --- /dev/null +++ b/scripts/build_doc_repo.py @@ -0,0 +1,90 @@ +""" +Build an index of PDFs under ROOT , merging metadata from +sidecar YAML files with the same basename (e.g. Report.pdf -> Report.yml). +Writes doc-index.json +""" + +from pathlib import Path +import json +import sys +import argparse +import logging +import yaml + +logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") + + +def load_yaml(yaml_path: Path): + try: + with yaml_path.open("r", encoding="utf-8") as f: + data = yaml.safe_load(f) or {} + if not isinstance(data, dict): + logging.warning( + "YAML %s did not contain a mapping (object). Ignoring.", yaml_path + ) + return {} + return data + except Exception as e: + logging.warning("Failed to read YAML %s: %s", yaml_path, e) + return {} + + +def build_index(root: Path): + items = [] + if not root.exists(): + logging.error("Root folder %s does not exist.", root) + return items + + for project_dir in sorted(p for p in root.iterdir() if p.is_dir()): + project_name = project_dir.name + for pdf_path in sorted(project_dir.glob("*.pdf")): + basename = pdf_path.stem # filename without suffix + yaml_path = pdf_path.with_suffix(".yml") + + if not yaml_path.exists(): + logging.warning( + f"YAML configuration does not exist for {basename}, skipping" + ) + + else: + metadata = load_yaml(yaml_path) + + item = {} + item["project"] = metadata.get("project", project_name) + item["title"] = metadata.get("title", basename) + item["filename"] = pdf_path.name + item["path"] = "/" + str(pdf_path.as_posix()) + tags = metadata.get("tags") + if isinstance(tags, str): + item["tags"] = [t.strip() for t in tags.split(",") if t.strip()] + elif isinstance(tags, (list, tuple)): + item["tags"] = list(tags) + else: + item["tags"] = None + items.append(item) + logging.info(f"Indexed: {item['path']}") + + return items + + +def write_json(items, out_path: Path): + with out_path.open("w", encoding="utf-8") as f: + json.dump(items, f, indent=2, ensure_ascii=False) + logging.info("Wrote %d items to %s", len(items), out_path) + + +def main(argv): + p = argparse.ArgumentParser() + p.add_argument( + "--root", "-r", default="docs", help="Root folder containing project subfolders" + ) + p.add_argument("--out", "-o", default="docs/doc-repo.json", help="Output JSON file") + args = p.parse_args(argv) + + root = Path(args.root) + items = build_index(root) + write_json(items, Path(args.out)) + + +if __name__ == "__main__": + main(sys.argv[1:])