JSPM

  • Created
  • Published
  • Downloads 235
  • Score
    100M100P100Q85477F
  • License GPL-3.0-or-later

uniorg plugin to transform to rehype

Package Exports

  • uniorg-rehype
  • uniorg-rehype/lib/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 (uniorg-rehype) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

uniorg-rehype

uniorg plugin to mutate uniorg to rehype.

Note: uniorg-rehype doesn't deal with HTML inside the Org (#+begin_export html). You'll need rehype-raw if you're planning on doing that.

Install

npm install uniorg-rehype

Use

var unified = require('unified')
var createStream = require('unified-stream')
var uniorgParse = require('uniorg-parse')
var uniorg2rehype = require('uniorg-rehype')
var html = require('rehype-stringify')

var processor = unified().use(uniorgParse).use(uniorg2rehype).use(html)

process.stdin.pipe(createStream(processor)).pipe(process.stdout)

API

processor().use(uniorg2rehype)

uniorg plugin to mutate to rehype.

orgToHast(uniorg)

Convert uniorg AST into hast.

import { parse } from 'uniorg-parse/lib/parser';
import { orgToHast } from 'uniorg-rehype/lib/org-to-hast';

orgToHast(parse(`* headline`));

License

GNU General Public License v3.0 or later