Skip to content

Pandoc tools for javascript, including a rollup importer

License

Notifications You must be signed in to change notification settings

bmschmidt/pandoc-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pandoc Tools for node and js

Pandoc is the Cadillac of Markdown engines, and is amply served with npm modules. This module, built primarily to support my [pandoc-svelte-components] library, plugs a few gaps.

Most importantly for me, it provides a Rollup plugin for importing markdown files directly inside a svelte-kit project as JSON. I can (and may) support html exports as well, but the JSON format is the place where pandoc allows really interesting things to happen.

Currently supported formats:

  • markdown
  • IPython notebooks
  • Microsoft Word (docx) files.

Usage in a vite project with sveltekit.

// vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { pandoc_rollup_plugin } from 'pandoc-tools';

export default defineConfig({
	plugins: [pandoc_rollup_plugin({ cache_loc: 'posts_cache' }), sveltekit()]
});
// src/routes/+page.svelte
<script>

import { metadata, document } from "front_page.md"
import { Document } from 'pandoc-svelte-components'

</script>

<h1>{metadata.title}</h1>
<em>{metadata.date}{/em}

<Document ast={document}>

RELEASE NOTES

1.1.0: Support MS Word (docx) and Ipython notebook (.ipynb) files; set stage for supporting all pandoc inputs.

1.0.1: collapse Space type to " " to reduce file sizes/complexity.

About

Pandoc tools for javascript, including a rollup importer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published