Skip to content

D3r3k23/strip_markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strip_markdown

PyPI ci

Converts markdown to plain text, including both a command line interface and importable library

Example

Markdown


Title

Section

This is a line of text

Bold text


Markdown source


# Title

## Section

This is a line of text

**Bold text**

Text


Title
Section
This is a line of text
Bold text

Installation

$ pip install strip_markdown

Usage

Command line

$ python -m strip_markdown MD_fn [TXT_fn]

Library

>>> import strip_markdown
>>>
>>> TXT: str = strip_markdown.strip_markdown(MD: str)
>>> strip_markdown.strip_markdown_file(MD_fn: Path, TXT_fn: Optional[Path])
  • TXT_fn is optional: default is <MD_fn>.md -> <MD_fn>.txt
  • If TXT_fn is a directory, <MD_fn>.txt is placed in that directory