danijar / handout

Turn Python scripts into handouts with Markdown and figures
Apache License 2.0
2.01k stars 106 forks source link

doc.show() will execute _generate method and rewrites index.html? #41

Closed syahrulhamdani closed 4 years ago

syahrulhamdani commented 4 years ago

Hi, all. I want to make sure how handout renders the scripts. It looks like doc.show() will execute _generate method, append all the blocks, then render all of them, right? And then when doc.show() gets called again, it will re-render the whole blocks except with more lineno?

With this behavior, if someone writes more lines of script, maybe with more figures or videos, does it affect the time we need to run the script?

danijar commented 4 years ago

Yes, the doc gets updated on every doc.show(). This lets you see the progress of a long running script. It doesn't take a lot of time to render the HTML since the media elements are only written to disk once.