Skip to content

Latest commit

 

History

History

README.md

remark-textras

Build Downloads Size

remark extension to provide small helpers via remark-directive. (Comprehensive documentation will be added soon.)

Docs at shivjm.github.io/remark-extensions.

Install

This package is ESM only: Node 18+ is needed to use it and it must be imported instead of required.

npm:

npm install remark-textras

Use

import {micromark} from 'micromark'
import {
  html,
  syntax
} from 'remark-textras';

// TODO: add example

console.log(output)

Yields:

TODO

Syntax

Most of these have a one-to-one correspondence with an HTML element.

:ordinal

It happened on the 27:ordinal[th] of May.

:quote

And then he said, :quote[What ho!].

Adds special marker classes if a quotation mark is found at the beginning or end of its contents.

:var

In the invocation above, :var[degree] is the desired rotation.

:abbr

This page is built using :abbr[HTML] and :abbr[CSS].

:samp

At this point, the program should fail with an error like :samp[Invalid fizz provided].

:work

See the aforementioned :work[A Real Pain] and :work[Futurama]{year="1999"}.

API

TODO

License

ISC © Shiv Jha Mathur