Metadata-Version: 2.4
Name: jljb
Version: 0.1a2
Summary: JupyterLite for Jupyter Book processing
Home-page: https://github.com/matthew-brett/jljb
Author: Matthew Brett
Author-email: matthew.brett@gmail.com
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
License-File: LICENSE
Requires-Dist: jupytext
Requires-Dist: jupyterlite-core
Requires-Dist: jupyterlite-pyodide-kernel
Requires-Dist: jupyterlab_server
Requires-Dist: sphinx
Requires-Dist: myst_parser
Requires-Dist: linkify-it-py

# JupyterLite / JupyterBook notebook processing

These are utilities to take text-format notebooks in a Jupyter Book directory,
and write out a JupyterLite installation, containing `.ipynb` (JSON) notebooks with suitable processing.

The module provides the executable `jljb-write-dir`.  See the help for that command for more details.

That command will:

* Look for suitable `_config.yml` configuration in your specified
  configuration directory (defaulting to current directory).
* It then looks in the configuration for a `jupyterlite` section, and within
  that section looks for these values (default if not specified):

  | Name             | Default |
  | ---------------- | ------- |
  | in_nb_ext        | .md     |
  | out_nb_ext       | .ipynb  |
  | in_nb_fmt        | myst    |
  | remove_remove    | True    |
  | proc_admonitions | True    |

* With that information, the script finds text format notebooks with the
  `in_nb_ext` extension, and applies the following processing to write into an
  output folder:

  * Replaces local kernel with Pyodide kernel in metadata.
  * Filters:
      * Note and admonition markers (if `proc_admonitions` is True)
      * Exercise markers (see
        [sphinx_exercise](https://ebp-sphinx-exercise.readthedocs.io).
      * Solution blocks for exercises.
      * Cells marked with [`remove-cell`
        tag](https://jupyterbook.org/v1/interactive/hiding.html#removing-code-cell-content).
  * Writes notebooks to output directory.
  * Writes JSON jupyterlite file.

The typical way to use this module / command is to write your settings into
the `_config.yml` file as above, and have a `Makefile` target of form:

```makefile
jl:
    # Jupyter-lite files for book build.
    # Install specified requirements for built JupyterLite site.
    $(PIP_INSTALL_CMD) -r jl-build-requirements.txt
    # data and images are directories that should be copied into JL output.
    jljb-write-dir $(BUILD_DIR)/interact data images --jl-tmp $(JL_DIR)
```

