Include Python source code in Markdown files
Project description
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 example.py, add the following lines in a code block:
-->includepy<-- example.py
-->pyobject<-- factorial
The includepy preprocessor will turn this into the following:
def factorial(n: int) -> int:
value = n # (1)
while n > 1:
n -= 1
value *= n
return value
See the documentation for further details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file includepy-0.3-py3-none-any.whl.
File metadata
- Download URL: includepy-0.3-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b9c34d0b97146627caaf7f8e49016595e6e12ffd6712d84a619d5a68fb766da
|
|
| MD5 |
e969b3a2aeff73926cc6d5806483e11f
|
|
| BLAKE2b-256 |
5d23cf79a8360a9fc770b714158949615cc926ff63301c2e729960f3a088cb0e
|