This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add specifications for markdown style
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |