You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `auto-js` and `with-hole` meta attributes are custom Docusaurus plugins that we wrote, implemented at
105
+
[./src/remark/auto-js-code.ts](./src/remark/auto-js-code.ts) and [./src/remark/code-with-hole.ts](./src/remark/code-with-hole.ts).
106
+
107
+
`auto-js` specifically is backed by [ts-blank-space](https://github.com/bloomberg/ts-blank-space), which will _only_ remove the
108
+
type annotations and not process anything else. Thus, some edge-cases can arise, so we recommend to run `npm run start` and
109
+
check the output JS in the browser to see if everything looks good.
110
+
111
+
Known caveats are:
112
+
- Run `prettier` on the code before pasting it in the document, as `auto-js` will enforce it.
113
+
- Remember to add a `type` specifier to `import`s we don't want to appear in the JS
114
+
-`// highlight-next-line` comment before a TS-only line will hang around and highlight the wrong line. Use `// highlight-start` and `// highlight-end` instead.
115
+
- It doesn't replace file names' extensions in clarification comments (this is mostly unique to the tutorial pages).
0 commit comments