Skip to content

Releases: basnijholt/markdown-code-runner

version 2.1.0

16 Nov 05:15
99e12de
Compare
Choose a tag to compare

What's Changed

  • Allow any language to be saved to a file by @basnijholt in #12
  • Remove use of pkg_resources for Python 3.12 compatibility by @basnijholt in #14

Full Changelog: v2.0.0...v2.1.0

v2.0.0

06 Apr 07:35
87837d8
Compare
Choose a tag to compare

Version 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.

v1.0.0

03 Apr 00:17
Compare
Choose a tag to compare

Release Notes

markdown-code-runner v1.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!