Metadata-Version: 2.4
Name: includepy
Version: 0.1
Summary: Include Python source code in Markdown files
Project-URL: source, https://github.com/robmoss/includepy
Author-email: Rob Moss <rgmoss@unimelb.edu.au>
Maintainer-email: Rob Moss <rgmoss@unimelb.edu.au>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Text Processing :: Markup :: HTML
Classifier: Topic :: Text Processing :: Markup :: Markdown
Requires-Python: >=3.10
Requires-Dist: markdown>=3.6
Provides-Extra: docs
Requires-Dist: mkdocstrings-python>=2.0.3; extra == 'docs'
Requires-Dist: zensical>=0.0.23; extra == 'docs'
Provides-Extra: tests
Requires-Dist: pytest-cov>=4.0; extra == 'tests'
Requires-Dist: pytest>=8.1.1; extra == 'tests'
Description-Content-Type: text/markdown

# Include Python source code in Markdown files

The `includepy` package provides a Markdown preprocessor that allows you to include the source code for a specific Python object (e.g., a function or class) when rendering Markdown content.

For example, to include the source code for the `factorial` function in `tests/example.py`, add the following lines in a code block:

```py
-->includepy<-- tests/example.py
-->pyobject<-- factorial
```

The `includepy` preprocessor will turn this into the following:

```py
def factorial(n: int) -> int:
    value = n  # (1)
    while n > 1:
        n -= 1
        value *= n
    return value
```
