Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow generating the documentation for DOSDP patterns #1121

Merged
merged 4 commits into from
Nov 2, 2024

Conversation

gouttegd
Copy link
Contributor

@gouttegd gouttegd commented Nov 1, 2024

This PR adds new targets to the standard Makefile (dosdp-docs-X, where X is the name of a DOSDP pipeline) to automatically generate the documentations for DOSDP patterns.

This is inspired by CL’s custom pattern_docs target, except there here are using DOSDPTools and its (seemingly undocumented) docs subcommand rather than DOSDP, because DOSDP seems to crash on way too many patterns.

The various DOSDP_* variables (DOSDP_OWL_FILES_X, DOSDP_TERM_FILES_X,
and DOSDP_PATTERN_NAMES_X, where 'X' is the name of a DOSDP pipeline)
are defined in a inefficient way, as each definition calls the
`wildcard` function to get the list of TSV files from the filesystem,
which is a costly operation.

Here we simplify those definitions by:

(1) first defining DOSDP_TSV_FILES_X by calling `wildcard` (no changes);
(2) derive DOSDP_PATTERN_NAMES_X directly from DOSDP_TSV_FILES_X;
(3) derive DOSDP_OWL_FILES_X directly from DOSDP_PATTERN_NAMES_X;
(4) derive DOSDP_TERM_FILES_X directly from DOSDP_PATTERN_NAMES_X.

This way, we only query the filesystem once to get the list of the TSV
files. All other values can be inferred from that list.
For each pipeline pattern X, we add a `dosdp-docs-X` phony target in the
Makefile to automatically generate the documentation for the patterns of
that pipeline.

This uses the (undocumented ?) `docs` subcommand of DOSDPTools.

Generated documentation is written to a new top-level directory called
`docs`, in one subdirectory `patterns/X` for each pipeline.

closes #1101
@gouttegd gouttegd self-assigned this Nov 1, 2024
@gouttegd gouttegd requested a review from matentzn November 1, 2024 19:00
matentzn
matentzn previously approved these changes Nov 2, 2024
Add a new configuration option `repo_url` to indicate the online
location of the public repository. This is intended for repositories
that are not hosted on GitHub, where the use of github_org is therefore
inappropriate.

When generating DOSDP documentation pages, the generated documentation
will point to `repo_url` if it is present, then fallback to
`https://github.com/github_org/repo` if `github_org` is set.
@gouttegd gouttegd requested a review from matentzn November 2, 2024 14:31
Copy link
Contributor

@matentzn matentzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicccce!!

@gouttegd gouttegd merged commit 855625a into master Nov 2, 2024
1 check passed
@gouttegd gouttegd deleted the generate-dosdp-docs branch November 2, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The ODK should take care of generating documentation for DOSDP patterns
2 participants