Skip to content

Commit

Permalink
Merge pull request #14 from JuliaPluto/html_report_path
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Aug 10, 2024
2 parents a493a79 + f8638c0 commit ea15687
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/PlutoPages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ function generate(;
input_dir::String,
output_dir::String,
cache_dir::String,
html_report_path::Union{Nothing,String}=tempname()*"_generation_report.html",
)
app = run_plutopages_notebook(; input_dir, output_dir, cache_dir, run_server=false)
notebook = fetch(app.notebook_task)
Expand All @@ -178,16 +179,22 @@ function generate(;
for c in notebook.cells
if c.errored
bad = true
@error("Cell errored", c.code, c.output.body)
@error("Cell errored", c.code, c.cell_id, Text(c.output.body))
end
end
if bad
error("Error in notebook")

if html_report_path !== nothing
write(html_report_path, Pluto.generate_html(notebook))
@info "PlutoPages: 📄 HTML report written to:\n\n$(html_report_path)\n"
end

@info "PlutoPages: cleaning up..."
shutdown(app)

if bad
error("Error in notebook, see previous logs. $(html_report_path === nothing ? "You can debug this better with an HTML report, check out the `html_report_path` kwarg." : "Read more in the HTML report:\n$(html_report_path)\n")")
end

return output_dir
end

Expand Down

2 comments on commit ea15687

@fonsp
Copy link
Member Author

@fonsp fonsp commented on ea15687 Aug 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: Version 0.1.3 already exists

Please sign in to comment.