Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render Jupyter Notebooks #70

Merged
merged 28 commits into from
Jul 13, 2024
Merged

Conversation

jannis-baum
Copy link
Owner

@jannis-baum jannis-baum commented Jul 6, 2024

Close #55

@jannis-baum
Copy link
Owner Author

@tuurep this is also ready, let me know if you want to review it or if I should just merge it when the other PR is through :)

@tuurep
Copy link
Collaborator

tuurep commented Jul 7, 2024

Ah, cool. I can at least test this,

although not at this minute :D

Tomorrow if I can

@jannis-baum
Copy link
Owner Author

Awesome, thanks! And no rush at all!

I added a small Notebook to the repo in tests/notebook.ipynb to test the viewing. It's definitely not complete in terms of exhausting all features of the Notebook format but I also didn't want our repo to be 99.9% Jupyter Notebook code on GitHub haha which happens very quickly because of how the code distribution is computed and the fact that the Notebook format has Base64-encoded images, for example.

Anyways, I thought it might be nice to also add all the Markdown testing files that you have made in the past to that tests directory! Then we have everything in one place :)

@jannis-baum jannis-baum force-pushed the issue/55-render-jupyter-notebooks branch from c8c8054 to 03a5046 Compare July 8, 2024 07:13
@tuurep
Copy link
Collaborator

tuurep commented Jul 8, 2024

Anyways, I thought it might be nice to also add all the Markdown testing files that you have made in the past to that tests directory! Then we have everything in one place :)

Oh ok, I can try gathering those

Should they be as one long md file, as you're doing with the ipynb as well, as far as I can see?

@jannis-baum
Copy link
Owner Author

Thank you!

I don't mind, feel free to organize it how you see fit :)

@jannis-baum jannis-baum force-pushed the issue/55-render-jupyter-notebooks branch 9 times, most recently from 782ebcc to 01f6316 Compare July 11, 2024 12:41
@jannis-baum
Copy link
Owner Author

From my POV this is also ready, I would just add the Markdown testing file(s) :)

@jannis-baum jannis-baum force-pushed the issue/55-render-jupyter-notebooks branch from f0fd230 to cb9d588 Compare July 11, 2024 14:30
@tuurep
Copy link
Collaborator

tuurep commented Jul 11, 2024

Yeah!

I'll probably make a single .md file like:

Markdown test file

Use this file to try how vivify renders things

Lists

Foo

  • bar
  • bar
  • bar

Codeblocks

qux

Etc

Baz

With each markdown syntax that we know of

Will take 1-2 days

@jannis-baum
Copy link
Owner Author

Sounds great, thank you!

@tuurep
Copy link
Collaborator

tuurep commented Jul 12, 2024

Ok I have a markdown test file!

It might be a little messy but at least good for starters. Feedback/should the images be put in a folder or anything like that?

I took a very surface level look at your notebook rendering, looks good but I'd like to point out:

image

The overflow-x: scroll results in these pretty big, unnecessary scrollbars, maybe overflow-x: auto would be better?

image

@tuurep
Copy link
Collaborator

tuurep commented Jul 12, 2024

Btw when I get the CI-built vivify-linux.zip I have to unzip it twice, it first wants to extract another vivify-linux.zip from inside the vivify-linux.zip and asks me if I want to replace it 😂

$ unzip vivify-linux.zip
Archive:  vivify-linux.zip
replace vivify-linux.zip? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: vivify-linux.zip
$ unzip vivify-linux.zip
Archive:  vivify-linux.zip
  inflating: viv
  inflating: vivify-server

Could there be a redundant zipping step somewhere in the build?

(might just be that when downloading, it's zipped again)

@jannis-baum jannis-baum force-pushed the issue/55-render-jupyter-notebooks branch 2 times, most recently from a422e02 to 21928e0 Compare July 13, 2024 03:03
@jannis-baum
Copy link
Owner Author

Ok I have a markdown test file!

It might be a little messy but at least good for starters. Feedback/should the images be put in a folder or anything like that?

Awesome, thanks! Looks great! I split it into basic/extended and added KaTeX math, Graphviz/Dot and task lists. I hope with that we have everything Vivify can do in there.

@jannis-baum
Copy link
Owner Author

The overflow-x: scroll results in these pretty big, unnecessary scrollbars, maybe overflow-x: auto would be better?

Good spot! This doesn't happen in Safari, that's why I didn't see it. I changed it to auto

@jannis-baum
Copy link
Owner Author

Btw when I get the CI-built vivify-linux.zip I have to unzip it twice, it first wants to extract another vivify-linux.zip from inside the vivify-linux.zip and asks me if I want to replace it 😂

$ unzip vivify-linux.zip
Archive:  vivify-linux.zip
replace vivify-linux.zip? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: vivify-linux.zip
$ unzip vivify-linux.zip
Archive:  vivify-linux.zip
  inflating: viv
  inflating: vivify-server

Could there be a redundant zipping step somewhere in the build?

(might just be that when downloading, it's zipped again)

Ah, that's great you figured out what was going on here! The only time I tested the CI build I unzipped it with macOS Finder and I guess it has some recursive unzipping so I didn't realize.

Your suspicion was correct, seems like the upload-artifact action automatically zips: https://github.com/actions/upload-artifact?tab=readme-ov-file#zip-archives

Should be fixed now :)

@jannis-baum
Copy link
Owner Author

Thanks a lot for the reviewing, you spotted some important stuff! And also for the Markdown testing file of course! Great work

Let me know if everything is good now and then we can merge this

@jannis-baum jannis-baum force-pushed the issue/55-render-jupyter-notebooks branch from f7e6790 to 3ffbb88 Compare July 13, 2024 13:24
@tuurep
Copy link
Collaborator

tuurep commented Jul 13, 2024

I split it into basic/extended and added KaTeX math, Graphviz/Dot and task lists.

Nice, I forgot task list!

If we're going by these definitions of Extended Syntax:

https://www.markdownguide.org/extended-syntax/

Then this split is all over the place 😄 partly because of how I arranged stuff like code blocks and fenced code blocks under the same section etc

Now this extended syntax is in basic file:

  • table
  • fenced code block (triple backtic code block)
  • strikethrough
  • automatic URL linking

Are you sure it's worth to split?

Btw quite disturbing:

image

How the checkbox isn't aligned to the text. I might look into that next 😄

@tuurep
Copy link
Collaborator

tuurep commented Jul 13, 2024

Great, build artifact zip fix works, thanks!

@jannis-baum
Copy link
Owner Author

jannis-baum commented Jul 13, 2024

Then this split is all over the place 😄 partly because of how I arranged stuff like code blocks and fenced code blocks under the same section etc

Hahaha okay fair I could have checked that, I thought some of those seemed too basic to be "extended"🙈

Maybe then let's actually have 3 files? Basic, extended, and something that's one level fancier than extended for (hope this list is correct & complete now)

  • Maths
  • relative file links (this is actually something that's still missing and something that also answers our question if we should split ^^)
  • Graphviz
  • <kbd>

Would you mind refactoring this into the three-way split? In case you don't have another idea, the third one could be called markdown-additional.md or something. Best would be to also include the URL to the extended syntax that you mentioned in the extended file.

Btw quite disturbing:

How the checkbox isn't aligned to the text. I might look into that next 😄

Haha sounds good!

Edit: I just saw that (if I didn't miss anything) super/subscripts are the only piece of extended syntax Vivify doesn't support yet. Maybe it would be good to add that for completeness, I opened #87

@tuurep
Copy link
Collaborator

tuurep commented Jul 13, 2024

Ok, I'll do the 3-way split as soon as I can

@tuurep
Copy link
Collaborator

tuurep commented Jul 13, 2024

All finished! Can you give it a check?

Note:

@jannis-baum
Copy link
Owner Author

Awesome, looks perfect! Thanks so much. Will merge now🎉

@jannis-baum jannis-baum merged commit 09e4264 into main Jul 13, 2024
4 checks passed
@jannis-baum jannis-baum deleted the issue/55-render-jupyter-notebooks branch July 13, 2024 17:16
@tuurep tuurep mentioned this pull request Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Render Jupyter Notebooks
2 participants