npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

remark-html-directives

v1.0.5

Published

```js npm i -D remark-directive remark-html-directives ```

Downloads

33

Readme

Remark HTML Directives

Installation

npm i -D remark-directive remark-html-directives 

Usage

To use this plugin make sure that you register this one after the remark directive package. This package needs that one in order to be useful.

For Example

export default {
  plugins: [
    "remark-directive",
    "remark-html-directives"
  ]
}

Introduction

This package is a package that is used to allow people to write html inside of each of their markdown. The way this is done is through directives. A directive is a syntax that is eventually compiled to markdown. A markdown directive typically starts with a : a name next to it then a []. For example :a[link to somewhere]. This example was called a text directive. A block directive is written like this :::div ::: a leaf directive is written like this ::span. You can also add html attributes as well. You do this by using the {} syntax. The {} syntax allows you to write classes and attributes like this :a[goo]{href=www.go\o\.com}. Your markdown will render just fine with this plugin.

Container directives

A container directive is a directive that must use either a block element tag name or a table cell, row or data-cell element. The syntax is written like this


:::section 

::img{src="foo.jpeg" alt=''}

:::

As you can see these directives are meant to contain other directives or even just mark down. The ::: before the name represent the start of the container. The ::: at the represent the end of the container. Any markdown written inside of this directive will render as html that is contained by the tag produced by this tag. Which means the example above will produce the below html.

<section>

<img src="foo.jpeg" alt="" />

</section>

Leaf directives

A leaf directive can only generate tags that are by default inline tags , or 'br', 'button', 'i', 'img', 'map', 'iframe', 'span',. that's it. The syntax is written like this

::span[good]  

The above example will render the html below.

<span>good</span>

!Note: leaf directives can only contain text by using the [] syntax and attributes by using the {} syntax.

Text directives

A text directive is a directive that is supposed to be put inside of text. It is created to give text meaning. Any html tag that is suposed to affect text in a special way is a text directive. This means that they are supposed to be written inside of anything that contains text. The syntax is like this.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
:mark[Suspendisse] id fringilla ipsum. 
Interdum et malesuada fames ac ante ipsum primis in faucibus.
 Morbi non tellus id felis efficitur sagittis. 
Suspendisse :abbr[fringilla] neque eget scelerisque :strong[venenatis]. 
 Mauris a mi nunc. 

The example above will render

Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
<mark>Suspendisse</mark> id fringilla ipsum. 
Interdum et malesuada fames ac ante ipsum primis in faucibus. 
Morbi non tellus id felis efficitur sagittis. 
Suspendisse <abbr>fringilla</abbr> neque eget scelerisque <strong>venenatis</strong>. 
Mauris a mi nunc. 

HTML Attributes

A directive can contain any HTML Attribute all of them will be processed properly. To start you use the {} at the end of every directive that you create. You can the type your attributes by typing a key src= followed by a value foo.jpg together ypu get {src=foo.jpg}. The key must always have an = sign right next to it.

Shorhands

You can also type shorthands for ids and classes . You'd normally type {class=text-gray-600, id=container} as attributes you instead write {.text-gray-900 #container} as a shorthand.