Skip to content

Commit

Permalink
Add: some readme documentation on snippets (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-noorbergen authored Jan 3, 2025
1 parent 40c47d7 commit a0f3375
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,23 @@ It also means being open to feedback yourself, and being willing to learn from o

It should be noted that this also means that sometimes pull requests will be rejected.
A rejection does not mean that your contribution is not valued, but rather that it is not a good fit for the project at this point in time.

# Conventions

## Snippets

There are various places where we insert code snippets into the documentation to better visualize what's going on.

Snippets are placed in the `snippets` folder, grouped in subfolders by topic. Each snippet is a separate file per language (based off of its extension), with a central (autogenerated) `.md` file that includes the snippets for each language. If you want to add a new language to a snippet, create the new file, and the build pipeline will automatically include it in the final documentation.

If you are adding the first snippet for a new language, it will need to be defined in `scripts/generate-snippets.py`, so that the build pipeline knows to include the file extension when searching for snippets, and what langauge to use for syntax highlighting.

When adding new snippets, write it in any supported/configured language, and include it as follows:

```markdown
--8<-- "snippets/path/to-filename.md"
```

Note the .md extension to use the autogenerated file, and the `--8<--` to indicate that this is a snippet include.

If a certain topic contains a lot of snippets, it might also be time to create a guide page for that topic, so that newer users can use that guide as a starting point.

0 comments on commit a0f3375

Please sign in to comment.