File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,12 @@ def example_block_tabbed(dp: SsvcDecisionPoint, indent=4) -> str:
6969 return "\n " .join (rows )
7070
7171
72- def example_block (dp : SsvcDecisionPoint , indent = 4 ) -> str :
72+ def example_block (
73+ dp : SsvcDecisionPoint , indent : int = 4 , include_json : bool = True
74+ ) -> str :
7375 """Given a decision point, return a markdown block that contains an example of the decision point."""
7476
75- indent_ = " " * 4
77+ indent_ = " " * indent
7678 rows = []
7779 rows .append (f'!!! note "{ dp .name } v{ dp .version } "' )
7880 rows .append ("" )
@@ -81,12 +83,11 @@ def example_block(dp: SsvcDecisionPoint, indent=4) -> str:
8183 rows .append (indent_ + row )
8284 rows .append ("" )
8385
84- rows .append (
85- indent_ + f'??? example "{ dp .name } v{ dp .version } JSON Example"'
86- )
87- rows .append ("" )
88- for row in json_example (dp , indent = 4 ).splitlines ():
89- rows .append (indent_ + row )
86+ if include_json :
87+ rows .append (indent_ + f'??? example "{ dp .name } v{ dp .version } JSON Example"' )
88+ rows .append ("" )
89+ for row in json_example (dp , indent = 4 ).splitlines ():
90+ rows .append (indent_ + row )
9091
9192 return "\n " .join (rows )
9293
You can’t perform that action at this time.
0 commit comments