Skip to content

Commit

Permalink
Add deno example
Browse files Browse the repository at this point in the history
Closes GH-8.

Co-authored-by: Christian Murphy <[email protected]>
  • Loading branch information
wooorm and ChristianMurphy committed Sep 24, 2024
1 parent e01096f commit ca87c2d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/1-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ body:
| remark only (for markdown to markdown) | [codesandbox](https://codesandbox.io/s/github/remarkjs/.github/tree/main/sandbox-templates/remark-with-vite) | [stackblitz](https://stackblitz.com/github/remarkjs/.github/tree/main/sandbox-templates/remark-with-vite) |
| remark and rehype (for markdown to html) | [codesandbox](https://codesandbox.io/s/github/remarkjs/.github/tree/main/sandbox-templates/remark-rehype-with-vite) | [stackblitz](https://stackblitz.com/github/remarkjs/.github/tree/main/sandbox-templates/remark-rehype-with-vite) |
| react-markdown | [codesandbox](https://codesandbox.io/s/github/remarkjs/.github/tree/main/sandbox-templates/react-markdown-with-vite) | [stackblitz](https://stackblitz.com/github/remarkjs/.github/tree/main/sandbox-templates/react-markdown-with-vite) |
| remark only (for markdown to markdown, deno) | [codesandbox](https://codesandbox.io/s/github/remarkjs/.github/tree/main/sandbox-templates/remark-with-deno) | :no_entry: |
Alternatively, use the next section *Steps to reproduce*.
validations:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
*.lock
package-lock.json
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
"browser"
],
"overrides": [
{
"files": [
"sandbox-templates/remark-with-deno/**/*.ts"
],
"rules": {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off"
}
},
{
"files": [
"sandbox-templates/**/*.tsx"
Expand Down
9 changes: 9 additions & 0 deletions sandbox-templates/remark-with-deno/.codesandbox/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"tasks": {
"docker": {
"command": "deno run index.ts",
"name": "Run container",
"runAtStart": true
}
}
}
1 change: 1 addition & 0 deletions sandbox-templates/remark-with-deno/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM denoland/latest
15 changes: 15 additions & 0 deletions sandbox-templates/remark-with-deno/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {remark} from 'npm:remark'

const markdown = `
# Pluto
**Pluto** (minor-planet designation: *134340 Pluto*)
is a
[dwarf planet](https://en.wikipedia.org/wiki/Dwarf_planet)
in the
[Kuiper belt](https://en.wikipedia.org/wiki/Kuiper_belt).
`

const file = await remark().process(markdown)

console.log(String(file))

0 comments on commit ca87c2d

Please sign in to comment.