about
This is extension plugin for remark markdown library whitch based on unified framework. It's allows you add id and css attributes to markdown language. Extension works with rehype by using hProperties.
installation
npm install remark-css-selectors
examples
{.big-head}# h3 Heading {.heading}#### h4 Heading {.line}~~Strikethrough~~ ##### h5 Heading {.w-800 text-red}**This is bold text** {.lite}_This is italic text_
will output
h3 Headingh4 Heading Strikethrough h5 Heading This is bold text This is italic text
{.h2}{#hJs}## New rules {#specilaLine}--- {.line-through}*** {.quotes-title}## Blockquotes {.block}> Blockquotes can also be nested... >> ...by using additional greater-than signs right next to each other... > > > ...or with spaces between arrows.
New rulesBlockquotesBlockquotes can also be nested......by using additional greater-than signs right next to each other......or with spaces between arrows.
Inline {.code}`code` {.sample sample--red}``` Sample text here... .``` Syntax highlighting {#code}{.code-js}``` js var foo = function (bar) { return bar++;}; console.log(foo(5)); .```
Inline code Sample text here... Syntax highlighting var foo = function (bar) { return bar++; }; console.log(foo(5));
- with custom blocks
{.sm-col-6}[[block]] |{.pargraph-class} {#img-id} |{.img-class} you need one space in front to assign id to image not to paragraph {#image}![Alt text][id]
you need one space in front to assign id to image not to paragraph
usage
;;//import remarkCustomBlocks from 'remark-custom-blocks';;;;let document =// .use(remarkCustomBlocks, {// block: {// classes: 'custom-block'// },// });console
const processed = ;// will return react elemtreturn processedresult;