Skip to content

Commit

Permalink
v2.0 docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
dogversioning committed Feb 27, 2024
1 parent 10e197a commit 12832b5
Show file tree
Hide file tree
Showing 12 changed files with 1,176 additions and 133 deletions.
20 changes: 20 additions & 0 deletions cumulus_library/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,22 @@ def generate_study_sql(
parser=self.db.parser(),
)

def generate_study_markdown(
self,
target: pathlib.Path,
) -> None:
"""Materializes study sql from templates
:param target: A path to the study directory
"""
studyparser = study_parser.StudyManifestParser(target)
studyparser.run_generate_markdown(
self.cursor,
self.schema_name,
verbose=self.verbose,
parser=self.db.parser(),
)


def get_abs_posix_path(path: str) -> pathlib.Path:
"""Convenience method for handling abs vs rel paths"""
Expand Down Expand Up @@ -373,6 +389,10 @@ def run_cli(args: dict):
elif args["action"] == "generate-sql":
for target in args["target"]:
runner.generate_study_sql(study_dict[target])

elif args["action"] == "generate-md":
for target in args["target"]:
runner.generate_study_markdown(study_dict[target])
finally:
db_backend.close()

Expand Down
11 changes: 11 additions & 0 deletions cumulus_library/cli_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,15 @@ def get_parser() -> argparse.ArgumentParser:
add_target_argument(generate)
add_study_dir_argument(generate)
add_db_config(generate)

# Generate markdown tables for documentation
markdown = actions.add_parser(
"generate-md", help="Generates markdown tables for study documentation"
)
add_target_argument(markdown)
add_study_dir_argument(markdown)
add_data_path_argument(markdown)
add_db_config(markdown)
add_verbose_argument(markdown)

return parser
Loading

0 comments on commit 12832b5

Please sign in to comment.