1
0

add initial marp implementation with sample content and build configuration

This commit is contained in:
2025-09-13 18:13:22 +02:00
parent dcacc9b409
commit e5f219507f
10319 changed files with 1402023 additions and 0 deletions

21
node_modules/@marp-team/marp-core/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Marp team (marp-team@marp.app)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

361
node_modules/@marp-team/marp-core/README.md generated vendored Normal file
View File

@@ -0,0 +1,361 @@
# @marp-team/marp-core
[![CircleCI](https://img.shields.io/circleci/project/github/marp-team/marp-core/main.svg?style=flat-square&logo=circleci)](https://circleci.com/gh/marp-team/marp-core/)
[![Codecov](https://img.shields.io/codecov/c/github/marp-team/marp-core/main.svg?style=flat-square&logo=codecov)](https://codecov.io/gh/marp-team/marp-core)
[![npm](https://img.shields.io/npm/v/@marp-team/marp-core.svg?style=flat-square&logo=npm)](https://www.npmjs.com/package/@marp-team/marp-core)
[![LICENSE](https://img.shields.io/github/license/marp-team/marp-core.svg?style=flat-square)](./LICENSE)
**The core of [Marp](https://github.com/marp-team/marp) converter.**
In order to use on Marp tools, we have extended from the slide deck framework **[Marpit](https://github.com/marp-team/marpit)**. You can use the practical Markdown syntax, advanced features, and official themes.
## Install
```bash
npm install --save @marp-team/marp-core
```
## Usage
We provide `Marp` class, that is inherited from [Marpit](https://github.com/marp-team/marpit).
```javascript
import { Marp } from '@marp-team/marp-core'
// Convert Markdown slide deck into HTML and CSS
const marp = new Marp()
const { html, css } = marp.render('# Hello, marp-core!')
```
## Features
_We will only explain features extended in marp-core._ Please refer to [Marpit framework](https://marpit.marp.app) if you want to know the basic features.
---
### Marp Markdown
**Marp Markdown** is a custom Markdown flavor based on [Marpit](https://marpit.marp.app) and [CommonMark](https://commonmark.org/). Following are principle differences from the original:
- **Marpit**
- Enabled [inline SVG slide](https://marpit.marp.app/inline-svg), [CSS container query support and loose YAML parsing](https://marpit-api.marp.app/marpit#Marpit) by default.
* **CommonMark**
- For making secure, using some insecure HTML elements and attributes are denied by default.
- Support [table](https://github.github.com/gfm/#tables-extension-) and [strikethrough](https://github.github.com/gfm/#strikethrough-extension-) syntax, based on [GitHub Flavored Markdown](https://github.github.com/gfm/).
- Line breaks in paragraph will convert to `<br>` tag.
- Slugification for headings (assigning auto-generated `id` attribute for `<h1>` - `<h6>`) is enabled by default.
---
### [Built-in official themes][themes]
We provide bulit-in official themes for Marp. See more details in [themes].
| Default | Gaia | Uncover |
| :-----------------------------------: | :-----------------------------------: | :-----------------------------------: |
| [![](https://bit.ly/2Op7Bp6)][themes] | [![](https://bit.ly/2QhDq4S)][themes] | [![](https://bit.ly/2DqZvvh)][themes] |
| `<!-- theme: default -->` | `<!-- theme: gaia -->` | `<!-- theme: uncover -->` |
[themes]: ./themes/
---
### `size` global directive
Do you want a traditional 4:3 slide size? Marp Core adds the support of `size` global directive. The extended theming system can switch the slide size easier.
```markdown
---
theme: gaia
size: 4:3
---
# A traditional 4:3 slide
```
[Bulit-in themes for Marp][themes] have provided `16:9` (1280x720) and `4:3` (960x720) preset sizes.
#### Define size presets in custom theme CSS
If you want to use more size presets in your own theme, you have to define `@size` metadata(s) in theme CSS. [Learn in the document of theme metadata for Marp Core][metadata].
Theme author does not have to worry an unintended design being used with unexpected slide size because user only can use pre-defined presets by author.
[metadata]: ./themes#metadata-for-additional-features
---
### Emoji support
Emoji shortcode (like `:smile:`) and Unicode emoji 😄 will convert into the SVG vector image provided by [twemoji](https://github.com/jdecked/twemoji) <img src="https://cdn.jsdelivr.net/gh/jdecked/twemoji@15.1.0/assets/svg/1f604.svg" alt="😄" width="16" height="16" />. It could render emoji with high resolution.
---
### Math typesetting
We have [Pandoc's Markdown style](https://pandoc.org/MANUAL.html#math) math typesetting support. Surround your formula by `$...$` to render math as inline, and `$$...$$` to render as block.
<table>
<thead>
<tr>
<th style="text-align:center;width:50%;">Markdown</th>
<th style="text-align:center;width:50%;">Rendered slide</th>
</tr>
</thead>
<tbody>
<tr>
<td>
```tex
Render inline math such as $ax^2+bc+c$.
$$ I_{xx}=\int\int_Ry^2f(x,y)\cdot{}dydx $$
$$
f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}
\,d\xi
$$
```
</td>
<td>
![Math typesetting support](https://user-images.githubusercontent.com/3993388/142782335-15bce585-68f1-4c89-8747-8d11533f3ca6.png)
</td>
</tbody>
</table>
You can choose using library for math from [MathJax](https://www.mathjax.org/) and [KaTeX](https://khan.github.io/KaTeX/) in [`math` global directive](#math-global-directive) (or [JS constructor option](#math-constructor-option)). By default, we prefer MathJax for better rendering and syntax support, but KaTeX is faster rendering if you had a lot of formulas.
#### `math` global directive
Through `math` global directive, Marp Core is supporting to declare math library that will be used within current Markdown.
Set **`mathjax`** or **`katex`** in the `math` global directive like this:
```markdown
---
# Declare to use KaTeX in this Markdown
math: katex
---
$$
\begin{align}
x &= 1+1 \tag{1} \\
&= 2
\end{align}
$$
```
If not declared, Marp Core will use MathJax to render math. But we recommend to declare the library whenever to use math typesetting.
> [!WARNING]
> The declaration of math library is given priority over [`math` JS constructor option](#math-constructor-option), but you cannot turn on again via `math` global directive if disabled math typesetting by the constructor.
---
### Auto-scaling features
Marp Core has some auto-scaling features:
- [**Fitting header**](#fitting-header): Get bigger heading that fit onto the slide by `# <!--fit-->`.
- [**Auto-shrink the code block and KaTeX block**](#auto-shrink-block): Prevent sticking out the block from the right of the slide.
Auto-scaling is available if defined [`@auto-scaling` metadata][metadata] in an using theme CSS.
```css
/*
* @theme foobar
* @auto-scaling true
*/
```
All of [Marp Core's built-in themes][themes] are ready to use full-featured auto scalings. If you're the theme author, you can control target elements which enable auto-scaling [by using metadata keyword(s).][metadata]
This feature depends to inline SVG, so note that it will not working if disabled [Marpit's `inlineSVG` mode](https://github.com/marp-team/marpit#inline-svg-slide-experimental) by setting `inlineSVG: false` in constructor option.
> [!WARNING]
> Auto-scaling is designed for horizontal scaling. In vertical, the scaled element still may stick out from bottom of slide if there are a lot of contents around it.
#### Fitting header
When the headings contains `<!-- fit -->` comment, the size of headings will resize to fit onto the slide size.
```markdown
# <!-- fit --> Fitting header
```
This syntax is similar to [Deckset's `[fit]` keyword](https://docs.decksetapp.com/English.lproj/Formatting/01-headings.html), but we use HTML comment to hide a fit keyword on Markdown rendered as document.
#### Auto-shrink the block
Some of blocks will be shrunk to fit onto the slide. It is useful preventing stuck out the block from the right of the slide.
| | Traditional rendering | Auto-scaling |
| :------------------: | :----------------------------------------------: | :-------------------------------------: |
| **Code block** | ![Traditional rendering](https://bit.ly/2LyEnmi) | ![Auto-scaling](https://bit.ly/2N4yWQZ) |
| **KaTeX math block** | ![Traditional rendering](https://bit.ly/2NXoHuW) | ![Auto-scaling](https://bit.ly/2M6LyCk) |
> [!NOTE]
> MathJax math block will always be scaled without even setting `@auto-scaling` metadata.
---
## Constructor options
You can customize a behavior of Marp parser by passing an options object to the constructor. You can also pass together with [Marpit constructor options](https://marpit-api.marp.app/marpit#Marpit).
> [!NOTE]
>
> [Marpit's `markdown` option](https://marpit-api.marp.app/marpit#Marpit) is accepted only object options because of always using CommonMark.
```javascript
const marp = new Marp({
// marp-core constructor options
html: true,
emoji: {
shortcode: true,
unicode: false,
twemoji: {
base: '/resources/twemoji/',
},
},
math: 'katex',
minifyCSS: true,
script: {
source: 'cdn',
nonce: 'xxxxxxxxxxxxxxx',
},
slug: false,
// It can be included Marpit constructor options
looseYAML: false,
markdown: {
breaks: false,
},
})
```
### `html`: _`boolean`_ | _`object`_
Setting whether to render raw HTML in Markdown. It's an alias to `markdown.html` ([markdown-it option](https://markdown-it.github.io/markdown-it/#MarkdownIt.new)) but has additional feature about HTML allowlist.
- (default): Use Marp's default allowlist.
- `true`: The all HTML will be allowed.
- `false`: All HTML except supported in Marpit Markdown will be disallowed.
By passing `object`, you can set the allowlist to specify allowed tags and attributes.
```javascript
// Specify tag name as key, and attributes to allow as string array.
{
a: ['href', 'target'],
br: [],
}
```
```javascript
// You may use custom attribute sanitizer by passing object.
{
img: {
src: (value) => (value.startsWith('https://') ? value : '')
}
}
```
By default, Marp Core allows known HTML elements and attributes that are considered as safe. That is defined as a readonly `html` member in `Marp` class. [See the full default allowlist in the source code.](src/html/allowlist.ts)
> [!NOTE]
> Whatever any option is selected, `<!-- HTML comment -->` and `<style>` tags are always parsed by Marpit for directives / tweaking style.
### `emoji`: _`object`_
Setting about emoji conversions.
- **`shortcode`**: _`boolean` | `"twemoji"`_
- By setting `false`, it does not convert any emoji shortcodes.
- By setting `true`, it converts emoji shortcodes into Unicode emoji. `:dog:` → 🐶
- By setting `"twemoji"` string, it converts into twemoji vector image. `:dog:`<img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/1f436.svg" alt="🐶" width="16" height="16" valign="middle" /> _(default)_
* **`unicode`**: _`boolean` | `"twemoji"`_
- It can convert Unicode emoji into twemoji when setting `"twemoji"`. 🐶 → <img src="https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/1f436.svg" alt="🐶" width="16" height="16" valign="middle" /> _(default)_
- If you not want this aggressive conversion, please set `false`.
- **`twemoji`**: _`object`_
- **`base`**: _`string`_ - Corresponds to [twemoji's `base` option](https://github.com/twitter/twemoji#object-as-parameter). If not specified, Marp Core will use [online emoji images through jsDelivr CDN](https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/).
- **`ext`**: _`"svg"` | `"png"`_ - Setting the file type of twemoji images. _(`svg` by default)_
> **For developers:** When you setting `unicode` option as `true`, Markdown parser will convert Unicode emoji into tokens internally. The rendering result is same as in `false`.
### `math`: _`boolean` | `"mathjax"` | `"katex"` | `object`_ <a name="math-constructor-option" id="math-constructor-option"></a>
Enable or disable [math typesetting](#math-typesetting) syntax and [`math` global directive](#math-global-directive).
You can choose the default library for math by passing **`"mathjax"`** (default) or **`"katex"`**, and modify more settings by passing an object of sub-options.
- **`lib`**: _`"mathjax"` | `"katex"`_
- Choose the default library for math typesetting. _(`mathjax` by default)_
* **`katexOption`**: _`object`_
- Options that will be passed to KaTeX. Please refer to [KaTeX document](https://khan.github.io/KaTeX/docs/options.html).
- **`katexFontPath`**: _`string` | `false`_
- By default, Marp Core will use [online web-font resources through jsDelivr CDN](https://cdn.jsdelivr.net/npm/katex@latest/dist/fonts/). You have to set path to fonts directory if you want to use local resources. If you set `false`, we will not manipulate the path (Use KaTeX's original path: `fonts/KaTeX_***-***.woff2`).
### `minifyCSS`: _`boolean`_
Enable or disable minification for rendered CSS. `true` by default.
### `script`: _`boolean` | `object`_
Setting about an injected helper script for the browser context. This script is necessary for applying [WebKit polyfill](https://github.com/marp-team/marpit-svg-polyfill) and rendering [auto-scaled elements](#auto-scaling-features) correctly.
- **`true` (default)**: Inject the inline helper script into after the last of slides.
- **`false`**: Don't inject helper script. Developer must execute a helper script manually, exported in [`@marp-team/marp-core/browser`](src/browser.ts). Requires bundler such as [webpack](https://webpack.js.org/). It's suitable to the fully-controlled tool such as [Marp Web](https://github.com/marp-team/marp-web).
You can control details of behavior by passing `object`.
- **`source`**: _`string`_ - Choose the kind of script.
- **`inline`**: Inject the inline script. It would work correctly also in the environment that there is not network. (default)
- **`cdn`**: Inject script referred through [jsDelivr CDN](https://www.jsdelivr.com/). It's better choice on the restricted environment by [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
* **`nonce`**: _`string`_ - Set [`nonce` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-nonce) of `<script>`.
### `slug`: _`boolean` | `function` | `object`_
Configure slugification for headings. By default, Marp Core tries to make the slug by the similar way to GitHub. It should be compatible with [Markdown Language Server](https://code.visualstudio.com/blogs/2022/08/16/markdown-language-server).
- **`true` (default)**: Assign auto-generated `id` attribute from the contents of `<h1>`-`<h6>` headings.
- **`false`**: Disable auto-assigning slug to headings.
- _`function`_: Set the custom slugifier function, that takes one argument: the content of the heading. It must return a generated slug string.
You can control details of behavior by passing `object`.
- **`slugifier`**: _`function`_ - Set the custom slugifier function.
- **`postSlugify`**: _`function`_ - Set the post-process function after generated a slug. The function takes 2 arguments, the string of generated slug and the index of the same slug, and must return a string for assigning to `id` attribute of the heading.
By default, Marp Core applies the post-process to avoid assigning duplicated `id`s in the document: ``(slug, index) => (index > 0 ? `${slug}-${index}` : slug)``
Assigning the custom post-process function is also helpful to append the custom prefix and suffix to the generated slug: `` (slug, i) => `prefix:${slug}:${i}` ``
> [!NOTE]
> Take care not to confuse Marp Core's `slug` option and [Marpit's `anchor` option](https://marpit-api.marp.app/marpit#:~:text=Description-,anchor,-boolean%20%7C%20Marpit). `slug` is for the Markdown headings, and `anchor` is for the slide elements.
>
> `Marp` class is extended from `Marpit` class so you can customize both options in the constructor. To fully disable auto-generated `id` attribute, set both options as `false`. (This is important to avoid breaking your Web application by user's Markdown contents)
## Contributing
Are you interested in contributing? Please see [CONTRIBUTING.md](.github/CONTRIBUTING.md) and [the common contributing guideline for Marp team](https://github.com/marp-team/.github/blob/master/CONTRIBUTING.md).
## Author
Managed by [@marp-team](https://github.com/marp-team).
- <img src="https://github.com/yhatt.png" width="16" height="16"/> Yuki Hattori ([@yhatt](https://github.com/yhatt))
## License
This package releases under the [MIT License](LICENSE).

2
node_modules/@marp-team/marp-core/browser.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from './types/src/browser'
export { default } from './types/src/browser'

1
node_modules/@marp-team/marp-core/browser.js generated vendored Normal file
View File

@@ -0,0 +1 @@
module.exports = require('./lib/browser.cjs')

1
node_modules/@marp-team/marp-core/lib/browser.cjs.js generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/@marp-team/marp-core/lib/browser.js generated vendored Normal file

File diff suppressed because one or more lines are too long

3
node_modules/@marp-team/marp-core/lib/marp.js generated vendored Normal file

File diff suppressed because one or more lines are too long

128
node_modules/@marp-team/marp-core/package.json generated vendored Normal file
View File

@@ -0,0 +1,128 @@
{
"name": "@marp-team/marp-core",
"version": "4.1.0",
"description": "The core of Marp tools",
"license": "MIT",
"author": {
"name": "Marp team",
"url": "https://github.com/marp-team"
},
"contributors": [
{
"name": "Yuki Hattori",
"url": "https://github.com/yhatt"
}
],
"keywords": [
"marp",
"markdown",
"parser",
"slide",
"deck",
"presentation"
],
"repository": {
"type": "git",
"url": "https://github.com/marp-team/marp-core"
},
"main": "lib/marp.js",
"types": "types/src/marp.d.ts",
"files": [
"lib/",
"types/",
"browser.js",
"browser.d.ts"
],
"engines": {
"node": ">=18"
},
"scripts": {
"build": "npm -s run clean && rollup -c",
"check:audit": "npm audit",
"check:format": "npm -s run format -- -c",
"check:ts": "tsc --noEmit",
"clean": "rimraf lib",
"format": "prettier \"**/*.{css,js,json,md,mjs,scss,ts,yaml,yml}\"",
"format:write": "npm -s run format -- --write",
"lint:js": "eslint --cache",
"lint:css": "stylelint \"{src,themes}/**/*.{css,scss}\"",
"prepack": "npm-run-all --parallel check:* lint:* test:coverage --parallel build types",
"preversion": "run-p check:* lint:* test:coverage",
"sandbox": "run-p watch sandbox:watch",
"sandbox:watch": "mkdirp lib && nodemon",
"test": "jest",
"test:coverage": "jest --coverage",
"types": "rimraf types && tsc --declaration --emitDeclarationOnly --outDir types",
"version": "curl https://raw.githubusercontent.com/marp-team/actions/v1/lib/scripts/version.js | node && git add -A CHANGELOG.md",
"watch": "rollup -w -c"
},
"prettier": {
"semi": false,
"singleQuote": true
},
"nodemonConfig": {
"watch": "./lib",
"exec": "npx @marp-team/marp-cli@latest -y"
},
"devDependencies": {
"@csstools/postcss-minify": "^2.0.3",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^28.0.3",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.2",
"@tsconfig/node20": "^20.1.5",
"@tsconfig/recommended": "^1.0.8",
"@twemoji/api": "^16.0.1",
"@types/jest": "^29.5.14",
"autoprefixer": "^10.4.21",
"cheerio": "^1.0.0",
"cssnano": "^7.0.7",
"emoji-regex": "10.4.0",
"eslint": "^9.26.0",
"eslint-config-prettier": "^10.1.5",
"eslint-import-resolver-typescript": "^4.3.4",
"eslint-plugin-import-x": "^4.11.1",
"eslint-plugin-jest": "^28.11.0",
"github-markdown-css": "5.8.1",
"globals": "^16.1.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-plugin-context": "^2.9.0",
"markdown-it": "^14.1.0",
"markdown-it-emoji": "^3.0.0",
"mkdirp": "^3.0.1",
"nodemon": "^3.1.10",
"npm-check-updates": "^18.0.1",
"npm-run-all2": "^8.0.1",
"postcss-url": "^10.1.3",
"prettier": "^3.5.3",
"rimraf": "^6.0.1",
"rollup": "^4.40.2",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-string": "^3.0.0",
"sass": "^1.89.0",
"self-closing-tags": "^1.0.1",
"stylelint": "^16.19.1",
"stylelint-config-standard-scss": "^15.0.0",
"ts-jest": "29.3.3",
"tslib": "^2.8.1",
"typescript": "^5.8.3",
"typescript-eslint": "^8.32.1"
},
"dependencies": {
"@marp-team/marpit": "^3.1.3",
"@marp-team/marpit-svg-polyfill": "^2.1.0",
"highlight.js": "^11.11.1",
"katex": "^0.16.22",
"mathjax-full": "^3.2.2",
"postcss": "^8.5.3",
"postcss-selector-parser": "^7.1.0",
"xss": "^1.0.15"
},
"publishConfig": {
"access": "public"
}
}

View File

@@ -0,0 +1,3 @@
export declare const codeBlockPlugin: Marpit.Plugin<[], {
marpit: Marpit.Marpit;
}>;

View File

@@ -0,0 +1,3 @@
export declare const fittingHeaderPlugin: Marpit.Plugin<[], {
marpit: Marpit.Marpit;
}>;

View File

@@ -0,0 +1,3 @@
export declare const markdown: Marpit.Plugin<[], {
marpit: Marpit.Marpit;
}>;

View File

@@ -0,0 +1,2 @@
import type { Marp } from '../marp';
export declare const isEnabledAutoScaling: (marp: Marp, key?: string) => boolean;

View File

@@ -0,0 +1,23 @@
import { observer } from './observer';
/**
* @internal
* @deprecated
*/
declare const exportedObserver: typeof observer;
export { exportedObserver as observer };
export interface MarpCoreBrowser {
/** Clean-up observer for applying polyfills. */
(): void;
/** Clean-up observer for applying polyfills. */
cleanup: () => void;
/**
* Update DOMs to apply custom elements for Marp Core. It should call whenever
* rendered DOMs rendered by Marp.
*
* It has exactly same meaning to call `browser()` with the same arguments
* again.
*/
update: () => MarpCoreBrowser;
}
export declare const browser: (target?: ParentNode) => MarpCoreBrowser;
export default browser;

View File

@@ -0,0 +1,3 @@
export declare const marpCustomElementsRegisteredSymbol: unique symbol;
export declare const isSupportedCustomizedBuiltInElements: () => boolean;
export declare const applyCustomElements: (target?: ParentNode) => void;

View File

@@ -0,0 +1,21 @@
export declare class MarpAutoScaling extends HTMLElement {
shadowRoot: ShadowRoot;
private container?;
private containerSize?;
private containerObserver;
private svg?;
private svgComputedStyle?;
private svgPreserveAspectRatio;
private wrapper?;
private wrapperSize?;
private wrapperObserver;
constructor();
static get observedAttributes(): string[];
connectedCallback(): void;
disconnectedCallback(): void;
attributeChangedCallback(): void;
private flushSvgDisplay;
private observe;
private observeSVGStyle;
private updateSVGRect;
}

View File

@@ -0,0 +1,352 @@
type Constructor<T = object> = new (...args: any[]) => T;
export declare const createMarpCustomElement: <T extends Constructor<HTMLElement>>(Base: T, { attrs, style }: {
attrs?: Record<string, string>;
style?: string;
}) => {
new (...args: any[]): {
readonly shadowRoot: ShadowRoot | null;
connectedCallback(): void;
attributeChangedCallback(): void;
_shadow(): ShadowRoot | null;
_update(): void;
accessKey: string;
readonly accessKeyLabel: string;
autocapitalize: string;
dir: string;
draggable: boolean;
hidden: boolean;
inert: boolean;
innerText: string;
lang: string;
readonly offsetHeight: number;
readonly offsetLeft: number;
readonly offsetParent: Element | null;
readonly offsetTop: number;
readonly offsetWidth: number;
outerText: string;
popover: string | null;
spellcheck: boolean;
title: string;
translate: boolean;
writingSuggestions: string;
attachInternals(): ElementInternals;
click(): void;
hidePopover(): void;
showPopover(): void;
togglePopover(options?: boolean): boolean;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
readonly attributes: NamedNodeMap;
get classList(): DOMTokenList;
set classList(value: string);
className: string;
readonly clientHeight: number;
readonly clientLeft: number;
readonly clientTop: number;
readonly clientWidth: number;
readonly currentCSSZoom: number;
id: string;
innerHTML: string;
readonly localName: string;
readonly namespaceURI: string | null;
onfullscreenchange: ((this: Element, ev: Event) => any) | null;
onfullscreenerror: ((this: Element, ev: Event) => any) | null;
outerHTML: string;
readonly ownerDocument: Document;
get part(): DOMTokenList;
set part(value: string);
readonly prefix: string | null;
readonly scrollHeight: number;
scrollLeft: number;
scrollTop: number;
readonly scrollWidth: number;
slot: string;
readonly tagName: string;
attachShadow(init: ShadowRootInit): ShadowRoot;
checkVisibility(options?: CheckVisibilityOptions): boolean;
closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
closest<E extends Element = Element>(selectors: string): E | null;
computedStyleMap(): StylePropertyMapReadOnly;
getAttribute(qualifiedName: string): string | null;
getAttributeNS(namespace: string | null, localName: string): string | null;
getAttributeNames(): string[];
getAttributeNode(qualifiedName: string): Attr | null;
getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
getBoundingClientRect(): DOMRect;
getClientRects(): DOMRectList;
getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
getHTML(options?: GetHTMLOptions): string;
hasAttribute(qualifiedName: string): boolean;
hasAttributeNS(namespace: string | null, localName: string): boolean;
hasAttributes(): boolean;
hasPointerCapture(pointerId: number): boolean;
insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
insertAdjacentHTML(position: InsertPosition, string: string): void;
insertAdjacentText(where: InsertPosition, data: string): void;
matches(selectors: string): boolean;
releasePointerCapture(pointerId: number): void;
removeAttribute(qualifiedName: string): void;
removeAttributeNS(namespace: string | null, localName: string): void;
removeAttributeNode(attr: Attr): Attr;
requestFullscreen(options?: FullscreenOptions): Promise<void>;
requestPointerLock(options?: PointerLockOptions): Promise<void>;
scroll(options?: ScrollToOptions): void;
scroll(x: number, y: number): void;
scrollBy(options?: ScrollToOptions): void;
scrollBy(x: number, y: number): void;
scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
scrollTo(options?: ScrollToOptions): void;
scrollTo(x: number, y: number): void;
setAttribute(qualifiedName: string, value: string): void;
setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
setAttributeNode(attr: Attr): Attr | null;
setAttributeNodeNS(attr: Attr): Attr | null;
setHTMLUnsafe(html: string): void;
setPointerCapture(pointerId: number): void;
toggleAttribute(qualifiedName: string, force?: boolean): boolean;
webkitMatchesSelector(selectors: string): boolean;
readonly baseURI: string;
readonly childNodes: NodeListOf<ChildNode>;
readonly firstChild: ChildNode | null;
readonly isConnected: boolean;
readonly lastChild: ChildNode | null;
readonly nextSibling: ChildNode | null;
readonly nodeName: string;
readonly nodeType: number;
nodeValue: string | null;
readonly parentElement: HTMLElement | null;
readonly parentNode: ParentNode | null;
readonly previousSibling: ChildNode | null;
textContent: string | null;
appendChild<T_1 extends Node>(node: T_1): T_1;
cloneNode(subtree?: boolean): Node;
compareDocumentPosition(other: Node): number;
contains(other: Node | null): boolean;
getRootNode(options?: GetRootNodeOptions): Node;
hasChildNodes(): boolean;
insertBefore<T_1 extends Node>(node: T_1, child: Node | null): T_1;
isDefaultNamespace(namespace: string | null): boolean;
isEqualNode(otherNode: Node | null): boolean;
isSameNode(otherNode: Node | null): boolean;
lookupNamespaceURI(prefix: string | null): string | null;
lookupPrefix(namespace: string | null): string | null;
normalize(): void;
removeChild<T_1 extends Node>(child: T_1): T_1;
replaceChild<T_1 extends Node>(node: Node, child: T_1): T_1;
readonly ELEMENT_NODE: 1;
readonly ATTRIBUTE_NODE: 2;
readonly TEXT_NODE: 3;
readonly CDATA_SECTION_NODE: 4;
readonly ENTITY_REFERENCE_NODE: 5;
readonly ENTITY_NODE: 6;
readonly PROCESSING_INSTRUCTION_NODE: 7;
readonly COMMENT_NODE: 8;
readonly DOCUMENT_NODE: 9;
readonly DOCUMENT_TYPE_NODE: 10;
readonly DOCUMENT_FRAGMENT_NODE: 11;
readonly NOTATION_NODE: 12;
readonly DOCUMENT_POSITION_DISCONNECTED: 1;
readonly DOCUMENT_POSITION_PRECEDING: 2;
readonly DOCUMENT_POSITION_FOLLOWING: 4;
readonly DOCUMENT_POSITION_CONTAINS: 8;
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
dispatchEvent(event: Event): boolean;
ariaAtomic: string | null;
ariaAutoComplete: string | null;
ariaBrailleLabel: string | null;
ariaBrailleRoleDescription: string | null;
ariaBusy: string | null;
ariaChecked: string | null;
ariaColCount: string | null;
ariaColIndex: string | null;
ariaColIndexText: string | null;
ariaColSpan: string | null;
ariaCurrent: string | null;
ariaDescription: string | null;
ariaDisabled: string | null;
ariaExpanded: string | null;
ariaHasPopup: string | null;
ariaHidden: string | null;
ariaInvalid: string | null;
ariaKeyShortcuts: string | null;
ariaLabel: string | null;
ariaLevel: string | null;
ariaLive: string | null;
ariaModal: string | null;
ariaMultiLine: string | null;
ariaMultiSelectable: string | null;
ariaOrientation: string | null;
ariaPlaceholder: string | null;
ariaPosInSet: string | null;
ariaPressed: string | null;
ariaReadOnly: string | null;
ariaRelevant: string | null;
ariaRequired: string | null;
ariaRoleDescription: string | null;
ariaRowCount: string | null;
ariaRowIndex: string | null;
ariaRowIndexText: string | null;
ariaRowSpan: string | null;
ariaSelected: string | null;
ariaSetSize: string | null;
ariaSort: string | null;
ariaValueMax: string | null;
ariaValueMin: string | null;
ariaValueNow: string | null;
ariaValueText: string | null;
role: string | null;
animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
getAnimations(options?: GetAnimationsOptions): Animation[];
after(...nodes: (Node | string)[]): void;
before(...nodes: (Node | string)[]): void;
remove(): void;
replaceWith(...nodes: (Node | string)[]): void;
readonly nextElementSibling: Element | null;
readonly previousElementSibling: Element | null;
readonly childElementCount: number;
readonly children: HTMLCollection;
readonly firstElementChild: Element | null;
readonly lastElementChild: Element | null;
append(...nodes: (Node | string)[]): void;
prepend(...nodes: (Node | string)[]): void;
querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
querySelector<E extends Element = Element>(selectors: string): E | null;
querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
replaceChildren(...nodes: (Node | string)[]): void;
readonly assignedSlot: HTMLSlotElement | null;
readonly attributeStyleMap: StylePropertyMap;
get style(): CSSStyleDeclaration;
set style(cssText: string);
contentEditable: string;
enterKeyHint: string;
inputMode: string;
readonly isContentEditable: boolean;
onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
onbeforetoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onerror: OnErrorEventHandler;
onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
autofocus: boolean;
readonly dataset: DOMStringMap;
nonce?: string;
tabIndex: number;
blur(): void;
focus(options?: FocusOptions): void;
};
readonly observedAttributes: string[];
} & T;
export {};

View File

@@ -0,0 +1,81 @@
export declare const elements: {
readonly h1: {
readonly proto: () => {
new (): HTMLHeadingElement;
prototype: HTMLHeadingElement;
};
readonly attrs: {
readonly role: "heading";
readonly 'aria-level': "1";
};
readonly style: "display: block; font-size: 2em; margin-block-start: 0.67em; margin-block-end: 0.67em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;";
};
readonly h2: {
readonly proto: () => {
new (): HTMLHeadingElement;
prototype: HTMLHeadingElement;
};
readonly attrs: {
readonly role: "heading";
readonly 'aria-level': "2";
};
readonly style: "display: block; font-size: 1.5em; margin-block-start: 0.83em; margin-block-end: 0.83em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;";
};
readonly h3: {
readonly proto: () => {
new (): HTMLHeadingElement;
prototype: HTMLHeadingElement;
};
readonly attrs: {
readonly role: "heading";
readonly 'aria-level': "3";
};
readonly style: "display: block; font-size: 1.17em; margin-block-start: 1em; margin-block-end: 1em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;";
};
readonly h4: {
readonly proto: () => {
new (): HTMLHeadingElement;
prototype: HTMLHeadingElement;
};
readonly attrs: {
readonly role: "heading";
readonly 'aria-level': "4";
};
readonly style: "display: block; margin-block-start: 1.33em; margin-block-end: 1.33em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;";
};
readonly h5: {
readonly proto: () => {
new (): HTMLHeadingElement;
prototype: HTMLHeadingElement;
};
readonly attrs: {
readonly role: "heading";
readonly 'aria-level': "5";
};
readonly style: "display: block; font-size: 0.83em; margin-block-start: 1.67em; margin-block-end: 1.67em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;";
};
readonly h6: {
readonly proto: () => {
new (): HTMLHeadingElement;
prototype: HTMLHeadingElement;
};
readonly attrs: {
readonly role: "heading";
readonly 'aria-level': "6";
};
readonly style: "display: block; font-size: 0.67em; margin-block-start: 2.33em; margin-block-end: 2.33em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;";
};
readonly span: {
readonly proto: () => {
new (): HTMLSpanElement;
prototype: HTMLSpanElement;
};
};
readonly pre: {
readonly proto: () => {
new (): HTMLElement;
prototype: HTMLElement;
};
readonly style: "display: block; font-family: monospace; white-space: pre; margin: 1em 0; --marp-auto-scaling-white-space: pre;";
};
};

View File

@@ -0,0 +1 @@
export { customElementsPostCSSPlugin as css } from './postcss-plugin';

View File

@@ -0,0 +1,2 @@
import type { Root } from 'postcss';
export declare const customElementsPostCSSPlugin: (root: Root) => void;

View File

@@ -0,0 +1,14 @@
export interface EmojiOptions {
shortcode?: boolean | 'twemoji';
twemoji?: TwemojiOptions;
unicode?: boolean | 'twemoji';
}
interface TwemojiOptions {
base?: string;
ext?: 'svg' | 'png';
}
export declare const css: (opts: EmojiOptions) => string | undefined;
export declare const markdown: Marpit.Plugin<[], {
marpit: Marpit.Marpit;
}>;
export {};

View File

@@ -0,0 +1 @@
export declare const generateHighlightJSInstance: () => import("highlight.js").HLJSApi;

View File

@@ -0,0 +1,6 @@
export type HTMLAllowList = {
[tag: string]: string[] | {
[attr: string]: boolean | ((value: string) => string);
};
};
export declare const defaultHTMLAllowList: HTMLAllowList;

View File

@@ -0,0 +1 @@
export declare function markdown(md: any): void;

28
node_modules/@marp-team/marp-core/types/src/marp.d.ts generated vendored Normal file
View File

@@ -0,0 +1,28 @@
import { Marpit, Options, ThemeSetPackOptions } from '@marp-team/marpit';
import type { HLJSApi } from 'highlight.js';
import * as emojiPlugin from './emoji/emoji';
import { type HTMLAllowList } from './html/allowlist';
import * as mathPlugin from './math/math';
import * as scriptPlugin from './script/script';
import * as slugPlugin from './slug/slug';
export interface MarpOptions extends Options {
emoji?: emojiPlugin.EmojiOptions;
html?: boolean | HTMLAllowList;
markdown?: object;
math?: mathPlugin.MathOptions;
minifyCSS?: boolean;
script?: boolean | scriptPlugin.ScriptOptions;
slug?: slugPlugin.SlugOptions;
}
export declare class Marp extends Marpit {
readonly options: Required<MarpOptions>;
private _highlightjs;
static readonly html: HTMLAllowList;
constructor(opts?: MarpOptions);
protected applyMarkdownItPlugins(md: any): void;
get highlightjs(): HLJSApi;
highlighter(code: string, lang: string, attrs: string): string;
protected renderStyle(theme?: string): string;
protected themeSetPackOptions(): ThemeSetPackOptions;
}
export default Marp;

View File

@@ -0,0 +1,14 @@
import type { MathOptionsInterface } from './math';
type MathContext = {
/** Whether Markdown is using math syntax */
enabled: boolean;
/** Math options that have passed into Marp Core instance */
options: MathOptionsInterface;
/** Whether Math plugin is processing in the context for current render */
processing: boolean;
katexMacroContext: Record<string, string>;
mathjaxContext: any;
};
export declare const setMathContext: (target: any, setter: (current: MathContext) => MathContext) => void;
export declare const getMathContext: (target: any) => MathContext;
export {};

View File

@@ -0,0 +1,3 @@
export declare const inline: (marpit: any) => (tokens: any, idx: any) => any;
export declare const block: (marpit: any) => (tokens: any, idx: any) => string;
export declare const css: (path?: string | false) => string;

View File

@@ -0,0 +1,11 @@
export type MathPreferredLibrary = 'mathjax' | 'katex';
export interface MathOptionsInterface {
lib?: MathPreferredLibrary;
katexOption?: Record<string, unknown>;
katexFontPath?: string | false;
}
export type MathOptions = boolean | MathPreferredLibrary | MathOptionsInterface;
export declare const markdown: Marpit.Plugin<[], {
marpit: Marpit.Marpit;
}>;
export declare const css: (marpit: any) => string | null;

View File

@@ -0,0 +1,5 @@
export declare const inline: (marpit: any) => (tokens: any, idx: any) => any;
export declare const block: (marpit: any) => ((tokens: any, idx: any) => string) & {
scaled: boolean;
};
export declare const css: (marpit: any) => string;

View File

@@ -0,0 +1,6 @@
type ObserverOptions = {
once?: boolean;
target?: ParentNode;
};
export declare function observer({ once, target, }?: ObserverOptions): () => void;
export default observer;

View File

@@ -0,0 +1,2 @@
declare const placeholder = "This is a placeholder for the content of built browser script.";
export default placeholder;

View File

@@ -0,0 +1,7 @@
interface ScriptOptionsInternal {
nonce?: string;
source: 'inline' | 'cdn';
}
export type ScriptOptions = Partial<ScriptOptionsInternal>;
export declare function markdown(md: any): void;
export {};

View File

@@ -0,0 +1,3 @@
export declare const markdown: Marpit.Plugin<[], {
marpit: Marpit.Marpit;
}>;

View File

@@ -0,0 +1,12 @@
export type Slugifier = (text: string) => string;
export type PostSlugify = (slug: string, index: number) => string;
export type SlugOptions = boolean | Slugifier | SlugOptionsObject;
type SlugOptionsObject = {
slugifier?: Slugifier;
postSlugify?: PostSlugify;
};
export declare const markdown: Marpit.Plugin<[], {
marpit: Marpit.Marpit;
}>;
export declare const githubSlugify: Slugifier;
export {};