Python markdown preprocessor
Project description
PyMarkEditor
📝 Table of Contents
🔍 What is this repository about?
PyMarkEditor (PME) is a Python package that enhances Markdown syntax by introducing new features. It does not use any external functionality nor add new filetypes, only creating new possibilities on existing .md. Interestingly, you can even use it with any .txt file or any other file type.
Here’s how PME works: Given a template file, PME identifies default patterns and transforms the content into a new file. It’s a straightforward tool that adds versatility to your Markdown documents.
🤔 Why?
Markdown boasts an elegant syntax, but its reusability leaves much to be desired. Picture this scenario: You’re writing numerous similar text blocks (like User Stories), only to discover that a crucial letter “a” is missing across all your lines. Heartbreaking, isn’t it?
This library exists mainly to give answer to those questions:
- How to add variables to markdown?
PME allows you to add variables into markdown with ease. Define placeholders, and PME dynamically replaces them, ensuring consistency without manual edits.
- How to include different files in one markdown file?
PME can include content of any text file into your Markdown, ensuring that it will be easy to maintain with time. Forget about endless scrolling
🐒 Installing
Installation is simple:
pip install PyMarkEditor
📑 Examples
Pre-requirements: one template file (you can name it whatever you like; for now, let’s call it readme_template.md).
To use PME, follow this syntax:
pme <input_file> <output_file>
For instance, if you have a file named readme_template.md and want to create README.md, execute the following command:
pme readme_template.md README.md
How to include variables?
You must create a block of variables at the beginning of your document using four hyphens (----). Each variable starts on a new line
----
variable_name: any text with `any` format of any length
second_variable: any text with `any` format of any length
----
To use these variables throughout your document, enclose them in double curly braces ({{variable_name}}). Remember to add spaces before and after the variable:
You can put {{variable_name}} anywhere
How to include files?
To seamlessly include files within your Markdown document, follow this syntax:
include::path/to/file/file_to_include.md
You can find more examples here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for PyMarkEditor-1.0-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | b60a984486f8f071e80b03f2424ccb0b9554820616c40adc488540f38db822db |
|
| MD5 | f03e66257fa1f87fe408b9c77bdec78f |
|
| BLAKE2b-256 | ec76e4425733585a77e0bacae84799348cd8d59700f4fe5c8c25fb70be2942c4 |