Skip to content

Palibrix/PyMarkEditor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyMarkEditor

Me


Python

PyPI download month

GitHub issues GitHub branches GitHub Maintenance


📝 Table of Contents

  1. 🔍 What is this repository about?
  2. ❓ Why?
  3. 💻 Installing
  4. 📑 Examples
    1. Variables
    2. Files

🔍 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:

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

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages