|
| 1 | +{ // Summary: markdownlint config file. -*- jsonc -*- |
| 2 | + // |
| 3 | + // Note: there are multiple programs programs named "markdownlint". For |
| 4 | + // ReCirq, we use https://github.com/igorshubovych/markdownlint-cli/, which |
| 5 | + // is the one you get with "brew install markdownlint" on MacOS. |
| 6 | + // |
| 7 | + // These settings try to stay close to the Google Markdown Style as |
| 8 | + // described at https://google.github.io/styleguide/docguide/style.html |
| 9 | + // |
| 10 | + // For a list of configuration options, see the following page: |
| 11 | + // https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md |
| 12 | + // (Beware that the above looks similar but is NOT the same as the page |
| 13 | + // https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md.) |
| 14 | + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 | + |
| 16 | + "$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json", |
| 17 | + |
| 18 | + // Require ATX-style headings. |
| 19 | + // https://google.github.io/styleguide/docguide/style.html#atx-style-headings |
| 20 | + "headings": { |
| 21 | + "style": "atx" |
| 22 | + }, |
| 23 | + |
| 24 | + // Google style does not require that the first line of a file is a heading |
| 25 | + // for the title; it only states that the first heading should be a level 1. |
| 26 | + // https://google.github.io/styleguide/docguide/style.html#document-layout |
| 27 | + "first-line-heading": false, |
| 28 | + |
| 29 | + // The Google style does not define what to do about trailing punctuation in |
| 30 | + // headings. The markdownlint default disallows exclamation points, which |
| 31 | + // seems likely to be more annoying than useful – I have definitely seen |
| 32 | + // people use exclamation points in headings in README files on GitHub. |
| 33 | + // This setting removes exclamation point from the banned characters. |
| 34 | + "no-trailing-punctuation": { |
| 35 | + "punctuation": ".,;:。,;:" |
| 36 | + }, |
| 37 | + |
| 38 | + // No trailing spaces. |
| 39 | + // https://google.github.io/styleguide/docguide/style.html#trailing-whitespace |
| 40 | + "whitespace": { |
| 41 | + "br_spaces": 0 |
| 42 | + }, |
| 43 | + |
| 44 | + // Google style exempts some constructs from the line-length limit of 80 chars. |
| 45 | + // https://google.github.io/styleguide/docguide/style.html#exceptions |
| 46 | + "line-length": { |
| 47 | + "code_blocks": false, |
| 48 | + "headings": false, |
| 49 | + "tables": false |
| 50 | + }, |
| 51 | + |
| 52 | + // Google Markdown style specifies 2 spaces after item numbers, 3 spaces |
| 53 | + // after bullets, so that the text itself is consistently indented 4 spaces. |
| 54 | + // https://google.github.io/styleguide/docguide/style.html#nested-list-spacing |
| 55 | + "list-marker-space": { |
| 56 | + "ol_multi": 2, |
| 57 | + "ol_single": 2, |
| 58 | + "ul_multi": 3, |
| 59 | + "ul_single": 3 |
| 60 | + }, |
| 61 | + |
| 62 | + "ul-indent": { |
| 63 | + "indent": 4 |
| 64 | + }, |
| 65 | + |
| 66 | + // Bare URLs are allowed in GitHub-flavored Markdown and in Google’s style. |
| 67 | + "no-bare-urls": false, |
| 68 | + |
| 69 | + // Basic Markdown allows raw HTML. Both GitHub & PyPI support subsets of |
| 70 | + // HTML, though it's unclear what subset PyPI supports. Google's style |
| 71 | + // guide doesn't disallow using HTML, although it recommends against it. (C.f. |
| 72 | + // the bottom of https://google.github.io/styleguide/docguide/style.html) |
| 73 | + // It's worth noting, though, that Google's guidance has Google's internal |
| 74 | + // documentation system in mind, and that system extends Markdown with |
| 75 | + // constructs that make it possible to accomplish things you can't do in |
| 76 | + // Markdown. Those extensions are also not available outside Google's system. |
| 77 | + // Thus, although a goal of this markdownlint configuration is to match |
| 78 | + // Google's style guide as closely as possible, these various factors suggest |
| 79 | + // it's reasonable to relax the HTML limitation. The list below is based on |
| 80 | + // https://github.com/github/markup/issues/245#issuecomment-682231577 plus |
| 81 | + // some things found elsewhere after that was written. |
| 82 | + "html": { |
| 83 | + "allowed_elements": [ |
| 84 | + "a", |
| 85 | + "abbr", |
| 86 | + "b", |
| 87 | + "bdo", |
| 88 | + "blockquote", |
| 89 | + "br", |
| 90 | + "caption", |
| 91 | + "cite", |
| 92 | + "code", |
| 93 | + "dd", |
| 94 | + "del", |
| 95 | + "details", |
| 96 | + "dfn", |
| 97 | + "div", |
| 98 | + "dl", |
| 99 | + "dt", |
| 100 | + "em", |
| 101 | + "figcaption", |
| 102 | + "figure", |
| 103 | + "h1", |
| 104 | + "h2", |
| 105 | + "h3", |
| 106 | + "h4", |
| 107 | + "h5", |
| 108 | + "h6", |
| 109 | + "h7", |
| 110 | + "h8", |
| 111 | + "hr", |
| 112 | + "i", |
| 113 | + "img", |
| 114 | + "ins", |
| 115 | + "kbd", |
| 116 | + "li", |
| 117 | + "mark", |
| 118 | + "ol", |
| 119 | + "p", |
| 120 | + "picture", |
| 121 | + "pre", |
| 122 | + "q", |
| 123 | + "rp", |
| 124 | + "rt", |
| 125 | + "ruby", |
| 126 | + "s", |
| 127 | + "samp", |
| 128 | + "small", |
| 129 | + "source", |
| 130 | + "span", |
| 131 | + "span", |
| 132 | + "strike", |
| 133 | + "strong", |
| 134 | + "sub", |
| 135 | + "summary", |
| 136 | + "sup", |
| 137 | + "table", |
| 138 | + "tbody", |
| 139 | + "td", |
| 140 | + "tfoot", |
| 141 | + "th", |
| 142 | + "thead", |
| 143 | + "time", |
| 144 | + "tr", |
| 145 | + "tt", |
| 146 | + "ul", |
| 147 | + "var", |
| 148 | + "video", |
| 149 | + "wbr" |
| 150 | + ] |
| 151 | + } |
| 152 | +} |
0 commit comments