From e5fe828c912cfb4393b51a1e52e76b3b2a786ba8 Mon Sep 17 00:00:00 2001 From: Christian Murphy Date: Tue, 17 Jan 2023 21:02:29 -0700 Subject: [PATCH] sandbox example with deno --- .github/ISSUE_TEMPLATE/1-bug.yml | 1 + .../remark-with-deno/.codesandbox/Dockerfile | 1 + .../remark-with-deno/.codesandbox/tasks.json | 10 ++++++++++ sandbox-templates/remark-with-deno/index.ts | 17 +++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 sandbox-templates/remark-with-deno/.codesandbox/Dockerfile create mode 100644 sandbox-templates/remark-with-deno/.codesandbox/tasks.json create mode 100644 sandbox-templates/remark-with-deno/index.ts diff --git a/.github/ISSUE_TEMPLATE/1-bug.yml b/.github/ISSUE_TEMPLATE/1-bug.yml index 32a2d0a..fa4607a 100644 --- a/.github/ISSUE_TEMPLATE/1-bug.yml +++ b/.github/ISSUE_TEMPLATE/1-bug.yml @@ -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-parcel) | [stackblitz](https://stackblitz.com/github/remarkjs/.github/tree/main/sandbox-templates/remark-with-parcel) | | remark and rehype (for markdown to html) | [codesandbox](https://codesandbox.io/s/github/remarkjs/.github/tree/main/sandbox-templates/remark-rehype-with-parcel) | [stackblitz](https://stackblitz.com/github/remarkjs/.github/tree/main/sandbox-templates/remark-rehype-with-parcel) | | react-markdown | [codesandbox](https://codesandbox.io/s/github/remarkjs/.github/tree/main/sandbox-templates/react-markdown-with-create-react-app) | [stackblitz](https://stackblitz.com/github/remarkjs/.github/tree/main/sandbox-templates/react-markdown-with-create-react-app) | + | remark with deno (for markdown to markdown) | [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: diff --git a/sandbox-templates/remark-with-deno/.codesandbox/Dockerfile b/sandbox-templates/remark-with-deno/.codesandbox/Dockerfile new file mode 100644 index 0000000..dd46808 --- /dev/null +++ b/sandbox-templates/remark-with-deno/.codesandbox/Dockerfile @@ -0,0 +1 @@ +FROM denoland/latest diff --git a/sandbox-templates/remark-with-deno/.codesandbox/tasks.json b/sandbox-templates/remark-with-deno/.codesandbox/tasks.json new file mode 100644 index 0000000..6b43918 --- /dev/null +++ b/sandbox-templates/remark-with-deno/.codesandbox/tasks.json @@ -0,0 +1,10 @@ +{ + "tasks": { + "docker": { + "name": "Run container", + "command": "deno run index.ts", + "runAtStart": true + } + } +} + \ No newline at end of file diff --git a/sandbox-templates/remark-with-deno/index.ts b/sandbox-templates/remark-with-deno/index.ts new file mode 100644 index 0000000..398f774 --- /dev/null +++ b/sandbox-templates/remark-with-deno/index.ts @@ -0,0 +1,17 @@ +import {remark} from "npm:remark" + +const markdown = ` +# heading + +* list +* item + +\`\`\`js +function () {} +\`\`\` +` + +const vfile = await remark().process(markdown) + +console.log("resulting markdown:") +console.log(vfile.value)