https://github.com/centerforopenscience/markdown-it-atrules
https://github.com/centerforopenscience/markdown-it-atrules
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/centerforopenscience/markdown-it-atrules
- Owner: CenterForOpenScience
- License: mit
- Created: 2018-01-25T19:20:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-11T20:13:16.000Z (over 7 years ago)
- Last Synced: 2025-03-21T22:39:15.429Z (10 months ago)
- Language: JavaScript
- Size: 97.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# markdown-it-atrules
# Work in progess
> markdown-it plugin for embedding MFR files.
## Usage
```js
md = require('markdown-it')({
html: true,
linkify: true,
typography: true,
}).use(require('../'), {
type: 'osf',
pattern: /^http(?:s?):\/\/(?:www\.)?[a-zA-Z0-9 .:]{1,}\/render\?url=http(?:s?):\/\/[a-zA-Z0-9 .:]{1,}\/([a-zA-Z0-9]{5})\/\?action=download|(^[a-zA-Z0-9]{5}$)/,
format(assetID) {
var id = '__markdown-it-atrules-' + (new Date()).getTime();
return '
' +
'$(document).ready(function () {new mfr.Render("' + id + '", "' + getMfrUrl(assetID) + '"); }); ';
}
```