Skip to main content

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.

md-footer banner

PyPI version

This is just a quick and easy project, will be adding more features soon if someone interested in it.

Table of Contents

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

  1. Consistent Footers in Project Documentation: Maintain consistent footer sections in GitHub READMEs with updated contact information and links.
  2. Automating Blog Post Footers: Quickly append a standard footer with author info and calls to action in Markdown-based blog posts.
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md_footer-0.1.1.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

md_footer-0.1.1-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page