
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
A command-line utility for pulling code blocks out of markdown files.
$ pip install mkcodes
# For traditional markdown code-block support.
$ pip install mkcodes[markdown]
$ mkcodes --help
Usage: mkcodes [OPTIONS] INPUTS...
Options:
--output TEXT
--github / --markdown Github-flavored fence blocks or pure markdown.
--safe / --unsafe Allow code blocks without language hints.
--package-python Add __init__.py files to python dirs for test
discovery
--default-lang TEXT Assumed language for code blocks without language
hints.
--help Show this message and exit.
My purpose is testing.
You can easily enough doctest a markdown file with python -m doctest myfile.md
, but I don't like typing or looking at a whole bunch of >>>
and ...
's. Also there's no way that I know of to run linters against such code blocks.
Instead, I include (pytest) functional tests in my codeblocks, extract the code blocks with this script, and then run my test runner and linters against the output files.
./test
FAQs
A command-line utility for pulling code blocks out of markdown files.
We found that mkcodes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.