Markdown.RemoveSection

Description

This Task parses a Mardown file and removes a section from its content.

Markdown.RemoveSection only uses Regular Expressions and therefore has no external dependencies.

Note: This Task can be used in combination with the Task Markdown.AddToc to rebuild a Table of Contents (by first removing it and then adding it again).

Arguments

  • section_start_regex (optional) is a string containing the Regular Expression to identify the line that constitutes the start of the section that should be removed.
# section_start_regex = '^# TOC$'  # default
section_start_regex = '^# Content$'
  • section_end_regex (optional) is a string containing the Regular Expression to identify the line that constitutes the end of the section that should be removed.
# section_end_regex = '^---$'  # default
section_end_regex = '^$'

Requirements

Python (Non-Standard-Library Packages)

None.

External Executables

None.

API Credentials

None.

Resources