3.4.8 ā€¢ Published 2 years ago

markdown-preprocessor v3.4.8

Weekly downloads
44
License
MIT
Repository
github
Last release
2 years ago

markdown-preprocessor

A preprocessor for markdown designed to make document sites for Github Pages. It extends gitdown.

Installation

npm i markdown-preprocessor

Usage

See the gitdown usage for the gitdown features.

markdown-preprocessor --src ./src --dest ./docs --home-url https://example.com --generate-index --generate-header --generate-footer --remove-link-fileext

Features

Images

Options

  • url: The url for the image.
  • link (optional): Clickable link for the image.
  • alt (optional): Alt text for the image.
  • center (optional): Center the image. Default is true.
{"gitdown": "image", "url": "https://search.chow.com/thumbnail/640/0/www.chowstatic.com/assets/2014/12/10836_creamy_tomato_soup_original_3000_2.jpg"}

Generates:



Embed a video

Options

  • Need one of key or url:
  • key (optional): The video key for the youtube video.
  • url (optional): The url for the youtube video.
  • timestamps (optional): An array of strings (eg "0m10s:a note") with timestamps for the video, generates a table with links to the time codes.
  • collapse (optional): Wrap the video in a collapsible bar.
With a key
{"gitdown": "video:youtube", "key": "Dvi8P-lhJmE"}
With a full url and hidden under a collapse
{"gitdown": "video:youtube", "url": "https://www.youtube.com/watch?v=Dvi8P-lhJmE", "collapse": true, "collapseSummary": "Every Matthew McConaughey "Alright" In Chronological Order (1993 - 2017)"}
// With timestamps
// Note see nested object parsing limitation,
// And Solution: https://stackoverflow.com/questions/26910402/regex-to-match-json-in-a-document/26910403
{"gitdown": "video:youtube", "key": "Dvi8P-lhJmE", "timestamps": [
	"0m10s:a note",
	"0m20s:another note",
	"0m30s:yet another note"
]}

Generates:



Embed site

As a card

Options
  • url: The url for the site.
{"gitdown": "site:card", "url": "https://www.foundmyfitness.com/"}

Generates:



As an iframe

Options
  • url: The url for the site.
{"gitdown": "site:embed", "url": "https://www.foundmyfitness.com/"}

Generates:



Generate index pages

This is enabled by the cli command --generate-index. Your folder structure will be recursively walked and index.md pages will be created for all folders populated with links to files and folders within.

Generates:


Folder Name

šŸ“ ExampleFolder

šŸ“„ ExampleFile


Header

This is enabled by the cli command --generate-header.

Generates a header including the file name

Footer

This is enabled by the cli command --generate-footer.

Generates a footer including navigation buttons.

Remove file extensions

This allows better linking in GitHub pages but will break any locally hosted links. Enabled via --remove-link-fileext

Debugging

You can enable verbose logging with the --verbose flag.

3.4.8

2 years ago

3.4.7

2 years ago

3.4.6

2 years ago

3.4.5

3 years ago

3.4.4

3 years ago

3.4.3

3 years ago

3.4.2

4 years ago

3.4.1

4 years ago

3.4.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.3

4 years ago

3.2.2

4 years ago

3.2.1

4 years ago

3.1.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.10.1

4 years ago

2.10.0

4 years ago

2.9.0

5 years ago

2.8.1

5 years ago

2.8.0

5 years ago

2.7.0

5 years ago

2.6.4

5 years ago

2.6.3

5 years ago

2.6.2

5 years ago

2.6.1

5 years ago

2.6.0

5 years ago

2.5.1

5 years ago

2.5.0

5 years ago

2.4.0

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago