Skip to main content

This project makes it possible to write separated pieces of `MD` files that will be merged to produce one single final `MD` file.

Project description

The Python module multimd

I beg your pardon for my english...

English is not my native language, so be nice if you notice misunderstandings, misspellings, or grammatical errors in my documents and codes.

This document is a short tutorial showing the most useful features without being exhaustive.

About multimd

Working with moderate sized MD documents in a single file can quickly become tedious. This project allows you to go through separate small MD files to be merged into a final single MD file.

At the moment, resources, such as images, are not managed.

README.md part by part

With multimd, you can write a MD document by typing small section-like parts which are easy to maintain. Consider the README.md file from the src2prod project which was written using the following tree on 6 May 2023.

+ src2prod
    * README.md
    + readme
        * about.yaml
        * about.md
        * build.md
        * cli.md
        * example-used.md
        * only-files.md
        * prologue.md
        * readme-splitted.md
    + ...

The special about.yaml file is used to specify a specific order in which the different MD files are put together (without this file, a "natural" order is used). Its content is as follows: we give the list of the files without their extension.

toc:
  - prologue
  - about
  - example-used
  - build
  - only-files
  - readme-splitted
  - cli

WARNING! You can use relative paths but you must use the Unix path separator /.

Building the final README.md file is done quickly on the command line using multimd after using the cd command to go into the src2prod folder. We use the option -e to allow to erase an existing README.md file.

> multimd -e readme README.md
Successfully built file.
  + Path given:
    README.md
  + Full path used:
    /full/path/to/README.md

There is also an easy-to-use Python API.

from multimd import Builder, Path

mybuilder = Builder(
    src   = Path("/full/path/to/readme"),
    dest  = Path("/full/path/to/README.md"),
    erase = True
)
mybuilder.build()

NOTE. It is possible to work with subfolders containing MD files. In this case, multimd will work recursively. In the about.yaml file, the path to a subfolder simply ends with the Unix path separator / like in one/sub/folder/.

Without the special about.yaml file

Without an about.yaml file, all the MD files will be merged into one after sorting them in a "natural" order.

WARNING! Without an about.yaml file, it is impossible to work with subfolders containing MD files.

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

multimd-0.3.2b0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

multimd-0.3.2b0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file multimd-0.3.2b0.tar.gz.

File metadata

  • Download URL: multimd-0.3.2b0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.16 Darwin/20.6.0

File hashes

Hashes for multimd-0.3.2b0.tar.gz
Algorithm Hash digest
SHA256 dce5995ae290c5784f0cc50370f5f98873ee89649b2fc0efb7d65565238f0f8a
MD5 da95e4542022ed73eb8ae3a8e7c83b35
BLAKE2b-256 cf6bb797427f570e930625945c23aff821f4f5446ae7916c8abf4ab545b1012f

See more details on using hashes here.

File details

Details for the file multimd-0.3.2b0-py3-none-any.whl.

File metadata

  • Download URL: multimd-0.3.2b0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.16 Darwin/20.6.0

File hashes

Hashes for multimd-0.3.2b0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ed4b94c8e1acea7749edfcb23ddd2b532ee8c02209704e4eba837d06de732cf
MD5 39de446b4379ec3fe3ce77be2228885a
BLAKE2b-256 b2cdcf346893fe0d02bb2e6ae90270294552fd5fb5568e32f3e1df47cac6b6d2

See more details on using hashes here.

Supported by

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