Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inkdropapp/inkdrop-export-utils
Helper functions for exporting Markdown notes from Inkdrop. Works great with plugins.
https://github.com/inkdropapp/inkdrop-export-utils
Last synced: 20 days ago
JSON representation
Helper functions for exporting Markdown notes from Inkdrop. Works great with plugins.
- Host: GitHub
- URL: https://github.com/inkdropapp/inkdrop-export-utils
- Owner: inkdropapp
- Created: 2017-10-11T07:28:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-08T16:10:59.000Z (almost 2 years ago)
- Last Synced: 2024-08-10T05:07:41.187Z (5 months ago)
- Language: TypeScript
- Homepage: https://www.inkdrop.app/
- Size: 2.03 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Inkdrop Export Utils
Helper functions for exporting Markdown notes from Inkdrop. Works great with plugins.
## Installation
```
npm install inkdrop-export-utils --save
```## Usage
Import functions and call them.
```javascript
import { renderHTML } from "inkdrop-export-utils";
```### `async renderHTML (markdown: string): string`
Convert given Markdown to HTML.
It utilizes Inkdrop's rendering module to render it, so the output will be same as on the preview pane.
Extended Markdown syntaxes are also processed such as **math** and **sequence-diagrams**.### `async createHTML(note: Note, options: { addTitle?: boolean, templateHtml?: string })`
Creates HTML from a given note.
- `options.addTitle`: `true` to add the note title to the top of the note (`# `)
- `options.templateHtml`: A template HTML. (Default: A template loaded from `assets/template.html`)### `getStylesheets (): string`
It returns stylesheets provided by plugins that would be necessary for exported HTMLs.
### `async replaceImages (markdown: string, dirToSave: string, basePath?: string): string`
It exports attached images to specified local directory and replaces URIs in Markdown with their paths.
### `async exportImage (uri: string, dirToSave: string): void`
Export an image with specified URI to the local directory (e.g., `inkdrop://file:H1unDnJFW`)
### `async replaceHTMLImagesWithDataURI (html: string): string`
It replaces image attachments represented with `inkdrop-file://` in HTML with data URIs (`data:;base64,`).
## License
MIT