Skip to main content

Include Python source code in Markdown files

Project description

Include Python source code in Markdown files

Latest version Documentation MIT license

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

includepy-0.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

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

Hashes for includepy-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2b9c34d0b97146627caaf7f8e49016595e6e12ffd6712d84a619d5a68fb766da
MD5 e969b3a2aeff73926cc6d5806483e11f
BLAKE2b-256 5d23cf79a8360a9fc770b714158949615cc926ff63301c2e729960f3a088cb0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page