Metadata-Version: 2.4
Name: importpython-markdown
Version: 0.1.0
Summary: Runnable Python examples in Markdown, via importpython.org.
Author-email: "Nicholas H.Tollervey" <ntoll@ntoll.org>
License: MIT
Project-URL: Homepage, https://importpython.org/
Project-URL: Repository, https://codeberg.org/ntoll/importpython
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Documentation
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: markdown>=3.4
Requires-Dist: pygments>=2.14
Dynamic: license-file

# importpython-markdown

Runnable Python examples in Markdown pages, for MkDocs, Zensical
and anything else built on Python-Markdown, powered by
[importpython.org](https://importpython.org/).

Wrap a section of ordinary Markdown in `#!` and `!#` gates:

    #!mpy terminal title="A first example"

    A caption, rendered as normal Markdown.

    ```python
    print("Hello, world!")
    ```

    !#

The section becomes a runnable example: the code, a Run button,
and the program's output beneath - nothing downloaded until a
reader presses Run. Plain fences are the program; a fence with
`title="name.py"` is a file delivered beside it; `config` and
`body` fences carry BFP settings and page markup (escaped for
you). The `py` and `mpy` types choose Pyodide or MicroPython,
and `terminal`, `debug`, `title="..."`, `run-label="..."`,
`stop-label="..."`, `theme="..."`, `class` and `id` pass through
to the element.

Install and enable:

    pip install importpython-markdown

```yaml
# mkdocs.yml
markdown_extensions:
  - importpython
```

```toml
# zensical.toml
[project.markdown_extensions]
importpython = {}
```

Pre-release honesty: until BFP's first release, the default
`script_url` points at the service's test channel, which may
change; pin your own copy with the `script_url` option if that
matters to you today.

The full documentation lives at
[importpython.org/docs](https://importpython.org/docs/).
