diff --git a/Makefile b/Makefile index df2372d2e4..fc2a65f183 100644 --- a/Makefile +++ b/Makefile @@ -168,7 +168,9 @@ $(DOCDIR): # Compile static Markdown files, images, and JavaScript scripts, into a documentation website. # -# Then, use `refgraph` (part of `refscan`) to generate a diagram (i.e. a graph that depicts +# Then, copy some additional schema-derived files into the documentation website file tree. +# +# Finally, use `refgraph` (part of `refscan`) to generate a diagram (i.e. a graph that depicts # inter-collection relationships) in the documentation website's file tree. gendoc: $(DOCDIR) prefixmaps # Copy all documentation files to the documentation directory @@ -181,6 +183,21 @@ gendoc: $(DOCDIR) prefixmaps # Create directory for JavaScript files and copy them mkdir -p $(DOCDIR)/javascripts $(RUN) cp $(SRC)/scripts/*.js $(DOCDIR)/javascripts/ + + # Copy additional schema-derived files into the documentation directory. + # + # Note: We use `[-f path]` to check whether the path leads to a file, and we use ` || true` so that — either way — + # the overall command still returns an exit code of `0` (i.e. "success") so GitHub Actions does not abort. + # This `gendoc` target depends upon files generated via the `all` target, and I think this target is sometimes + # being run after some of those things have been deleted. There is a make-based solution to this (i.e. + # identifying inter-target dependence), but that is more of a tangent than I want to take on this + # proof-of-concept branch focused on something else. + # + mkdir -p $(DOCDIR)/downloads + [ -f nmdc_schema/nmdc.schema.json ] && cp nmdc_schema/nmdc.schema.json $(DOCDIR)/downloads/nmdc.schema.json || true + [ -f nmdc_schema/nmdc_materialized_patterns.schema.json ] && cp nmdc_schema/nmdc_materialized_patterns.schema.json $(DOCDIR)/downloads/nmdc_materialized_patterns.schema.json || true + [ -f nmdc_schema/nmdc_materialized_patterns.yaml ] && cp nmdc_schema/nmdc_materialized_patterns.yaml $(DOCDIR)/downloads/nmdc_materialized_patterns.yaml || true + # Use `refgraph` to generate an interactive diagram within the compiled documentation website file tree. mkdir -p $(DOCDIR)/visualizations $(RUN) refgraph --schema nmdc_schema/nmdc_materialized_patterns.yaml --subject collection --graph $(DOCDIR)/visualizations/collection-graph.html diff --git a/mkdocs.yml b/mkdocs.yml index bac6728d33..3411b8d8df 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -33,6 +33,7 @@ nav: - Schema element deprecation guide: schema_element_deprecation_guide.md - v10 vs v11 (Berkeley schema) retrospective: v10-vs-v11-retrospective.md - Visualizations: visualizations.md + - Downloads: downloads.md site_url: https://microbiomedata.github.io/nmdc-schema diff --git a/src/docs/downloads.md b/src/docs/downloads.md new file mode 100644 index 0000000000..324aaea847 --- /dev/null +++ b/src/docs/downloads.md @@ -0,0 +1,5 @@ +# Downloads + +1. [`nmdc.schema.json`](downloads/nmdc.schema.json) +2. [`nmdc_materialized_patterns.schema.json`](downloads/nmdc_materialized_patterns.schema.json) +3. [`nmdc_materialized_patterns.yaml`](downloads/nmdc_materialized_patterns.yaml)