Skip to content

Commit

Permalink
feat: Add markdown-it-plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Oct 8, 2024
1 parent a855017 commit 41f336f
Show file tree
Hide file tree
Showing 18 changed files with 689 additions and 16 deletions.
98 changes: 82 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"xpackages/loader",
"xpackages/map",
"xpackages/map-deck",
"packages/markdown-it-plugins",
"xpackages/marshaller",
"packages/observable-shim",
"packages/observablehq-compiler",
Expand Down
47 changes: 47 additions & 0 deletions packages/markdown-it-plugins/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "test-browser",
"type": "msedge",
"request": "launch",
"url": "http://localhost:8888",
"webRoot": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
],
},
{
"name": "test-node",
"type": "node",
"request": "launch",
"runtimeArgs": [
"run-script",
"test-node"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
],
},
{
"name": "index.html",
"request": "launch",
"type": "msedge",
"url": "file:///${workspaceFolder}/index.html",
"runtimeArgs": [
"--disable-web-security"
],
"webRoot": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
]
}
]
}
36 changes: 36 additions & 0 deletions packages/markdown-it-plugins/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "gen-types-watch",
"type": "npm",
"script": "gen-types-watch",
"problemMatcher": [
"$tsc-watch"
],
"presentation": {
"group": "group-build"
}
},
{
"label": "bundle-watch",
"type": "npm",
"script": "bundle-watch",
"problemMatcher": [],
"presentation": {
"group": "group-build"
}
},
{
"label": "build",
"dependsOn": [
"gen-types-watch",
"bundle-watch",
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
7 changes: 7 additions & 0 deletions packages/markdown-it-plugins/esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { nodeTpl, browserTpl } from "@hpcc-js/esbuild-plugins";

// config ---
await Promise.all([
nodeTpl("src/index.ts", "dist/index.node", { externalx: ["@observablehq/runtime", "@observablehq/stdlib", "@observablehq/inspector"] }),
browserTpl("src/index.ts", "dist/index", { externalx: ["@observablehq/runtime", "@observablehq/stdlib", "@observablehq/inspector"] })
]);
22 changes: 22 additions & 0 deletions packages/markdown-it-plugins/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + TS</title>
</head>

<body>
<div>
<p id="min">min</p>
</div>
<hr>
<div>
<p id="full">full</p>
</div>
<script type="module" src="/tests/index.ts"></script>
</body>

</html>
Loading

0 comments on commit 41f336f

Please sign in to comment.