Skip to content

Commit

Permalink
Merge pull request #16 from zivy/updateProtocolsConversion
Browse files Browse the repository at this point in the history
Modified the protocols_csv_2_md.py to accomodate kramdown issue.
  • Loading branch information
zivy authored Apr 12, 2023
2 parents 3bfdeb7 + 98faa28 commit 6262510
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ def _description_2_md(description):
num_spaces = num_spaces + 1
if num_spaces == num_words:
break
return f"<details ><summary>{description[0:i]}...</summary><p>{description}</p></details>"
# Because the html code will go inside a markdown table and we are using kramdown,
# default markdown renderer for jekyll, we need to wrap it with nomarkdown to tell kramdown to leave it
# as is.
return (
"{::nomarkdown}"
+ f"<details ><summary>{description[0:i]}...</summary><p>{description}</p></details>"
+ "{:/}"
)


def protocols_csv_to_md(template_file_path, csv_file_path, output_dir):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class TestProtocolsCSV2MD(BaseTest):
(
"protocols.md.in",
"protocols.csv",
"b48e11fb1917376b9998c14608bfef7d",
"ae265c655481dc8cabf540f82b804b71",
)
],
)
Expand Down

0 comments on commit 6262510

Please sign in to comment.