Markdown-code-runner

Latest version: v2.1.0

Safety actively analyzes 624763 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

2.1.0

What's Changed
* Allow any language to be saved to a file by basnijholt in https://github.com/basnijholt/markdown-code-runner/pull/12
* Remove use of pkg_resources for Python 3.12 compatibility by basnijholt in https://github.com/basnijholt/markdown-code-runner/pull/14


**Full Changelog**: https://github.com/basnijholt/markdown-code-runner/compare/v2.0.0...v2.1.0

2.0.0

New Features:

- Changed code block markers from `<!-- START_CODE -->` and `<!-- END_CODE -->` to `<!-- CODE:START -->` and `<!-- CODE:END -->`.
- Changed output markers from `<!-- START_OUTPUT -->` and `<!-- END_OUTPUT -->` to `<!-- OUTPUT:START -->` and `<!-- OUTPUT:END -->`.
- Added `<!-- CODE:SKIP -->` comment option to skip the execution of a code block.
- Introduced support for executing code blocks in triple backticks.
- Added support for bash code blocks.
- Added support for file code blocks, allowing to execute *any* language (in combination with bash).

Improvements:

- Refactored code to improve maintainability and readability.
- Better regular expression handling for markers.
- Enhanced error messages and input validation.

1.0.0

We are excited to announce the first release of `markdown-code-runner`! This Python module automatically executes code blocks within a Markdown file and updates the output in-place. This release includes the following features and improvements:

Features

- Parse Markdown files and detect code blocks marked with `<!-- START_CODE -->` and `<!-- END_CODE -->`.
- Execute Python code within the detected code blocks.
- Insert the output of the executed code blocks into the Markdown file, replacing the content between `<!-- START_OUTPUT -->` and `<!-- END_OUTPUT -->` markers.
- Optionally, use a `<!-- SKIP -->` marker to skip the execution of a specific code block and keep the original output.
- Retain the formatting of the original Markdown file, including comments and other non-code elements.
- The main function, `process_markdown`, takes a list of Markdown-formatted strings as input and returns a modified list of Markdown-formatted strings with code block output inserted.

Bug Fixes

- Fixed issues with handling the output of code blocks that were skipped using the `<!-- SKIP -->` marker.
- Improved error handling and added informative error messages for various edge cases.

Testing

- Comprehensive test suite covering various use cases and edge cases.
- Test case for the new `<!-- SKIP -->` marker functionality.

We hope you find `markdown-code-runner` useful for your projects involving code execution within Markdown files. We look forward to your feedback and suggestions for future improvements!

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.