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

Add Jupyter Notebook support? #316

Open
NeroBlackstone opened this issue Feb 14, 2024 · 3 comments
Open

Add Jupyter Notebook support? #316

NeroBlackstone opened this issue Feb 14, 2024 · 3 comments

Comments

@NeroBlackstone
Copy link

For some time-consuming code, Jupyter Notebook could save single run results, instead of running the codes in markdown every time.
So I think it's meaningful to support Jupyter Nootbook

@rikhuijzer
Copy link
Collaborator

Jupyter Notebooks encourage more "script"-style projects whereas Books.jl aims to have a proper software package and then call outputs from there. To avoid re-running long running computations, you could use gen(path, block_number; ...) to call only specific blocks. To automatically re-evaluate blocks after you change code, you can use entr_gen(path, block_number; ...). See the docstrings of these functions for more information.

@NeroBlackstone
Copy link
Author

NeroBlackstone commented Mar 25, 2024

Does books.jl also support “script-style” projects?

It seems that Books.jl cannot do the following two things:

  1. Define variables and use them in markdown context.
  2. Directly display code blocks itself and the output of code blocks, like Jupyter Notebook. Instead of writing separate statements for displaying code blocks and executing code blocks.

As you said:

"Books.jl aims to have a proper software package and then call outputs from there."

But I think "script-style" can make writing more natural and help us port some Jupyter Notebooks with julia kernel, which will make Books.jl a direct replacement for Jupyter Book (if books are written in julia language)

I don't know if this feature is within the goals of Books.jl or there is interest in implementing it, but I think it makes a lot of sense. I think there are two options:

  1. Directly make Markdown interactive, variables and functions can be defined and called(I prefer this)
  2. Add Jupyter Notebook support

@NeroBlackstone
Copy link
Author

NeroBlackstone commented Mar 25, 2024

It seems that Books.jl cannot do the following two things:

Define variables and use them in markdown context.
Directly display code blocks itself and the output of code blocks, like Jupyter Notebook. Instead of writing separate statements > for displaying code blocks and executing code blocks.

Sorry, after checking JuliaDataScience ,I found that this can be done

But I think something like this a little cumbersome:

s = """
    name = "Julia"
    age = 9
    """
scob(s)

I think we still need an interactive solution, It looks like there is already a ready-made solution: PlutoStaticHTML.jl

But I still haven't figured out How to generate html and pdf from Pluto Notebook with numbering of sections, like a book.

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

No branches or pull requests

2 participants