Skip to content

Commit

Permalink
Remove unused main function from start_slidev.py and enhance output m…
Browse files Browse the repository at this point in the history
…essage in jupyter_to_markdown function
  • Loading branch information
Alex Al-Saffar committed Feb 15, 2025
1 parent 073b4bf commit b4841e5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
6 changes: 0 additions & 6 deletions scripts/python/start_slidev.py

This file was deleted.

5 changes: 1 addition & 4 deletions src/machineconfig/scripts/python/start_slidev.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

def jupyter_to_markdown(file: P):
op_dir = file.parent.joinpath("presentation")

print("📝 Converting Jupyter notebook to markdown...")

# https://nbconvert.readthedocs.io/en/latest/nbconvert_library.html
Expand All @@ -40,14 +39,12 @@ def jupyter_to_markdown(file: P):
# cmd = f"jupyter nbconvert --to pdf --no-prompt --no-input --output-dir {op_dir} {file}"
# Terminal().run(cmd, shell="powershell").print()


op_file = op_dir.joinpath("slides_raw.md")
slide_separator = '\n\n---\n\n'
md = op_file.read_text().replace('\n\n\n\n', slide_separator)
md = slide_separator.join([item for item in md.split(slide_separator) if bool(item.strip())]) # remove empty slides.
op_file.with_name("slides.md").write_text(md)

print("✅ Conversion completed.")
print("✅ Conversion completed, check the results @", op_dir)

return op_dir

Expand Down

0 comments on commit b4841e5

Please sign in to comment.