Skip to content

An extension to Markdown to split the content into sections / pages.

License

Notifications You must be signed in to change notification settings

marceljs/markdown-split

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-split

Split a Markdown file (or any kind of plain-text file) in sections marked by the § character.

Installation

npm install markdown-split

Usage

let split = require('markdown-split');

let content = `
§ First section

Content of the first section.

§ Second section

Content of the second section.
`;

let sections = split(content);

console.log(sections);

This should produce the following output:

[
	{
		name: 'First section',
		content: 'Content of the first section'
	},
	{
		name: 'Second section',
		content: 'Content of the second section'
	}
]

Notes

If the § character is not followed by a section name, the name property of that section will not be present in the output.

How to produce the § character

If you don't already have it on your keyboard, this Wikipedia page lists the key combinations to produce the § character on a variety of keyboards.

About

An extension to Markdown to split the content into sections / pages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published