l-v-yonsama / db-notebook

Javascript, SQL creation and execution, Markdown, etc. can be centrally managed in a file format called a notebook.
MIT License
9 stars 0 forks source link

[FEATURE REQUEST] Export dbn to HTML file for easy sharing #5

Closed lundeen-bryan closed 2 months ago

lundeen-bryan commented 3 months ago

I noticed that the underlying content of a dbn is JSON. So I went to ChatGPT and asked it to create a custom GPT that would convert the JSON as a notebook to an HTML file that I could share with others. This way I can show them the markdown text for the problem statement I am facing, and my code as the solution. It is a relatively simple design and I wanted to share it with you as an example.

Custom GPT: https://chatgpt.com/g/g-zrzKsq7Ua-json-to-html-notebook

Gist Preview: https://htmlpreview.github.io/?https://gist.githubusercontent.com/lundeen-bryan/1bbc8d7009896ad1d207bc5969c6c9c7/raw/3e047a8f05d76d835cc1f5285e020194a897673e/CTE.html

The steps are:

  1. change the extension of the .dbn file to a .json file.
  2. Go to the custom GPT called "JSON to HTML notebook"
  3. Paste the JSON text into the prompt and hit ENTER
  4. copy the code from the output into an HTML file
  5. Share the HTML file on GitHub or another platform that renders the file

So, I'm not sure how complex it would be to turn this into a built-in feature of the extention. I just wanted to share this solution and suggest it as a built-in feature. If it's possible, I know it would take a long time to write the code, but it seems like a very good idea.

Use cases:

Let me know if you think it's a good idea and if it's possible.

Thank you so much!

l-v-yonsama commented 3 months ago

I'm not sure if the final file format will be HTML or PDF, but I will consider the ability to share the contents of the notebook with people who do not have VSCODE.

lundeen-bryan commented 3 months ago

Thank you

l-v-yonsama commented 3 months ago

In v0.5.0, I added "Output Database Notebook to HTML file". See here https://raw.githubusercontent.com/l-v-yonsama/db-notebook/main/docs/images/16_html_report.gif Please try it after upgrading.

lundeen-bryan commented 3 months ago

Wow, I like your design of the HTML notebook with a scroll-to-top button and a TOC. That's very helpful. And it renders the text in each cell so it's easy to see. I also like that you chose HTML as the output because I know just enough to figure it out if I ever need to make changes. This is so helpful. I hope they recognize how good you are at your work. Have a good week!

lundeen-bryan commented 2 months ago

Feature tested and works without error. Closing issue.