mknotebooks-with-links


Namemknotebooks-with-links JSON
Version 0.7.1.post0.dev809 PyPI version JSON
download
home_pagehttps://github.com/Thomzoy/mknotebooks
SummaryPlugin for mkdocs to generate markdown documents from jupyter notebooks.
upload_time2024-06-25 14:59:36
maintainerNone
docs_urlNone
authorJonathan Gray
requires_pythonNone
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": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "mkdocs documentation markdown",
    "author": "Jonathan Gray",
    "author_email": "jonathan.gray@nanosheep.net",
    "download_url": null,
    "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.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Plugin for mkdocs to generate markdown documents from jupyter notebooks.",
    "version": "0.7.1.post0.dev809",
    "project_urls": {
        "Homepage": "https://github.com/Thomzoy/mknotebooks"
    },
    "split_keywords": [
        "mkdocs",
        "documentation",
        "markdown"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f540ac6d7a48aef1f357ff846c6139aeceede4e9c390289eb6655518b029124",
                "md5": "fe13f37353054c5c30aa91287176e1c7",
                "sha256": "4022b02c28b36f060e546a1f5be5d95b85f7549e52d49753fb92ae1bbdc5aad8"
            },
            "downloads": -1,
            "filename": "mknotebooks_with_links-0.7.1.post0.dev809-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe13f37353054c5c30aa91287176e1c7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13994,
            "upload_time": "2024-06-25T14:59:36",
            "upload_time_iso_8601": "2024-06-25T14:59:36.024227Z",
            "url": "https://files.pythonhosted.org/packages/8f/54/0ac6d7a48aef1f357ff846c6139aeceede4e9c390289eb6655518b029124/mknotebooks_with_links-0.7.1.post0.dev809-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-25 14:59:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Thomzoy",
    "github_project": "mknotebooks",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "circle": true,
    "lcname": "mknotebooks-with-links"
}
        
Elapsed time: 3.63701s