Skip to main content

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)

Metadata

Release files for md-footer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for md-footer 0.1.1
File Size Uploaded Provenance Actions
md_footer-0.1.1.tar.gz 6.5 kB Without provenance Details for md_footer-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for md-footer 0.1.1
File Interpreter ABI Platform Actions
md_footer-0.1.1-py3-none-any.whl Python 3 none any Details for md_footer-0.1.1-py3-none-any.whl

Total release size: 16.0 kB

Security for md-footer 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page