Skip to content

Commit

Permalink
More nits
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerzr committed Jun 7, 2023
1 parent 3e983c4 commit 5ee7ff6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/nbquarto/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,14 @@ def process_notebook(notebook_location: str, config_file: str, output_folder: st
# so add it to the markdown string
content = cell["source"].split("\n")
title = content[0]
# Generate quarto metadata
md.append(f'---\ntitle: {title.replace("#", "").lstrip().rstrip()}\njupyter: python3\n---\n')
md.append("\n".join(content[1:]))
# Add a newline to separate cells
md.append("\n")

# Depending on the cell's type, handle it differently
elif cell["cell_type"] == "markdown":
md.extend(cell["source"].split("\n"))

elif cell["cell_type"] == "raw":
# Currently, just treat raw cells like markdown cells
elif cell["cell_type"] in ("markdown", "raw"):
md.extend(cell["source"].split("\n"))

elif cell["cell_type"] == "code":
Expand Down

0 comments on commit 5ee7ff6

Please sign in to comment.