-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- feat: Add tests and deno.jsonc - feat: Add CI for tests - fix: Remove blockquotes format on last line - fix: Move ruler's new line outside colors.reset - chore: Lint
- Loading branch information
Showing
30 changed files
with
581 additions
and
38 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,35 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.config.kind }} ${{ matrix.config.os }} | ||
runs-on: ${{ matrix.config.os }} | ||
timeout-minutes: 5 | ||
strategy: | ||
matrix: | ||
config: | ||
- os: macOS-latest | ||
kind: test | ||
- os: windows-latest | ||
kind: test | ||
- os: ubuntu-latest | ||
kind: test | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install deno | ||
uses: denolib/setup-deno@master | ||
with: | ||
deno-version: 1.24.0 | ||
|
||
- name: Running tests | ||
if: matrix.config.kind == 'test' | ||
run: deno task test |
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
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,17 @@ | ||
{ | ||
"tasks": { | ||
"example": "deno run --unstable example.ts", | ||
"bundle:mdast": "deno bundle --no-check ./mdast_shimmed_dep.ts mdast-util-from-markdown@1_2_0-shimmed.js", | ||
"docs:gen": "deno run -A --unstable ./docs/snapper.ts", | ||
"test": "deno test --allow-read=./test" | ||
}, | ||
"fmt": { | ||
"files": { | ||
"exclude": [ | ||
"./mdast-util-from-markdown@1_2_0-shimmed.js", | ||
"./test/testCases", | ||
"./test/exampleOutput.out" | ||
] | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
export * as colors from 'https://deno.land/std@0.82.0/fmt/colors.ts'; | ||
export * as colors from 'https://deno.land/std@0.105.0/fmt/colors.ts'; | ||
|
||
import { mdast, gfmStrikethroughFromMarkdown, gfmStrikethrough } from './mdast-util-from-markdown@1_2_0-shimmed.js'; | ||
export const strikethroughExt = gfmStrikethroughFromMarkdown; | ||
export const strike = gfmStrikethrough; | ||
// deno-lint-ignore no-explicit-any | ||
export type mdastFromMarkdownFn = (markdown: string, encodig?: string, options?: {extensions?: any[], mdastExtensions?: any[]}) => any; | ||
export const fromMarkdown: mdastFromMarkdownFn = mdast; |
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
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
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,188 @@ | ||
[1m[4m[31m# deno charmd[39m[24m[22m | ||
|
||
This is an example, to showcase https://github.com/littletof/charmd | ||
|
||
If you want to test the module with your own markdown, provide its [7m path [27m as an argument and make sure [7m --allow-read [27m is also provided. | ||
|
||
[47m[30m[3m codeblock [bash][23m[39m[37m [39m[49m | ||
[100m [49m[100m[90m [39m[49m | ||
[100m[90m [39m[49m[100m[30m[3mdeno run --allow-read https://raw.githubusercontent.com/littletof/charmd/master/mod.ts ./README.md[23m[39m[49m[100m[90m [39m[49m | ||
[100m [49m[100m[90m [39m[49m | ||
|
||
[33m[1m## Headers[22m[39m | ||
|
||
[1m[4m[31m# h1 Heading[39m[24m[22m | ||
|
||
[1m[4m[31m# h1 Heading with [7m === [27m[39m[24m[22m | ||
|
||
[33m[1m## h2 Heading[22m[39m | ||
|
||
[33m[1m## h2 Heading with [7m --- [27m[22m[39m | ||
|
||
[32m[1m### h3 Heading[22m[39m | ||
|
||
[35m[1m#### h4 Heading[22m[39m | ||
|
||
[36m[1m##### h5 Heading[22m[39m | ||
|
||
[34m[1m###### h6 Heading[22m[39m | ||
|
||
[0m________________________________________________________________________________[0m | ||
|
||
[33m[1m## Emphasis[22m[39m | ||
|
||
[1mThis is bold text [7m ** [27m[22m | ||
|
||
[1mThis is bold text [7m __ [27m[22m | ||
|
||
[3mThis is italic text [7m * [27m[23m | ||
|
||
[3mThis is italic text [7m _ [27m[23m | ||
|
||
[9mThis is strikethrough[29m [7m ~~ [27m | ||
|
||
[1man [3mitalic[23m in bold[22m | ||
|
||
[9m[1man [3mitalic[23m in bold with [7m striketrough [27m[22m[29m | ||
|
||
[33m[1m## Blockquotes[22m[39m | ||
|
||
┃ [90m[3mBlockquotes can also be nested...[23m[39m | ||
┃ [90m[3m┃ [90m[3m...by using additional greater-than signs right next to each other...[3m[90m[23m[39m | ||
┃ [90m[3m┃ [90m[3m┃ [90m[3m...or with spaces between arrows.[3m[90m[3m[90m[23m[39m | ||
|
||
┃ [90m[3mSome quote[23m[39m | ||
┃ [90m[3mand more[23m[39m | ||
|
||
┃ [90m[3m┃ [90m[3mAnother quote[3m[90m[23m[39m | ||
|
||
┃ [90m[3mSome quote[23m[39m | ||
┃ [90m[3mwith [1mbold[22m and [7m block [27m[23m[39m | ||
┃ [90m[3m┃ [90m[3mand Another quote[3m[90m[23m[39m | ||
┃ [90m[3m┃ [90m[3m┃ [90m[3m┃ [90m[3m[35m[1m#### and some more quote[22m[90m[3m[90m[3m[90m[3m[90m[23m[39m | ||
|
||
[33m[1m## Lists[22m[39m | ||
|
||
[32m[1m### Unordered[22m[39m | ||
|
||
[90m- [39mCreate a list by starting a line with [7m + [27m, [7m - [27m, or [7m * [27m | ||
[90m◦ [39mIndented list item: | ||
[90m▪ [39mSubsublist item | ||
[90m▸ [39mSubsublist item | ||
[90m- [39mMain list item | ||
|
||
[32m[1m### Ordered[22m[39m | ||
|
||
[90m1. [39mLorem ipsum dolor sit amet | ||
[90m2. [39mConsectetur adipiscing elit | ||
[90m3. [39mInteger molestie lorem at massa | ||
|
||
[32m[1m### Task List[22m[39m | ||
|
||
[90m- [39m[x] Some | ||
[90m- [39m[ ] Other | ||
|
||
[33m[1m## Code[22m[39m | ||
|
||
Inline [7m code [27m [3m[7m italics [27m[23m [1m[7m bold [27m[22m [3m[1m[7m both [27m[22m[23m | ||
|
||
Indented code | ||
|
||
[47m[30m[3m codeblock [23m[39m[37m [39m[49m | ||
[100m [49m[100m[90m [39m[49m | ||
[100m[90m [39m[49m[100m[30m[3m// Some comments[23m[39m[49m[100m[90m [39m[49m | ||
[100m[90m [39m[49m[100m[30m[3mline 1 of code[23m[39m[49m[100m[90m [39m[49m | ||
[100m[90m [39m[49m[100m[30m[3mline 2 of code[23m[39m[49m[100m[90m [39m[49m | ||
[100m[90m [39m[49m[100m[30m[3mline 3 of code[23m[39m[49m[100m[90m [39m[49m | ||
[100m [49m[100m[90m [39m[49m | ||
|
||
Block code "fences" | ||
|
||
[47m[30m[3m codeblock [23m[39m[37m [39m[49m | ||
[100m [49m[100m[90m [39m[49m | ||
[100m[90m [39m[49m[100m[30m[3mSample text here...[23m[39m[49m[100m[90m [39m[49m | ||
[100m [49m[100m[90m [39m[49m | ||
|
||
Codeblock with lang | ||
|
||
[47m[30m[3m codeblock [ts][23m[39m[37m [39m[49m | ||
[100m [49m[100m[90m [39m[49m | ||
[100m[90m [39m[49m[100m[30m[3mfunction sum(...nums: number[]): number {[23m[39m[49m[100m[90m [39m[49m | ||
[100m[90m [39m[49m[100m[30m[3m return nums.reduce((sum, num) => sum + num, 0);[23m[39m[49m[100m[90m [39m[49m | ||
[100m[90m [39m[49m[100m[30m[3m}[23m[39m[49m[100m[90m [39m[49m | ||
[100m [49m[100m[90m [39m[49m | ||
|
||
[33m[1m## Horizontal Rules[22m[39m | ||
|
||
[0m________________________________________________________________________________[0m | ||
|
||
[0m________________________________________________________________________________[0m | ||
|
||
[0m________________________________________________________________________________[0m | ||
|
||
[0m________________________________________________________________________________[0m | ||
|
||
[0m________________________________________________________________________________[0m | ||
|
||
[0m________________________________________________________________________________[0m | ||
|
||
[33m[1m## Tables[22m[39m | ||
|
||
┌────────┬────────┬────────┐ | ||
│ [34m[1ma[22m[39m │ [34m[1mb[22m[39m │ [34m[1mc[22m[39m │ | ||
├────────┼────────┼────────┤ | ||
│ 123 │ 456 │ 789 │ | ||
├────────┼────────┼────────┤ | ||
│ ABCDEF │ DEFGHI │ GHIJKL │ | ||
└────────┴────────┴────────┘ | ||
|
||
┌───────┬───────┬────────┬────────────────────────────────────┐ | ||
│ [34m[1mleft1[22m[39m │ [34m[1mleft2[22m[39m │ [34m[1mcenter[22m[39m │ [34m[1mright[22m[39m │ | ||
├───────┼───────┼────────┼────────────────────────────────────┤ | ||
│ 123 │ 456 │ 789 │ 101 │ | ||
├───────┼───────┼────────┼────────────────────────────────────┤ | ||
│ [7m ABC [27m │ [1mDEF[22m │ [3mGHI[23m │ [90m[3mImage: ![image](docs/showcase.png)[23m[39m │ | ||
└───────┴───────┴────────┴────────────────────────────────────┘ | ||
|
||
┃ [90m[3m┌────────┬────────┬────────┐[23m[39m | ||
┃ [90m[3m│ [34m[1ma[22m[90m │ [34m[1mb[22m[90m │ [34m[1mc[22m[90m │[23m[39m | ||
┃ [90m[3m├────────┼────────┼────────┤[23m[39m | ||
┃ [90m[3m│ 123 │ 456 │ 789 │[23m[39m | ||
┃ [90m[3m├────────┼────────┼────────┤[23m[39m | ||
┃ [90m[3m│ ABCDEF │ DEFGHI │ GHIJKL │[23m[39m | ||
┃ [90m[3m└────────┴────────┴────────┘[23m[39m | ||
|
||
[33m[1m## Links[22m[39m | ||
|
||
[36m[Deno](https://deno.land)[39m | ||
[36m[Bottom](#bottom)[39m | ||
[36m[3m[LinkReference][23m[39m | ||
|
||
[90m[3m[36m[LinkReference][90m: [](https://deno.land/x) | ||
[23m[39m | ||
[36m[link with title](https://deno.land)[39m | ||
Autoconverted link https://deno.land | ||
|
||
[33m[1m## Images[22m[39m | ||
|
||
[90m[3mImage: ![Deno](https://deno.land/logo.svg)[23m[39m | ||
[90m[3mImage: ![Deno](https://deno.land/logo.svg)[23m[39m | ||
|
||
[90m[3mImage reference: ![Alt text][36m[id][90m[23m[39m | ||
|
||
[90m[3m[36m[id][90m: [Deno logo](https://deno.land/logo.svg) | ||
[23m[39m | ||
[33m[1m## HTML[22m[39m | ||
|
||
[90m<h2>HTML</h2> | ||
<hr /> | ||
<div>Some `<div>` tag</div> | ||
<strong>and **<strong>** tag</strong> | ||
<br /> | ||
<footer align="center" id="bottom"> | ||
<a href="#headers-"> | ||
<strong>Top</strong> | ||
<i class="fas fa-chevron-up"></i> | ||
</a> | ||
</footer>[39m | ||
[0m________________________________________________________________________________[0m |
Oops, something went wrong.