-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from OI-wiki/remark-13
Update to micromark
- Loading branch information
Showing
66 changed files
with
5,218 additions
and
1,873 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.{js,jsx,json,ts,tsx,yml}] | ||
indent_size = 4 | ||
indent_style = tab | ||
indent_style/tab_width = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
extends: ["eslint:recommended", "plugin:prettier/recommended"], | ||
env: { es6: true, node: true }, | ||
parserOptions: { ecmaVersion: 8 }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm i -g pnpm @antfu/ni | ||
- run: nci | ||
- run: nr test --if-present | ||
- run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
- run: npx conventional-github-releaser -p angular | ||
env: | ||
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x, 16.x] | ||
os: [ubuntu-latest, macos-latest] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Setup | ||
run: npm i -g pnpm @antfu/ni | ||
|
||
- name: Install | ||
run: nci | ||
|
||
- name: Test | ||
run: nr test --if-present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
!/lib | ||
!/LICENSE | ||
!/package.json | ||
!/README.md | ||
!/yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"endOfLine": "auto", | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Plugin } from 'unified'; | ||
declare const remarkDetails: Plugin; | ||
export default remarkDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { h } from 'hastscript'; | ||
import { visit } from 'unist-util-visit'; | ||
import { fromMarkdownDetails } from './mdast-util-details/index.js'; | ||
import { syntax } from './micromark-details/index.js'; | ||
let warningIssued = false; | ||
const remarkDetails = function (options) { | ||
var _a, _b, _c, _d; | ||
const data = this.data(); | ||
// warning for old remarks | ||
if (!warningIssued && | ||
(((_b = (_a = this.Parser) === null || _a === void 0 ? void 0 : _a.prototype) === null || _b === void 0 ? void 0 : _b.blockTokenizers) || | ||
((_d = (_c = this.Compiler) === null || _c === void 0 ? void 0 : _c.prototype) === null || _d === void 0 ? void 0 : _d.visitors))) { | ||
warningIssued = true; | ||
console.warn('[remark-details] Warning: please upgrade to remark 13 to use this plugin'); | ||
} | ||
function add(field, value) { | ||
/* istanbul ignore if - other extensions. */ | ||
if (data[field]) | ||
data[field].push(value); | ||
else | ||
data[field] = [value]; | ||
} | ||
add('micromarkExtensions', syntax); | ||
add('fromMarkdownExtensions', fromMarkdownDetails); | ||
return transform; | ||
function transform(tree) { | ||
visit(tree, ['detailsContainer', 'detailsContainerSummary'], ondetails); | ||
} | ||
function ondetails(node) { | ||
var data = node.data || (node.data = {}); | ||
var hast = h(node.name, node.attributes); | ||
data.hName = hast.tagName; | ||
data.hProperties = hast.properties; | ||
} | ||
}; | ||
export default remarkDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Extension } from 'mdast-util-from-markdown/lib'; | ||
export declare const fromMarkdownDetails: Extension; | ||
export declare const detailsToMarkdown: {}; |
Oops, something went wrong.