Manage and append consistent or dynamic footers to your Markdown files with md-footer, a versatile CLI tool.
Project description
md-footer
md-footer
is a simple, yet powerful command-line tool designed to manage Markdown footers across multiple documents. Born out of the need for consistent footer content in Markdown files, this tool provides an easy way to append predefined footers, including social media links, contact information, and more, to your Markdown documents.
This is just a quick and easy project, will be adding more features soon if someone interested in it.
Table of Contents
- md-footer
Installation
md-footer
can be installed using pip. Ensure you have Python 3.6 or higher installed on your system.
To install md-footer
, run:
pip install md-footer
Getting Started
After installing md-footer
, you can begin setting up templates and variables to customize your footers.
Templates
A template is a Markdown file that serves as a blueprint for the footer to be appended. It can include static text and placeholders for variables.
Creating a New Template
To add a new template:
md-footer add <template-file-path> [template-name]
If template-name
is not provided, the file name is used as the template name.
Deleting a Template
To delete an existing template:
md-footer remove <template-name>
Listing Templates
To list all available templates:
md-footer templates
By default, you can use the default.md
template that comes with md-footer
. This template includes a sample footer with contact information and social media links. So you can use it by running:
md-footer run <markdown-file-path> -t default
Variables
Variables are placeholders in a template that get replaced with their set values.
Setting a Variable
Set a variable using:
md-footer var <variable-name> <value>
Example:
md-footer var email "example@email.com"
Variable Format in Templates
In templates, variables are denoted by curly braces:
{variable_name}
For example, {email}
in a template will be replaced with the value of the email
variable.
Variables File Format
The vars.json
file is a JSON formatted file where variable values are defined. Example:
{
"email": "example@email.com",
"twitter": "@exampleTwitter",
"website": "https://example.com"
}
Listing Variables
To list all variables and their values:
md-footer list-vars
This command displays all the variables currently stored and their associated values, which are used when templates are processed.
By default are current_date
and current_time
variables are set to the current date and time respectively.
Appending Footer to Markdown Files
To append a footer to a Markdown file:
md-footer run <markdown-file-path> -t [template-name]
If template-name
is not provided, the default template is used.
Loading Variables from a JSON File
To load variables from a JSON file:
md-footer load-vars <json-file-path>
Real-World Examples
- Consistent Footers in Project Documentation: Maintain consistent footer sections in GitHub READMEs with updated contact information and links.
- Automating Blog Post Footers: Quickly append a standard footer with author info and calls to action in Markdown-based blog posts.
- Educational Content and Course Notes: Append additional resources and contact information to educational materials and notes.
Contribution
Contributions to md-footer
are welcome! Feel free to fork the repository, make changes, and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
License
md-footer
is released under the MIT License. See the LICENSE file for more details.
My links (added by md-footer :D)
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 md_footer-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 281eee659f2c2f32e440d809f69961c417ac6f394c93ee702cad3ef36d596671 |
|
MD5 | dd326d802a93a92b55df169d28154bd0 |
|
BLAKE2b-256 | 29175a78fe0692ab75e9baca8a2ff5b4174637331d73a30b6e7bc72b29fa4911 |