Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function greet(name: string): string {
```
````

When `src/greet.ts` changes, run your checks, then `mdcode update --apply README.md` again. CI runs the same two steps in the same order, with `--check` instead of `--apply`:
When `src/greet.ts` changes, run your checks, then `mdcode update --apply README.md` again. In CI, run the same two steps in the same order, with `--check` instead of `--apply`:

```bash
npm run lint && npm test # check the code where it lives
Expand Down
2 changes: 1 addition & 1 deletion packages/mdcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ They suit different snippets:
- An example that should be complete, tested code belongs in a source or test file, and mdcode copies it into the docs.
- A fragment that only makes sense in the prose, such as a single call or part of a config, can stay in the Markdown, where a snippet checker type-checks it.

mdcode can also run your own type checker over blocks written in the Markdown. [`validate-snippets.mjs`](#validating-runnable-snippets-in-ci) extracts the `runnable=true` blocks into a temporary workspace and runs a command such as `tsc --noEmit` there. A failure names the block on the command line; nothing shows in your editor.
For blocks written in the Markdown, the ready-to-copy [`validate-snippets.mjs`](#validating-runnable-snippets-in-ci) script can run your own type checker. It extracts the `runnable=true` blocks into a temporary workspace with `mdcode extract` and runs a command such as `tsc --noEmit` there. A failure names the block on the command line; nothing shows in your editor.

## Installation

Expand Down
Loading