JSPM

micromark-extension-caml

0.0.6-mm
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q38416F
  • License GPL-3.0

Micromark syntax extension for caml (semantic) attributes.

Package Exports

  • micromark-extension-caml
  • micromark-extension-caml/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (micromark-extension-caml) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

micromark-extension-caml

A WikiBonsai Project NPM package

A micromark syntax extension for CAML attributes, providing the low-level modules for integrating with the micromark tokenizer and the micromark HTML compiler.

You probably shouldn’t use this package directly, but instead use mdast-util-caml with mdast or remark-caml with remark.

Note that this extension only parses the input -- it is up to you to track and store attribute metadata.

🕸 Weave a semantic web in your 🎋 WikiBonsai digital garden.

Install

This package is ESM only. Install micromark-extension-caml on npm.

npm install micromark-extension-caml 

Usage

import micromark from 'micromark';
import { syntaxCaml, htmlCaml } from 'micromark-extension-caml';

let serialized = micromark(':attrtype::value\n', {
    extensions: [syntaxCaml()],
    htmlExtensions: [htmlCaml()]
});

The serialized result will be the following. To get an abstract syntax tree, use mdast-util-caml instead.

While data is extracted and stored in data tokens, no HTML is generated at the micromark level. To render directly to html, use mdast-util-caml.

Options

let opts = {
  attrs: {
    render: boolean;
    title: string;
  },
  css: {
    attr: string;
    attrbox: string;
    attrboxTitle: string;
    // [[wikilinks]]-related
    invalid: string;
    valid: string;
  },
};

Syntax

For more on syntax specification, see the caml repo.

Options Descriptions

See remark-caml readme for option descriptions.