acid-info / logos-docusaurus-plugins

Docusaurus plugins for Logos websites
2 stars 4 forks source link

Nomos: Executable code in Paper on blogs #106

Open DeBelg opened 1 year ago

DeBelg commented 1 year ago

Request regarding the Nomos blog site functionality.

They would like to be able to host their papers and include executable code from within these papers. Alexander gave me this reference: https://www.youtube.com/watch?v=EnJDt1VjgFY

Which I found newer and lightweight systems such as: https://blog.jupyter.org/jupyter-everywhere-f8151c2cc6e8 which would allow a static and embedded approach to this.

The main goal of this would be to allow within papers:

"Python code, which takes parameters, runs simulation, and outputs plots. This will allow the reader to explore parameter space relevant to their application."

amirhouieh commented 1 year ago

@jinhojang6 could you take a look at this and see what options we have. Is there a Docusaurus plugin or shall we use libraries like react-jupiter?

jinhojang6 commented 1 year ago

@amirhouieh Sure thing, let me look into it

jinhojang6 commented 1 year ago

Recommended options for Python

  1. (Complicated but Solid) Jupyter UI for React & Docusaurus: datalayer/jupyter-ui Github / Docs

Need to use .devcontainer based on the guideline

The [Jupyter UI](https://github.com/datalayer/jupyter-ui) repository ships the needed .devcontainer folder to develop from [VS Code devcontainers](https://code.visualstudio.com/docs/devcontainers/containers).

Just click on the bottom-left blue icon in your VS Code and select Reopen in container...

Docusaurus example

yarn install &&
  echo open http://localhost:3000/docs/intro && \
  yarn start
  1. (Simple) Jupyter Light as an iframe
<iframe
  src="https://jupyterlite.github.io/demo/repl/index.html?kernel=python&toolbar=1"
  width="100%"
  height="500px"
>
</iframe>
jinhojang6 commented 1 year ago

Options for a wider range of environments and languages:

Additional research in progress

jinhojang6 commented 1 year ago

Recommended open source options for general environments

  1. Using Judge0 as the backend, and judge0 IDE as an iframe (or build our own frotend)
스크린샷 2023-09-12 오후 11 17 54



  1. Using compiler-explorer as an iframe
스크린샷 2023-09-12 오후 11 18 35



  1. CodeX Frontend / Backend
스크린샷 2023-09-12 오후 11 19 29



Other examples