Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
add specifications for markdown style
Browse files Browse the repository at this point in the history
  • Loading branch information
norswap committed Jan 24, 2022
1 parent 331ea87 commit a92c5d7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
6 changes: 6 additions & 0 deletions meta/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Meta Processes

This directory describes processes that we use to build the specification.

- [Linting](linting.md): how to lint source files.
- [Markdown Style Guide](markdown-style.md): how to format and structure Markdown files.
42 changes: 42 additions & 0 deletions meta/markdown-style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Markdown Style Guide

## Linting

Respect the [linting rules] (you can run the linter with `yarn lint`).

Notably:

- lines should be < 120 characters long
- in practice, some of our files are justified at 100 characters, some at 120

[linting rules]: linting.md#markdown

## Links

In general:

- Use link references preferentially.
- e.g. `[my text][link-ref]` and then on its own line `[link-ref]: https://mylink.com`
- e.g. `[my text]` and then on its own line: `[my text]: https://mylink.com`
- exceptions: where it fits neatly on a single line, in particular in lists of links
- Excepted for internal and glossary links (see below), add the link reference definition directly
after the paragraph where the link first appears.

### Glossary

- Use links to the [glossary] liberally.
- Include the references to all the glossary links at the top of the file, under the top-level
title.
- A glossary link reference should start with the `g-` prefix. This enables to see what links to the
glossary at a glance when editing the specification.
- e.g. `[g-block]: glossary.md#block`
- Example: [Rollup Node Specification source][rollup-node]

[glossary]: ../specs/glossary.md
[rollup-node]: https://raw.githubusercontent.com/ethereum-optimism/optimistic-specs/main/specs/rollup-node.md

## Internal (In-File) Links

If linking to another heading to the same file, add the link reference directly under that heading.
This makes it easier to keep the heading and the link in-sync, and signals that the heading is being
linked to from elsewhere.

0 comments on commit a92c5d7

Please sign in to comment.