Basic Syntax / Code

Code

Code formatting is most useful when it removes ambiguity. Commands, file paths, and config names should look different from ordinary prose.

Inline Code

Use inline code for short commands, filenames, and exact values:

Run `npm run build` before publishing. The output goes to `dist/`.

Indented Code Blocks

Basic Markdown supports code blocks by indenting each line with four spaces:

    npm install
    npm run dev
    npm run build

Preview

A common docs sentence: run npm run build and then deploy the contents of dist/ .

npm install
npm run dev
npm run build

Escaping Backticks

If the content itself contains backticks, wrap it with double backticks:

``Use `astro build` when you mean the command itself``

Writing Tips

  • Only format text as code when readers might need to copy it exactly.
  • Keep examples short and runnable. Placeholder code is rarely the most helpful example.
  • When showing output, add a sentence of context so readers know where the snippet comes from.
  • If you need syntax highlighting, move up to fenced code blocks in extended Markdown.

Comments

Comments are currently unavailable.

Enable GitHub Discussions for this repository and complete the giscus configuration to turn comments on.