File: style_guide.md

package info (click to toggle)
firefox-esr 91.12.0esr-1~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,375,668 kB
  • sloc: cpp: 5,762,032; javascript: 5,481,714; ansic: 3,121,206; python: 851,492; asm: 331,174; xml: 178,949; java: 155,554; sh: 63,704; makefile: 20,127; perl: 12,825; yacc: 4,583; cs: 3,846; objc: 3,026; lex: 1,720; exp: 762; pascal: 635; php: 436; lisp: 260; awk: 231; ruby: 103; sed: 53; sql: 46; csh: 45
file content (58 lines) | stat: -rw-r--r-- 1,996 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# FOG Documentation Style Guide

FOG's Documentation is written in Markdown.
You can find its source at `toolkit/components/glean/docs`.

## Line breaks

We will use [semantic linefeeds]:
* Break anywhere before 80-100 characters
* Break after any punctuation when it makes sense
* Break before or after any markdown when it makes sense

**Tip:** To keep lines narrow, use markdown's [reference link]
feature whenever it makes sense (or all the time. Up to you.).

## Linking to other documentation

Linking to other external documentation is [easy][reference link].
Linking to other pieces of documentation in the source docs might not be.

To link to another markdown page in FOG's documentation, you can use
```md
[link text](page_name.md)
```

Sphinx will automagically transform that to an
appropriately-base-url'd url with a `.html` suffix.

Unfortunately, this doesn't work for linking to
`.rst` files like those in use in [Telemetry]'s documentation.
(Follow [bug 1621950] for updates).

In those cases you have to link it like it's html.
For example, to link to [Telemetry] you can use either of
```md
[Telemetry](../telemetry)
[Telemetry](../telemetry/index.html)
```

Both will work. Both will generate warnings.
For example, the first form will generate this:
```console
None:any reference target not found: ../telemetry
```
But it will still work because linking to a directory in html links to its
`index.html` (which is where `index.rst` ends up).

We can suppress this by putting a fake anchor
(like `#https://`) on the end to fool Sphinx into not checking it.
But that seems like a hack more unseemly than the warnings,
so let's not.


[semantic linefeeds]: https://rhodesmill.org/brandon/2012/one-sentence-per-line/
[reference link]: https://spec.commonmark.org/0.29/#reference-link
[Telemetry]: ../telemetry
[#firefox-source-docs:mozilla.org]: https://chat.mozilla.org/#/room/#firefox-source-docs:mozilla.org
[bug 1621950]: https://bugzilla.mozilla.org/show_bug.cgi?id=1621950