Gathering detailed insights and metrics for markdown-it-implicit-figures-video
Gathering detailed insights and metrics for markdown-it-implicit-figures-video
Render videos occurring by themselves in a paragraph as `<figure>< video ...></figure>`, similar to pandoc's implicit_figures with images
npm install markdown-it-implicit-figures-video
Typescript
Module System
Node Version
NPM Version
70.8
Supply Chain
98.8
Quality
75.4
Maintenance
100
Vulnerability
100
License
TypeScript (98.24%)
JavaScript (1.76%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
1,060
Last Day
1
Last Week
1
Last Month
13
Last Year
442
MIT License
5 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Aug 09, 2023
Minified
Minified + Gzipped
Latest Version
0.10.1
Package Id
markdown-it-implicit-figures-video@0.10.1
Unpacked Size
49.08 kB
Size
9.66 kB
File Count
15
NPM Version
9.5.1
Node Version
18.16.0
Published on
Aug 12, 2023
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-75%
1
Compared to previous week
Last Month
-75.9%
13
Compared to previous month
Last Year
-28.5%
442
Compared to previous year
Render videos occurring by themselves in a paragraph as <figure><video ...></figure>
, similar to pandoc's implicit figures for images.
Based on the excellent markdown-it-implicit-figures package by Arve Seljebu.
Example input:
1text before  2 3 4 5and it works with links: 6 7[](page.html)
Output (adjusted for easier reading):
1<p> 2 text before 3 <video src="video.mp4" controls class="html5-video-player"> 4 Your browser does not support playing HTML5 video. You can 5 <a href="video.mp4" download>download the file</a> instead. 6 </video> 7</p> 8 9<figure> 10 <video 11 src="my_video.mp4" 12 title="My Awesome Video" 13 controls 14 class="html5-video-player" 15 > 16 Your browser does not support playing HTML5 video. You can 17 <a href="my_video.mp4" download>download the file</a> instead. Here is a 18 description of the content: my video 19 </video> 20</figure> 21 22<p>and it works with links:</p> 23 24<figure> 25 <a href="page.html"> 26 <video src="another_video.mp4" controls class="html5-video-player"> 27 Your browser does not support playing HTML5 video. You can 28 <a href="another_video.mp4" download>download the file</a> instead. 29 </video> 30 </a> 31</figure>
...and the tests to prove it!
use
d before markdown-it-implicit-figures-video
(see usage, below).1$ npm install markdown-it-implicit-figures-video
1import mdi from "markdown-it"; 2import { html5Media } from "markdown-it-html5-media"; 3import { implicitFiguresVideo } from "markdown-it-implicit-figures-video"; 4 5... 6 7const md = mdi().use(html5Media); 8 9// default options below 10md.use(implicitFiguresVideo, { 11 copyAttrs: false, // <figure {...videoAttrs}> 12 dataType: false, // <figure data-type="video"> 13 figcaption: false, // adds <figcaption>, possible values 14 // true || 'description' => <figcaption>description text</figcaption> 15 // 'title' => <figcaption>title text</figcaption> 16 tabindex: false, // <figure tabindex="1+n">... 17}); 18 19const src = 'intro text \n\n\n\nMore text'; 20const res = md.render(src); 21 22console.log(res);
copyAttrs
: Copy attributes matching (RegExp or string) copyAttrs
to figure
element.
dataType
: Set dataType
to true
to add the data-type attribute to <figure>
tag
(resulting in <figure data-type="video">
). This can be useful for applying special
styling for different kind of figures.
figcaption
: Can be set to either a boolean or string value.
figcaption
to true
or description
to put the description text in a
<figcaption>
-block after the image. For example, 
renders to1<figure> 2 <img src="img.png" alt="" /> 3 <figcaption>text</figcaption> 4</figure>
figcaption
to title
to put the title text in a <figcaption>
after the image. For example, 
renders to1<figure> 2 <img src="img.png" alt="text" /> 3 <figcaption>title</figcaption> 4</figure>
tabindex
: Set tabindex
to true
to add a tabindex
property to each
figure, beginning at tabindex="1"
and incrementing for each figure
encountered.
MIT © Eric Woodward
No vulnerabilities found.
No security vulnerabilities found.