mknotebooks-with-links


Namemknotebooks-with-links JSON
Version 0.7.1.post0.dev806 PyPI version JSON
download
home_pagehttps://github.com/Thomzoy/mknotebooks
SummaryPlugin for mkdocs to generate markdown documents from jupyter notebooks.
upload_time2022-12-01 16:06:20
maintainer
docs_urlNone
authorJonathan Gray
requires_python
licenseMIT
keywords mkdocs documentation markdown
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mknotebooks)
![PyPI](https://img.shields.io/pypi/v/mknotebooks)
![PyPI - Downloads](https://img.shields.io/pypi/dm/mknotebooks)
![GitHub contributors](https://img.shields.io/github/contributors/timvink/mknotebooks)
![PyPI - License](https://img.shields.io/pypi/l/mknotebooks)

# mknotebooks

mknotebooks is a plugin for [MkDocs](https://mkdocs.org) enabling you to include [Jupyter](https://jupyter.org) notebooks directly in your project documentation.

## Install

`pip3 install mknotebooks`

## Usage

- Add `mknotebooks` to the plugin section of your `mkdocs.yml`
- Include any notebooks (`.ipynb` files) you want to use in the `docs/` directory just as you would `.md` files.

Example:

```yaml
# mkdocs.yml
nav:
  - your_notebook.ipynb

plugins:
  - mknotebooks
```

Any static images, plots, etc. will be extracted from the notebook and placed alongside the output HTML.

### Options

You can optionally execute the notebooks, by setting `execute: true` in the config. You can include a hidden preamble script, to be run before executing any cells using `preamble: "<path/to/your/script>"`. The default cell execution timeout can be overridden by setting `timeout: <timeout>`, where `<timeout>` is an integer number of seconds.

By default, execution will be aborted if any of the cells throws an error, but you can set `allow_errors: true` to continue execution and include the error message in the cell output.

Example:


```yaml
# mkdocs.yml
plugins:
  - mknotebooks
      execute: false
      timeout: 100
      preamble:  "<path/to/your/script>"
      allow_errors: false
```

### Styling

Mknotebooks applies default styling to improve the appearance of notebook input/output cells and pandas dataframes. If these interfere with any other CSS stylesheets that you're using, you can disable these via the following options.

```
# mkdocs.yml
- mknotebooks:
   enable_default_jupyter_cell_styling: false
   enable_default_pandas_dataframe_styling: false
```

### Syntax highlighting

In order to enable syntax highlighting for code blocks, `pygments` has to be installed and `codehilite` extension has to be enabled in `mkdocs.yml`.

1. Install pygments:

```
pip install Pygments
```

2. Enable `codehilite` extension in `mkdocs.yml`:

```
# mkdocs.yml
markdown_extensions:
    - codehilite
```

### Binder

You can also choose to have mknotebooks insert a [Binder](https://mybinder.org) link into each notebook.

``` mkdocs.yml
- mknotebooks:
      binder: true
      binder_service_name: "gh"
      binder_branch: "master"
      binder_ui: "lab"
```

If you are using GitLab, you will need to set `binder_service_name` to `"gl"`.

## Examples

See the [examples folder](examples/) for examples on the [use of a preamble](examples/execute_with_preamble) and [using Binder](examples/binder_logo). Try them out by running `pipenv install && pipenv run mkdocs serve`.

## Inspecting generated markdown

You can also export the generated markdown by setting `write_markdown: true` in your `mkdocs.yml`. This will write the generated markdown to a `.md.tmp` file alongside the original notebook.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Thomzoy/mknotebooks",
    "name": "mknotebooks-with-links",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "mkdocs documentation markdown",
    "author": "Jonathan Gray",
    "author_email": "jonathan.gray@nanosheep.net",
    "download_url": "https://files.pythonhosted.org/packages/ad/89/48c2119526d3e19b102a696b4a359b2dcc9cf48bbb135c45343e098fcd6e/mknotebooks-with-links-0.7.1.post0.dev806.tar.gz",
    "platform": "MacOS X",
    "description": "![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mknotebooks)\n![PyPI](https://img.shields.io/pypi/v/mknotebooks)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/mknotebooks)\n![GitHub contributors](https://img.shields.io/github/contributors/timvink/mknotebooks)\n![PyPI - License](https://img.shields.io/pypi/l/mknotebooks)\n\n# mknotebooks\n\nmknotebooks is a plugin for [MkDocs](https://mkdocs.org) enabling you to include [Jupyter](https://jupyter.org) notebooks directly in your project documentation.\n\n## Install\n\n`pip3 install mknotebooks`\n\n## Usage\n\n- Add `mknotebooks` to the plugin section of your `mkdocs.yml`\n- Include any notebooks (`.ipynb` files) you want to use in the `docs/` directory just as you would `.md` files.\n\nExample:\n\n```yaml\n# mkdocs.yml\nnav:\n  - your_notebook.ipynb\n\nplugins:\n  - mknotebooks\n```\n\nAny static images, plots, etc. will be extracted from the notebook and placed alongside the output HTML.\n\n### Options\n\nYou can optionally execute the notebooks, by setting `execute: true` in the config. You can include a hidden preamble script, to be run before executing any cells using `preamble: \"<path/to/your/script>\"`. The default cell execution timeout can be overridden by setting `timeout: <timeout>`, where `<timeout>` is an integer number of seconds.\n\nBy default, execution will be aborted if any of the cells throws an error, but you can set `allow_errors: true` to continue execution and include the error message in the cell output.\n\nExample:\n\n\n```yaml\n# mkdocs.yml\nplugins:\n  - mknotebooks\n      execute: false\n      timeout: 100\n      preamble:  \"<path/to/your/script>\"\n      allow_errors: false\n```\n\n### Styling\n\nMknotebooks applies default styling to improve the appearance of notebook input/output cells and pandas dataframes. If these interfere with any other CSS stylesheets that you're using, you can disable these via the following options.\n\n```\n# mkdocs.yml\n- mknotebooks:\n   enable_default_jupyter_cell_styling: false\n   enable_default_pandas_dataframe_styling: false\n```\n\n### Syntax highlighting\n\nIn order to enable syntax highlighting for code blocks, `pygments` has to be installed and `codehilite` extension has to be enabled in `mkdocs.yml`.\n\n1. Install pygments:\n\n```\npip install Pygments\n```\n\n2. Enable `codehilite` extension in `mkdocs.yml`:\n\n```\n# mkdocs.yml\nmarkdown_extensions:\n    - codehilite\n```\n\n### Binder\n\nYou can also choose to have mknotebooks insert a [Binder](https://mybinder.org) link into each notebook.\n\n``` mkdocs.yml\n- mknotebooks:\n      binder: true\n      binder_service_name: \"gh\"\n      binder_branch: \"master\"\n      binder_ui: \"lab\"\n```\n\nIf you are using GitLab, you will need to set `binder_service_name` to `\"gl\"`.\n\n## Examples\n\nSee the [examples folder](examples/) for examples on the [use of a preamble](examples/execute_with_preamble) and [using Binder](examples/binder_logo). Try them out by running `pipenv install && pipenv run mkdocs serve`.\n\n## Inspecting generated markdown\n\nYou can also export the generated markdown by setting `write_markdown: true` in your `mkdocs.yml`. This will write the generated markdown to a `.md.tmp` file alongside the original notebook.",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Plugin for mkdocs to generate markdown documents from jupyter notebooks.",
    "version": "0.7.1.post0.dev806",
    "split_keywords": [
        "mkdocs",
        "documentation",
        "markdown"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "9a5997759f64e50da35edaa69ff467fd",
                "sha256": "3dcd6451793f8248215a3572dc3126776a0aa04387d3e44a721ecddd95a5a01d"
            },
            "downloads": -1,
            "filename": "mknotebooks-with-links-0.7.1.post0.dev806.tar.gz",
            "has_sig": false,
            "md5_digest": "9a5997759f64e50da35edaa69ff467fd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 28296,
            "upload_time": "2022-12-01T16:06:20",
            "upload_time_iso_8601": "2022-12-01T16:06:20.121066Z",
            "url": "https://files.pythonhosted.org/packages/ad/89/48c2119526d3e19b102a696b4a359b2dcc9cf48bbb135c45343e098fcd6e/mknotebooks-with-links-0.7.1.post0.dev806.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-01 16:06:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Thomzoy",
    "github_project": "mknotebooks",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mknotebooks-with-links"
}
        
Elapsed time: 0.03067s