adobe-afm-transform
TypeScript icon, indicating that this package has built-in type declarations

1.2.24 • Public • Published

adobe-afm-transform

Adobe Flavored Markdown transform function for use within your toolchain.

Installation

npm install adobe-afm-transform

Usage

Named export is afm:

ES Module

import {afm} from 'adobe-afm-transform';

CommonJS / node.js

const {afm} = require('adobe-afm-transform');

Function parameters

  1. Markdown string to transform
  2. (Optional) CSS class to decorate, default is extension
  3. (Optional) Markdown compiler, default is pass-thru - required to support nested markdown
  4. (Optional) Admonitions map for consistent CSS classes, e.g. {"WICHTIG": "IMPORTANT"}
  5. (Optional) Admonitions map for label rewrite, e.g. {"MORELIKETHIS": "Related Articles"}

Example

import {afm} from 'adobe-afm-transform';
const markdown = `# Sample

>[!NOTE]
>
>This is an AFM note!

This is a paragraph.
`;

afm(markdown);

The output would be:

# Sample

<div class="extension note">
<div>NOTE</div>
<div>
This is an AFM note!
</div>
</div>

This is a paragraph.

License

Copyright 2022 Adobe Inc. Licensed under the Apache-2.0 license.

Package Sidebar

Install

npm i adobe-afm-transform

Weekly Downloads

3

Version

1.2.24

License

Apache-2.0

Unpacked Size

24.6 kB

Total Files

7

Last publish

Collaborators

  • avoidwork