-
I honestly don't know if this may be more of a So, it would then be possible to automate the documentation for pipelines.... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Yaml only allows single line comments with Nothing stops you from declaring your own key though - just make sure it doesn't clash with a step-group name. Notice the block scalar style _docstring: |
Several lines of text,
with some "quotes" of various 'types',
and also a blank line:
steps:
- name: pypyr.steps.echo
in:
echoMe: hello It is then up to you to parse that out of the pipeline when you generate your help docs. import pypyr.loaders.file as pypyr_file_loader
pipe_def = pypyr_file_loader.get_pipeline_definition("pipeline_name", Path.cwd())
print(pipe_def.pipeline['_docstring']) |
Beta Was this translation helpful? Give feedback.
-
Not so incidentally, something that's been brewing on the back-burner for ages now is introducing a metadata sort of section, like: _meta:
author: firstname lastname
help: |
long help text here
follow what docstring format you like
some_other_field: whatever
steps:
- name: pypyr.steps.echo
in:
echoMe: hello And then expose that maybe via $ pypyr my-pipeline --help
long help text here
follow what docstring format you like
# or maybe even
$ pypyr my-pipeline --meta
author: first name lastname
some_other_field: whatever I remain ambivalent about whether this would be truly useful or not, which is why I've not prioritised it. But I could well be convinced... This would effectively introduce a "reserved word" for the |
Beta Was this translation helpful? Give feedback.
Yaml only allows single line comments with
#
.Nothing stops you from declaring your own key though - just make sure it doesn't clash with a step-group name. Notice the block scalar style
|
indicator for multi-line strings keeping\n
:It is then up to you to parse that out of the pipeline when you generate your help docs.