Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-preprocessor

A preprocessor for markdown designed to make document sites for Github Pages

  • 3.4.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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:


https://www.foundmyfitness.com/
www.foundmyfitness.com
FoundMyFitness
Promoting strategies to increase healthspan, well-being, cognitive and physical performance through deeper understandings of nutrition, genetics, and cell biology.

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

Generates:


https://www.foundmyfitness.com/

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

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.

Keywords

FAQs

Package last updated on 03 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc