Skip to content

Commit

Permalink
Add support for markdown gallery files (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jun 21, 2024
1 parent 26f1817 commit e76757c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nbsite/gallery/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ def generate_pyodide_markdown(
if ftype == 'notebook':
nb_md = convert_notebook_to_md(filename, directive)
md_file.write(nb_md)
elif extension == 'md':
with open(filename, encoding='utf-8') as md_src_file:
md_file.write('\n'.join(md_src_file.readlines()[1:]))
else:
with open(filename, encoding='utf-8') as script:
md_file.write(f'```{directive}\n{script.read()}```')
Expand Down

0 comments on commit e76757c

Please sign in to comment.