Skip to content

Latest commit

 

History

History

align

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

@jotdoc/align npm

Align any element (right, left, center, justify). Plugin for the markdown-it parser

❗⠀This plugin belongs to a family of experimental features called Jotdoc: a "flavor" of Markdown aiming to maximize readability and extend markup for common use cases where verbose HTML is required.

If you're interested, please do share your thoughts and check out the monorepo!

Demo

For inline content, a single > or < aligns right or left, respectively. A >...< pair centers:

# Title<
## >Subtitle<
>Inline

Title

ㅤㅤSubtitleㅤㅤ

Inline

For blocks of content, pairs are necessary:

<Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
aliqua.>

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Enable

const md = require('markdown-it')()

      md.use(require('@jotdoc/align'), { /* OPTIONS */ })

Options

Center images and <h1> titles by default:

...
const align = require('@jotdoc/align')
md.use(align), {h1Center: false, imgCenter: true})