extramark 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +13 -10
- package/bin/extramark.js +3 -3
- package/lib/critic.js +11 -0
- package/package.json +11 -17
- package/{src → lib}/index.js +3 -3
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2018-
|
|
3
|
+
Copyright (c) 2018-2026 Márton Visnovitz
|
|
4
4
|
|
|
5
5
|
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:
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
# ExtraMark
|
|
2
2
|
|
|
3
|
-
[![License][badge
|
|
4
|
-
[![Version][badge
|
|
3
|
+
[![License][license-badge]][license-link]
|
|
4
|
+
[![Version][version-badge]][version-link]
|
|
5
|
+
[![Build][build-badge]][build-link]
|
|
5
6
|
|
|
6
|
-
[
|
|
7
|
-
[link-license]: https://github.com/vimtaai/extramark/blob/master/LICENSE.md
|
|
8
|
-
[badge-version]: https://img.shields.io/npm/v/extramark.svg
|
|
9
|
-
[link-version]: https://npmjs.com/package/extramark
|
|
7
|
+
Superset of [CommonMark](https://commonmark.org/) that includes syntax extensions that are commonly used by other Markdown dialects. The list and syntax for the extensions are decided by looking at the most popular Markdown dialects and selecting the most common syntax for each feature. The goal of the project is to create a (somewhat) standard superset of CommonMark that supports the features that are requested by most. The parser is based on [markdown-it](https://github.com/markdown-it/markdown-it) and uses plugins for syntax extensions.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
9
|
+
## Setup
|
|
14
10
|
|
|
15
11
|
Install via `npm`:
|
|
16
12
|
|
|
@@ -85,4 +81,11 @@ extramark --help
|
|
|
85
81
|
|
|
86
82
|
## Contributing
|
|
87
83
|
|
|
88
|
-
All ideas, recommendations, bug reports, pull requests are welcome.
|
|
84
|
+
All ideas, recommendations, bug reports, pull requests are welcome. 😊
|
|
85
|
+
|
|
86
|
+
[license-badge]: https://img.shields.io/npm/l/extramark.svg
|
|
87
|
+
[license-link]: https://github.com/vimtaai/extramark/blob/master/LICENSE.md
|
|
88
|
+
[version-badge]: https://img.shields.io/npm/v/extramark.svg
|
|
89
|
+
[version-link]: https://npmjs.com/package/extramark
|
|
90
|
+
[build-badge]: https://github.com/vimtaai/extramark/actions/workflows/main.yaml/badge.svg
|
|
91
|
+
[build-link]: https://github.com/vimtaai/extramark/actions/workflows/main.yaml
|
package/bin/extramark.js
CHANGED
|
@@ -9,11 +9,11 @@ import { styleText } from "node:util";
|
|
|
9
9
|
import { program } from "commander";
|
|
10
10
|
import { html } from "common-tags";
|
|
11
11
|
|
|
12
|
-
import { render } from "../
|
|
12
|
+
import { render } from "../lib/index.js";
|
|
13
13
|
|
|
14
14
|
program
|
|
15
15
|
.description("CLI for converting Markdown documents to HTML with ExtraMark")
|
|
16
|
-
.
|
|
16
|
+
.argument("<input>", "path of the input .md file")
|
|
17
17
|
.option("-o --output [path]", "path of the output .html file")
|
|
18
18
|
.option("-c --css [css]", "path to the CSS file to use for formatting")
|
|
19
19
|
.option("-t --title [title]", "title of the output document")
|
|
@@ -54,7 +54,7 @@ try {
|
|
|
54
54
|
await mkdir(dirname(outputFile), { recursive: true });
|
|
55
55
|
await writeFile(outputFile, data.parsed);
|
|
56
56
|
} else {
|
|
57
|
-
stdout.write(data.parsed
|
|
57
|
+
stdout.write(`${data.parsed}\n`);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
if (outputFile && !options.quiet) {
|
package/lib/critic.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { render } from "critic-markup";
|
|
2
|
+
|
|
3
|
+
function criticMarkupRule(state) {
|
|
4
|
+
state.src = render(state.src);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function markdownItCriticMarkup(md) {
|
|
8
|
+
md.core.ruler.before("block", "critic-markup", criticMarkupRule);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default markdownItCriticMarkup;
|
package/package.json
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extramark",
|
|
3
|
-
"version": "2.0
|
|
4
|
-
"description": "CommonMark superset with
|
|
5
|
-
"author": "Márton Visnovitz <
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "CommonMark superset with widely used syntax extensions",
|
|
5
|
+
"author": "Márton Visnovitz <vimtaai@pm.me>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github:vimtaai/extramark",
|
|
8
8
|
"type": "module",
|
|
9
|
-
"main": "
|
|
9
|
+
"main": "lib/index.js",
|
|
10
10
|
"bin": "bin/extramark.js",
|
|
11
11
|
"files": [
|
|
12
|
-
"
|
|
13
|
-
"bin/**/*.js"
|
|
12
|
+
"{lib,bin}/**/*.js"
|
|
14
13
|
],
|
|
15
14
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
15
|
+
"check": "biome check",
|
|
16
|
+
"check:ci": "biome ci",
|
|
17
|
+
"check:fix": "biome check --write"
|
|
19
18
|
},
|
|
20
19
|
"dependencies": {
|
|
21
|
-
"commander": "^
|
|
20
|
+
"commander": "^14.0.3",
|
|
22
21
|
"common-tags": "^1.8.2",
|
|
23
|
-
"critic-markup": "^2.0.
|
|
22
|
+
"critic-markup": "^2.0.1",
|
|
24
23
|
"markdown-it": "^14.1.0",
|
|
25
24
|
"markdown-it-abbr": "^2.0.0",
|
|
26
25
|
"markdown-it-anchor": "^9.2.0",
|
|
@@ -30,11 +29,6 @@
|
|
|
30
29
|
"markdown-it-sup": "^2.0.0"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
35
|
-
"@semantic-release/git": "^10.0.1",
|
|
36
|
-
"eslint": "^9.17.0",
|
|
37
|
-
"prettier": "^3.4.2",
|
|
38
|
-
"semantic-release": "^24.2.2"
|
|
32
|
+
"@biomejs/biome": "^2.4.2"
|
|
39
33
|
}
|
|
40
34
|
}
|
package/{src → lib}/index.js
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import MarkdownIt from "markdown-it";
|
|
2
2
|
|
|
3
|
+
import abbr from "markdown-it-abbr";
|
|
3
4
|
import anchor from "markdown-it-anchor";
|
|
4
5
|
import deflist from "markdown-it-deflist";
|
|
5
|
-
import sup from "markdown-it-sup";
|
|
6
|
-
import sub from "markdown-it-sub";
|
|
7
|
-
import abbr from "markdown-it-abbr";
|
|
8
6
|
import footnote from "markdown-it-footnote";
|
|
7
|
+
import sub from "markdown-it-sub";
|
|
8
|
+
import sup from "markdown-it-sup";
|
|
9
9
|
|
|
10
10
|
import critic from "./critic.js";
|
|
11
11
|
|