Giter Site home page Giter Site logo

Comments (13)

rkdarst avatar rkdarst commented on August 27, 2024

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

Thanks! Yes, I'll try it out (later today) and report. I'll add documentation on how to do it.

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

Not much luck. https://github.com/ENCCS/veloxchem-workshop/blob/master/content/conf.py jupyter-book wants to read toc.yml and I'm not sure how to convince it not to do that :/

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

sphinx-thebe would work, but I'd need to write the whole content in rst. I wanted to keep the ipynb files separate, such that they could be reused separately from the lesson. I need to dig a bit deeper.

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

Here it is: https://github.com/ENCCS/veloxchem-workshop I've managed to add a cell on the main page and it works. But the notebook in the "First VeloxChem calculation" is static.

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

Thanks for taking the time to look into this!

What I would like to achieve I would like to be able to use the Sphinx website as I would other lessons without interactive content, while being able to execute the cells without the need to share another browser tab. I feel this would be more engaging for the audience, since they can execute cells at the same time as I do and tinker around without losing (too much) focus on what I am sharing.

  1. Just using sphinx-thebe would be enough. But that requires that one works on the content of the executable cells separately and once that work is converged, copy-pastes them in markdown or restructuredtext.
  2. Adding the button "by hand" is no problem and, in fact, was the first thing I was going to do, before remembering about executable book. It would be great if the launch binder button could be added to sphinx-lesson through parameters in conf.py.
  3. Third option is useful to not duplicate effort between developing the notebook and developing the lesson.

For my use case, I think I need 2+3: execute cells within the lesson, but provide an "escape hatch" to the mybinder.org instance behind it.

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

And by the way, the course will take place in 3 months. I started setting it up early because there's a few moving parts I need to figure out (running quantum chemical calculations, visualizing molecules, and molecular orbitals)

from sphinx-lesson.

robertodr avatar robertodr commented on August 27, 2024

OK, it seems using sphinx-book-theme does exactly what I want out of the box. I can write the content as notebooks and the theme will take care of rendering it and providing the launch buttons: https://enccs.github.io/veloxchem-workshop/ I've configured two buttons: to redirect to MyBinder or to start Thebe. What remains to be fixed is the styling of custom directives, which is somewhat related to #45.

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

I think that matched what I saw: somehow, the theme would label everything on the whole-page level. I think that someone clever enough with javascript could probably get the same effect, but I'm not sure when I would get to it. Is that theme compatible enough to recommend in general for this use case?

from sphinx-lesson.

rkdarst avatar rkdarst commented on August 27, 2024

With sphinx_rtd_theme I was able to make a whole notebook executable:

  • start from a Jupyter notebook (thus it needs myst, not rst)

  • add config
    `extensions.append('sphinx_thebe')
    This config makes it detect output and link it properly, you could do other things depending on your interest:

     "selector": "div.cell",
     "selector_input": "div.cell_input",
     "selector_output": "div.cell_output",
     }
    
  • Add a launch button to a cell:

     ```{thebe-button}
     ```
    
  • Every cell in the notebook becomes executable

  • Other config likely needed, both in the page metadata and in the conf.py (setting kernels, repos to launch, etc): https://sphinx-thebe.readthedocs.io/en/latest/configure.html

... perhaps still need some debugging. (And in case of difficulties, I used the latest unreleased version of sphinx_thebe, but I think that shouldn't matter. However, somehow sphinx-autobuild didn't work with it, I didn't have time to figure out why...)

from sphinx-lesson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.