readability-cli 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,845 @@
1
+ # Markdown style guide
2
+
3
+ Much of what makes Markdown refreshing is the ability to write plain text and get
4
+ great formatted output as a result. To keep the slate clean for the next author,
5
+ your Markdown should be simple and consistent with the whole corpus wherever
6
+ possible.
7
+
8
+ We seek to balance three goals:
9
+
10
+ 1. *Source text is readable and portable.*
11
+ 2. *The Markdown corpus is maintainable over time and across teams.*
12
+ 3. *The syntax is simple and easy to remember.*
13
+
14
+ Contents:
15
+
16
+ 1. [Minimum viable documentation](#minimum-viable-documentation)
17
+ 1. [Better is better than best](#better-is-better-than-best)
18
+ 1. [Capitalization](#capitalization)
19
+ 1. [Document layout](#document-layout)
20
+ 1. [Table of contents](#table-of-contents)
21
+ 1. [Character line limit](#character-line-limit)
22
+ 1. [Trailing whitespace](#trailing-whitespace)
23
+ 1. [Headings](#headings)
24
+ 1. [ATX-style headings](#atx-style-headings)
25
+ 1. [Use unique, complete names for headings](#use-unique-complete-names-for-headings)
26
+ 1. [Add spacing to headings](#add-spacing-to-headings)
27
+ 1. [Use a single H1 heading](#use-a-single-h1-heading)
28
+ 1. [Capitalization of titles and headers](#capitalization-of-titles-and-headers)
29
+ 1. [Lists](#lists)
30
+ 1. [Use lazy numbering for long lists](#use-lazy-numbering-for-long-lists)
31
+ 1. [Nested list spacing](#nested-list-spacing)
32
+ 1. [Code](#code)
33
+ 1. [Inline](#inline)
34
+ 1. [Use code span for escaping](#use-code-span-for-escaping)
35
+ 1. [Codeblocks](#codeblocks)
36
+ 1. [Declare the language](#declare-the-language)
37
+ 1. [Escape newlines](#escape-newlines)
38
+ 1. [Use fenced code blocks instead of indented code blocks](#use-fenced-code-blocks-instead-of-indented-code-blocks)
39
+ 1. [Nest codeblocks within lists](#nest-codeblocks-within-lists)
40
+ 1. [Links](#links)
41
+ 1. [Use explicit paths for links within Markdown](#use-explicit-paths-for-links-within-markdown)
42
+ 1. [Avoid relative paths unless within the same directory](#avoid-relative-paths-unless-within-the-same-directory)
43
+ 1. [Use informative Markdown link titles](#use-informative-markdown-link-titles)
44
+ 1. [Reference links](#reference-links)
45
+ 1. [Use reference links for long links](#use-reference-links-for-long-links)
46
+ 1. [Use reference links to reduce duplication](#use-reference-links-to-reduce-duplication)
47
+ 1. [Define reference links after their first use](#define-reference-links-after-their-first-use)
48
+ 1. [Images](#images)
49
+ 1. [Tables](#tables)
50
+ 1. [Strongly prefer Markdown to HTML](#strongly-prefer-markdown-to-html)
51
+
52
+ ## Minimum viable documentation
53
+
54
+ A small set of fresh and accurate docs is better than a sprawling, loose
55
+ assembly of "documentation" in various states of disrepair.
56
+
57
+ The **Markdown way** encourages engineers to take ownership of their docs and
58
+ keep them up to date with the same zeal we keep our tests in good order. Strive
59
+ for this.
60
+
61
+ * Identify what you really need: release docs, API docs, testing guidelines.
62
+ * Delete cruft frequently and in small batches.
63
+
64
+ ## Better is better than best
65
+
66
+ The standards for an internal documentation review are different from the
67
+ standards for code reviews. Reviewers should ask for improvements, but in
68
+ general, the author should always be able to invoke the "Better/Best Rule."
69
+
70
+ Fast iteration is your friend. To get long-term improvement, **authors must stay
71
+ productive** when making short-term improvements. Set lower standards for each
72
+ CL, so that **more such CLs** can happen.
73
+
74
+ As a reviewer of a documentation CL:
75
+
76
+ 1. When reasonable, LGTM immediately and trust that comments will be fixed
77
+ appropriately.
78
+ 2. Prefer to suggest an alternative rather than leaving a vague comment.
79
+ 3. For substantial changes, start your own follow-up CL instead. Especially try
80
+ to avoid comments of the form "You should *also*...".
81
+ 4. On rare occasions, hold up submission if the CL actually makes the docs
82
+ worse. It's okay to ask the author to revert.
83
+
84
+ As an author:
85
+
86
+ 1. Avoid wasting cycles with trivial argument. Capitulate early and move on.
87
+ 2. Cite the Better/Best Rule as often as needed.
88
+
89
+ ## Capitalization
90
+
91
+ Use the original names of products, tools and binaries, preserving the
92
+ capitalization. E.g.:
93
+
94
+ ```markdown
95
+ # Markdown style guide
96
+
97
+ `Markdown` is a dead-simple platform for internal engineering documentation.
98
+ ```
99
+
100
+ and not
101
+
102
+ ```markdown
103
+ # markdown bad style guide example
104
+
105
+ `markdown` is a dead-simple platform for internal engineering documentation.
106
+ ```
107
+
108
+ ## Document layout
109
+
110
+ In general, documents benefit from some variation of the following layout:
111
+
112
+ ```markdown
113
+ # Document Title
114
+
115
+ Short introduction.
116
+
117
+ [TOC]
118
+
119
+ ## Topic
120
+
121
+ Content.
122
+
123
+ ## See also
124
+
125
+ * https://link-to-more-info
126
+ ```
127
+
128
+ 1. `# Document title`: The first heading should be a level-one heading, ideally
129
+ the same or nearly the same as the filename. The first level-one heading is
130
+ used as the page `<title>`.
131
+
132
+ 1. `author`: *Optional*. If you'd like to claim ownership of the document or
133
+ if you are very proud of it, add yourself under the title. However,
134
+ revision history generally suffices.
135
+
136
+ 1. `Short introduction.` 1–3 sentences providing a high-level overview of the
137
+ topic. Imagine yourself as a complete newbie who landed on your "Extending Foo" doc
138
+ and doesn't know the most basic information you take for granted. "What is
139
+ Foo? Why would I extend it?"
140
+
141
+ 1. `[TOC]`: if you use hosting that supports table of contents, such as Gitiles,
142
+ put `[TOC]` after the short introduction. See [`[TOC]` documentation][TOC-docs].
143
+
144
+ 1. `## Topic`: The rest of your headings should start from level 2.
145
+
146
+ 1. `## See also`: Put miscellaneous links at the bottom for the user who wants
147
+ to know more or didn't find what they needed.
148
+
149
+ [TOC-docs]: https://gerrit.googlesource.com/gitiles/+/HEAD/Documentation/markdown.md#Table-of-contents
150
+
151
+ ## Table of contents
152
+
153
+ ### Use a `[TOC]` directive
154
+
155
+ Use a [`[TOC]` directive][TOC-docs] unless all
156
+ of your content is above the fold[^above] on a laptop.
157
+
158
+ [^above]: Content is "above the fold" if it is visible when the page is first
159
+ displayed. Content is "below the fold" if it is hidden until the user
160
+ scrolls down the page on a computer or literally unfolds a document
161
+ such as a newspaper.
162
+
163
+ ### Place the `[TOC]` directive after the introduction
164
+
165
+ Place the `[TOC]` directive after your page's introduction and before the first
166
+ H2 heading. For example:
167
+
168
+ ```markdown
169
+ # My Page
170
+
171
+ This is my introduction **before** the TOC.
172
+
173
+ [TOC]
174
+
175
+ ## My first H2
176
+ ```
177
+
178
+ ```markdown
179
+ # My Page
180
+
181
+ [TOC]
182
+
183
+ This is my introduction **after** the TOC where it should not be.
184
+
185
+ ## My first H2
186
+ ```
187
+
188
+ For users who read your documentation visually, it doesn't matter where your
189
+ `[TOC]` directive is placed, as Markdown always displays the TOC toward the top and
190
+ to the right of the page. However, `[TOC]` placement matters a lot when screen
191
+ readers or keyboard controls are involved.
192
+
193
+ That's because `[TOC]` inserts the HTML for the table of contents into the DOM
194
+ wherever you've included the directive in your Markdown file. If, for example,
195
+ you place the directive at the very bottom of your file, screen readers won't
196
+ read it until they get to the end of the document.
197
+
198
+ ## Character line limit
199
+
200
+ Markdown content follows the residual convention of an 80-character line limit.
201
+ Why? Because it's what most of us do for code.
202
+
203
+ * **Tooling integration**: All our tooling is designed around code, so the
204
+ more our documents are formatted according to similar rules, the better
205
+ these tools will work. For example, Code Search doesn't soft wrap.
206
+
207
+ * **Quality**. The more engineers use their well-worn coding habits when
208
+ creating and editing Markdown content, the better the quality. Markdown takes
209
+ advantage of the excellent review culture we already have.
210
+
211
+ ### Exceptions
212
+
213
+ Exceptions to the 80-character rule include:
214
+
215
+ * Links
216
+ * Tables
217
+ * Headings
218
+ * Code blocks
219
+
220
+ This means that lines with links are allowed to extend past column 80, along
221
+ with any relevant punctuation:
222
+
223
+ ```markdown
224
+ * See the
225
+ [foo docs](https://gerrit.googlesource.com/gitiles/+/HEAD/Documentation/markdown.md).
226
+ and find the logfile.
227
+ ```
228
+
229
+ However, note that text before and after the link gets wrapped.
230
+
231
+ Tables may also run long. However, there are
232
+ [best practices for creating short, readable tables](#tables).
233
+
234
+ ```markdown
235
+ Foo | Bar | Baz
236
+ ----------------------------------------------------------------------------- | --- | ---
237
+ Somehow-unavoidable-long-cell-filled-with-content-that-simply-refuses-to-wrap | Foo | Bar
238
+ ```
239
+
240
+ ## Trailing whitespace
241
+
242
+ Don't use trailing whitespace. Use a trailing backslash to break lines.
243
+
244
+ The [CommonMark spec](http://spec.commonmark.org/0.20/#hard-line-breaks) decrees
245
+ that two spaces at the end of a line should insert a `<br />` tag. However, many
246
+ directories have a presubmit check for trailing whitespace, and many IDEs will
247
+ clean it up anyway.
248
+
249
+ Use a trailing backslash, sparingly:
250
+
251
+ ```markdown
252
+ For some reason I just really want a break here,\
253
+ though it's probably not necessary.
254
+ ```
255
+
256
+ Best practice is to avoid the need for a `<br />` altogether. A pair of newlines
257
+ will create a paragraph tag; get used to that.
258
+
259
+ ## Headings
260
+
261
+ ### ATX-style headings
262
+
263
+ ```markdown
264
+ # Heading 1
265
+
266
+ ## Heading 2
267
+ ```
268
+
269
+ Headings with `=` or `-` underlines can be annoying to maintain and don't fit
270
+ with the rest of the heading syntax. An editor has to ask: Does `---` mean H1 or
271
+ H2?
272
+
273
+ ```markdown
274
+ Heading - do you remember what level? DO NOT DO THIS.
275
+ ---------
276
+ ```
277
+
278
+ ### Use unique, complete names for headings
279
+
280
+ Use unique and fully descriptive names for each heading, even for sub-sections.
281
+ Since link anchors are constructed from headings, this helps ensure that the
282
+ automatically-constructed anchor links are intuitive and clear.
283
+
284
+ For example, instead of:
285
+
286
+ ```markdown
287
+ ## Foo
288
+ ### Summary
289
+ ### Example
290
+ ## Bar
291
+ ### Summary
292
+ ### Example
293
+ ```
294
+
295
+ prefer:
296
+
297
+ ```markdown
298
+ ## Foo
299
+ ### Foo summary
300
+ ### Foo example
301
+ ## Bar
302
+ ### Bar summary
303
+ ### Bar example
304
+ ```
305
+
306
+ ### Add spacing to headings
307
+
308
+ Prefer spacing after `#` and newlines before and after:
309
+
310
+ ```markdown
311
+ ...text before.
312
+
313
+ ## Heading 2
314
+
315
+ Text after...
316
+ ```
317
+
318
+ Lack of spacing makes it a little harder to read in source:
319
+
320
+ ```markdown
321
+ ...text before.
322
+
323
+ ##Heading 2
324
+ Text after... DO NOT DO THIS.
325
+ ```
326
+
327
+ ### Use a single H1 heading
328
+
329
+ Use one H1 heading as the title of your document. Subsequent headings should be
330
+ H2 or deeper. See [Document layout](#document-layout) for more information.
331
+
332
+ ### Capitalization of titles and headers
333
+
334
+ Follow the guidance for
335
+ [capitalization](https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings)
336
+ in the
337
+ [Google Developer Documentation Style Guide](https://developers.google.com/style/).
338
+
339
+ ## Lists
340
+
341
+ ### Use lazy numbering for long lists
342
+
343
+ Markdown is smart enough to let the resulting HTML render your numbered lists
344
+ correctly. For longer lists that may change, especially long nested lists, use
345
+ "lazy" numbering:
346
+
347
+ ```markdown
348
+ 1. Foo.
349
+ 1. Bar.
350
+ 1. Foofoo.
351
+ 1. Barbar.
352
+ 1. Baz.
353
+ ```
354
+
355
+ However, if the list is small and you don't anticipate changing it, prefer fully
356
+ numbered lists, because it's nicer to read in source:
357
+
358
+ ```markdown
359
+ 1. Foo.
360
+ 2. Bar.
361
+ 3. Baz.
362
+ ```
363
+
364
+ ### Nested list spacing
365
+
366
+ When nesting lists, use a 4-space indent for both numbered and bulleted lists:
367
+
368
+ ```markdown
369
+ 1. Use 2 spaces after the item number, so the text itself is indented 4 spaces.
370
+ Use a 4-space indent for wrapped text.
371
+ 2. Use 2 spaces again for the next item.
372
+
373
+ * Use 3 spaces after a bullet, so the text itself is indented 4 spaces.
374
+ Use a 4-space indent for wrapped text.
375
+ 1. Use 2 spaces with numbered lists, as before.
376
+ Wrapped text in a nested list needs an 8-space indent.
377
+ 2. Looks nice, doesn't it?
378
+ * Back to the bulleted list, indented 3 spaces.
379
+ ```
380
+
381
+ The following works, but it's very messy:
382
+
383
+ ```markdown
384
+ * One space,
385
+ with no indent for wrapped text.
386
+ 1. Irregular nesting... DO NOT DO THIS.
387
+ ```
388
+
389
+ Even when there's no nesting, using the 4 space indent makes layout consistent
390
+ for wrapped text:
391
+
392
+ ```markdown
393
+ * Foo,
394
+ wrapped with a 4-space indent.
395
+
396
+ 1. Two spaces for the list item
397
+ and 4 spaces before wrapped text.
398
+ 2. Back to 2 spaces.
399
+ ```
400
+
401
+ However, when lists are small, not nested, and a single line, one space can
402
+ suffice for both kinds of lists:
403
+
404
+ ```markdown
405
+ * Foo
406
+ * Bar
407
+ * Baz.
408
+
409
+ 1. Foo.
410
+ 2. Bar.
411
+ ```
412
+
413
+ ## Code
414
+
415
+ ### Inline
416
+
417
+ &#96;Backticks&#96; designate `inline code` that will be rendered literally. Use
418
+ them for short code quotations, field names, and more:
419
+
420
+ ```markdown
421
+ You'll want to run `really_cool_script.sh arg`.
422
+
423
+ Pay attention to the `foo_bar_whammy` field in that table.
424
+ ```
425
+
426
+ Use inline code when referring to file types in a generic sense, rather than a
427
+ specific existing file:
428
+
429
+ ```markdown
430
+ Be sure to update your `README.md`!
431
+ ```
432
+
433
+ ### Use code span for escaping
434
+
435
+ When you don't want text to be processed as normal Markdown, like a fake path or
436
+ example URL that would lead to a bad autolink, wrap it in backticks:
437
+
438
+ ```markdown
439
+ An example Markdown shortlink would be: `Markdown/foo/Markdown/bar.md`
440
+
441
+ An example query might be: `https://www.google.com/search?q=$TERM`
442
+ ```
443
+
444
+ ### Codeblocks
445
+
446
+ For code quotations longer than a single line, use a fenced code block:
447
+
448
+ <pre>
449
+ ```python
450
+ def Foo(self, bar):
451
+ self.bar = bar
452
+ ```
453
+ </pre>
454
+
455
+ #### Declare the language
456
+
457
+ It is best practice to explicitly declare the language, so that neither the
458
+ syntax highlighter nor the next editor must guess.
459
+
460
+ #### Use fenced code blocks instead of indented code blocks
461
+
462
+ Four-space indenting is also interpreted as a code block. However, we strongly
463
+ recommend fencing for all code blocks.
464
+
465
+ Indented code blocks can sometimes look cleaner in the source, but they have
466
+ several drawbacks:
467
+
468
+ * You cannot specify the language. Some Markdown features are tied to language
469
+ specifiers.
470
+ * The beginning and end of the code block are ambiguous.
471
+ * Indented code blocks are harder to search for in Code Search.
472
+
473
+ ```markdown
474
+ You'll need to run:
475
+
476
+ bazel run :thing -- --foo
477
+
478
+ And then:
479
+
480
+ bazel run :another_thing -- --bar
481
+
482
+ And again:
483
+
484
+ bazel run :yet_again -- --baz
485
+ ```
486
+
487
+ #### Escape newlines
488
+
489
+ Because most command-line snippets are intended to be copied and pasted directly
490
+ into a terminal, it's best practice to escape any newlines. Use a single
491
+ backslash at the end of the line:
492
+
493
+ <pre>
494
+ ```shell
495
+ $ bazel run :target -- --flag --foo=longlonglonglonglongvalue \
496
+ --bar=anotherlonglonglonglonglonglonglonglonglonglongvalue
497
+ ```
498
+ </pre>
499
+
500
+ #### Nest codeblocks within lists
501
+
502
+ If you need a code block within a list, make sure to indent it so as to not
503
+ break the list:
504
+
505
+ ```markdown
506
+ * Bullet.
507
+
508
+ ```c++
509
+ int foo;
510
+ ```
511
+
512
+ * Next bullet.
513
+ ```
514
+
515
+ You can also create a nested code block with 4 spaces. Simply indent 4
516
+ additional spaces from the list indentation:
517
+
518
+ ```markdown
519
+ * Bullet.
520
+
521
+ int foo;
522
+
523
+ * Next bullet.
524
+ ```
525
+
526
+ ## Links
527
+
528
+ Long links make source Markdown difficult to read and break the 80 character
529
+ wrapping. **Wherever possible, shorten your links**.
530
+
531
+ ### Use explicit paths for links within Markdown
532
+
533
+ Use the explicit path for Markdown links. For example:
534
+
535
+ ```markdown
536
+ [...](/path/to/other/markdown/page.md)
537
+ ```
538
+
539
+ You don't need to use the entire qualified URL:
540
+
541
+ ```markdown
542
+ [...](https://bad-full-url.example.com/path/to/other/markdown/page.md)
543
+ ```
544
+
545
+ ### Avoid relative paths unless within the same directory
546
+
547
+ Relative paths are fairly safe within the same directory. For example:
548
+
549
+ ```markdown
550
+ [...](other-page-in-same-dir.md)
551
+ [...](/path/to/another/dir/other-page.md)
552
+ ```
553
+
554
+ Avoid relative links if you need to specify other directories with `../`:
555
+
556
+ ```markdown
557
+ [...](../../bad/path/to/another/dir/other-page.md)
558
+ ```
559
+
560
+ ### Use informative Markdown link titles
561
+
562
+ Markdown link syntax allows you to set a link title. Use it wisely. Users often
563
+ do not read documents; they scan them.
564
+
565
+ Links catch the eye. But titling your links "here," "link," or simply
566
+ duplicating the target URL tells the hasty reader precisely nothing and is a
567
+ waste of space:
568
+
569
+ ```markdown
570
+ DO NOT DO THIS.
571
+
572
+ See the Markdown guide for more info: [link](markdown.md), or check out the
573
+ style guide [here](style.md).
574
+
575
+ Check out a typical test result:
576
+ [https://example.com/foo/bar](https://example.com/foo/bar).
577
+ ```
578
+
579
+ Instead, write the sentence naturally, then go back and wrap the most
580
+ appropriate phrase with the link:
581
+
582
+ ```markdown
583
+ See the [Markdown guide](markdown.md) for more info, or check out the
584
+ [style guide](style.md).
585
+
586
+ Check out a
587
+ [typical test result](https://example.com/foo/bar).
588
+ ```
589
+
590
+ ### Reference
591
+
592
+ For long links or image URLs, you may want to split the link use from the link
593
+ definition, like this:
594
+
595
+ <!-- Known bug: We use a zero-width non-breaking space (U+FEFF) here to prevent -->
596
+ <!-- reference links from rendering within code blocks. -->
597
+
598
+ ```markdown
599
+ See the [Markdown style guide][style], which has suggestions for making docs more
600
+ readable.
601
+
602
+ [style]: http://Markdown/corp/Markdown/docs/reference/style.md
603
+ ```
604
+
605
+ #### Use reference links for long links
606
+
607
+ Use reference links where the length of the link would detract from the
608
+ readability of the surrounding text if it were inlined. Reference links make it
609
+ harder to see the destination of a link in source text, and add additional
610
+ syntax.
611
+
612
+ In this example, reference link usage is not appropriate, because the link is
613
+ not long enough to disrupt the flow of the text:
614
+
615
+ ```markdown
616
+ DO NOT DO THIS.
617
+
618
+ The [style guide][style_guide] says not to use reference links unless you have
619
+ to.
620
+
621
+ [style_guide]: https://google.com/Markdown-style
622
+ ```
623
+
624
+ Just inline it instead:
625
+
626
+ ```markdown
627
+ https://google.com/Markdown-style says not to use reference links unless you have to.
628
+ ```
629
+
630
+ In this example, the link destination is long enough that it makes sense to use
631
+ a reference link:
632
+
633
+ ```markdown
634
+ The [style guide] says not to use reference links unless you have to.
635
+
636
+ [style guide]: https://docs.google.com/document/d/13HQBxfhCwx8lVRuN2Wf6poqvAfVeEXmFVcawP5I6B3c/edit
637
+ ```
638
+
639
+ Use reference links more often in tables. It is particularly important to keep
640
+ table content short, since Markdown does not provide a facility to break text in
641
+ cell tables across multiple lines, and smaller tables are more readable.
642
+
643
+ For example, this table's readability is worsened by inline links:
644
+
645
+ ```markdown
646
+ DO NOT DO THIS.
647
+
648
+ Site | Description
649
+ ---------------------------------------------------------------- | -----------------------
650
+ [site 1](http://google.com/excessively/long/path/example_site_1) | This is example site 1.
651
+ [site 2](http://google.com/excessively/long/path/example_site_2) | This is example site 2.
652
+ ```
653
+
654
+ Instead, use reference links to keep the line length manageable:
655
+
656
+ ```markdown
657
+ Site | Description
658
+ -------- | -----------------------
659
+ [site 1] | This is example site 1.
660
+ [site 2] | This is example site 2.
661
+
662
+ [site 1]: http://google.com/excessively/long/path/example_site_1
663
+ [site 2]: http://google.com/excessively/long/path/example_site_2
664
+ ```
665
+
666
+ #### Use reference links to reduce duplication
667
+
668
+ Consider using reference links when referencing the same link destination
669
+ multiple times in a document, to reduce duplication.
670
+
671
+ #### Define reference links after their first use
672
+
673
+ We recommend putting reference link definitions just before the next heading, at
674
+ the end of the section in which they're first used. If your editor has its own
675
+ opinion about where they should go, don't fight it; the tools always win.
676
+
677
+ We define a "section" as all text between two headings. Think of reference links
678
+ like footnotes, and the current section like the current page.
679
+
680
+ This arrangement makes it easy to find the link destination in source view,
681
+ while keeping the flow of text free from clutter. In long documents with lots of
682
+ reference links, it also prevents "footnote overload" at the bottom of the file,
683
+ which makes it difficult to pick out the relevant link destination.
684
+
685
+ There is one exception to this rule: reference link definitions that are used in
686
+ multiple sections should go at the end of the document. This avoids dangling
687
+ links when a section is updated or moved.
688
+
689
+ In the following example, the reference definition is far from its initial use,
690
+ which makes the document harder to read:
691
+
692
+ ```markdown
693
+ # Header FOR A BAD DOCUMENT
694
+
695
+ Some text with a [link][link_def].
696
+
697
+ Some more text with the same [link][link_def].
698
+
699
+ ## Header 2
700
+
701
+ ... lots of text ...
702
+
703
+ ## Header 3
704
+
705
+ Some more text using a [different_link][different_link_def].
706
+
707
+ [link_def]: http://reallyreallyreallylonglink.com
708
+ [different_link_def]: http://differentreallyreallylonglink.com
709
+ ```
710
+
711
+ Instead, put it just before the header following its first use:
712
+
713
+ ```markdown
714
+ # Header
715
+
716
+ Some text with a [link][link_def].
717
+
718
+ Some more text with the same [link][link_def].
719
+
720
+ [link_def]: http://reallyreallyreallylonglink.com
721
+
722
+ ## Header 2
723
+
724
+ ... lots of text ...
725
+
726
+ ## Header 3
727
+
728
+ Some more text using a [different_link][different_link_def].
729
+
730
+ [different_link_def]: http://differentreallyreallylonglink.com
731
+ ```
732
+
733
+ ## Images
734
+
735
+ See [image syntax](https://gerrit.googlesource.com/gitiles/+/HEAD/Documentation/markdown.md#Images).
736
+
737
+ Use images sparingly, and prefer simple screenshots. This guide is designed
738
+ around the idea that plain text gets users down to the business of communication
739
+ faster with less reader distraction and author procrastination. However, it's
740
+ sometimes very helpful to show what you mean.
741
+
742
+ * Use images when it's easier to *show* a reader something than to *describe
743
+ it*. For example, explaining how to navigate a UI is often easier with an
744
+ image than text.
745
+ * Make sure to provide appropriate text to describe your image. Readers who
746
+ are not sighted cannot see your image and still need to understand the
747
+ content! See the alt text best practices below.
748
+
749
+ ## Tables
750
+
751
+ Use tables when they make sense: for the presentation of tabular data that needs
752
+ to be scanned quickly.
753
+
754
+ Avoid using tables when your data could easily be presented in a list. Lists are
755
+ much easier to write and read in Markdown.
756
+
757
+ For example:
758
+
759
+ ```markdown
760
+ DO NOT DO THIS
761
+
762
+ Fruit | Metrics | Grows on | Acute curvature | Attributes | Notes
763
+ ------ | ------------ | -------- | ------------------ | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------
764
+ Apple | Very popular | Trees | | [Juicy](http://cs/SomeReallyReallyReallyReallyReallyReallyReallyReallyLongQuery), Firm, Sweet | Apples keep doctors away.
765
+ Banana | Very popular | Trees | 16 degrees average | [Convenient](http://cs/SomeDifferentReallyReallyReallyReallyReallyReallyReallyReallyLongQuery), Soft, Sweet | Contrary to popular belief, most apes prefer mangoes. Don't you? See the [design doc][banana_v2] for the newest hotness in bananiels.
766
+ ```
767
+
768
+ This table illustrates a few typical problems:
769
+
770
+ * **Poor distribution**: Several columns don't differ across rows, and some
771
+ cells are empty. This is usually a sign that your data may not benefit from
772
+ tabular display.
773
+
774
+ * **Unbalanced dimensions**: There are a small number of rows relative to
775
+ columns. When this ratio is unbalanced in either direction, a table becomes
776
+ little more than an inflexible format for text.
777
+
778
+ * **Rambling prose** in some cells. Tables should tell a succinct story at a
779
+ glance.
780
+
781
+ [Lists](#lists) and subheadings sometimes suffice to present the same
782
+ information. Let's see this data in list form:
783
+
784
+ ```markdown
785
+ ## Fruits
786
+
787
+ Both types are highly popular, sweet, and grow on trees.
788
+
789
+ ### Apple
790
+
791
+ * [Juicy](http://SomeReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongURL)
792
+ * Firm
793
+
794
+ Apples keep doctors away.
795
+
796
+ ### Banana
797
+
798
+ * [Convenient](http://cs/SomeDifferentReallyReallyReallyReallyReallyReallyReallyReallyLongQuery)
799
+ * Soft
800
+ * 16 degrees average acute curvature.
801
+
802
+ Contrary to popular belief, most apes prefer mangoes. Don't you?
803
+
804
+ See the [design doc][banana_v2] for the newest hotness in bananiels.
805
+ ```
806
+
807
+ The list form is more spacious, and arguably therefore much easier for the
808
+ reader to find what interests her in this case.
809
+
810
+ However, there are times a table is the best choice. When you have:
811
+
812
+ * Relatively uniform data distribution across two dimensions.
813
+ * Many parallel items with distinct attributes.
814
+
815
+ In those cases, a table format is just the thing. In fact, a compact table can
816
+ improve readability:
817
+
818
+ ```markdown
819
+ Transport | Favored by | Advantages
820
+ ---------------- | -------------- | -----------------------------------------------
821
+ Swallow | Coconuts | [Fast when unladen][airspeed]
822
+ Bicycle | Miss Gulch | [Weatherproof][tornado_proofing]
823
+ X-34 landspeeder | Whiny farmboys | [Cheap][tosche_station] since the XP-38 came out
824
+
825
+ [airspeed]: http://google3/airspeed.h
826
+ [tornado_proofing]: http://google3/kansas/
827
+ [tosche_station]: http://google3/power_converter.h
828
+ ```
829
+
830
+ Note that [reference links](#reference-links) are used to keep the table cells
831
+ manageable.
832
+
833
+ ## Strongly prefer Markdown to HTML
834
+
835
+ Please prefer standard Markdown syntax wherever possible and avoid HTML hacks.
836
+ If you can't seem to accomplish what you want, reconsider whether you really
837
+ need it. Except for [big tables](#tables), Markdown meets almost all needs
838
+ already.
839
+
840
+ Every bit of HTML hacking reduces the readability and portability of our
841
+ Markdown corpus. This in turn limits the usefulness of integrations with other
842
+ tools, which may either present the source as plain text or render it. See
843
+ [Philosophy](philosophy.md).
844
+
845
+ Gitiles does not render HTML.