|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Markdown Lint Tool Documentation |
| 4 | +--- |
| 5 | + |
| 6 | +{% assign book = site.data.markdown_lint.book %} |
| 7 | +<!-- todo: check - can we use book.contents - why? why not? --> |
| 8 | +{% assign book_contents = site.data.markdown_lint.contents %} |
| 9 | + |
| 10 | + |
| 11 | +<!-- cover --> |
| 12 | + |
| 13 | +<h1>{{ book.title }}</h1> |
| 14 | +<h3>by {{ book.author.name }}</h3> |
| 15 | + |
| 16 | +<!-- fix: use book.subtitle --> |
| 17 | +<p>A tool to check markdown files and flag style issues</p> |
| 18 | + |
| 19 | +<!-- table of contents --> |
| 20 | + |
| 21 | +<div class='toc'> |
| 22 | + |
| 23 | +Contents |
| 24 | + |
| 25 | +<ul> |
| 26 | +{% for part in book_contents %} |
| 27 | + <li>{{ part.title }} |
| 28 | + <ul> |
| 29 | + {% for chapter in part.sections %} |
| 30 | + <li>{{ chapter.title }}</li> |
| 31 | + {% endfor %} |
| 32 | + </ul> |
| 33 | + </li> |
| 34 | +{% endfor %} |
| 35 | +</ul> |
| 36 | +</div> |
| 37 | + |
| 38 | + |
| 39 | +<h2>Preface</h1> |
| 40 | + |
| 41 | +<p> |
| 42 | +<b>Note:</b> The book edition is still an early release and a work-in-progess. |
| 43 | +</p> |
| 44 | + |
| 45 | +<p> |
| 46 | +This is the <a href="https://github.com/mivok/markdownlint">official documentation</a> |
| 47 | +for the markdown lint style rules checker |
| 48 | +reformatted in a single-page book edition. |
| 49 | +</p> |
| 50 | + |
| 51 | +<p> |
| 52 | +See the <a href="https://github.com/manuscripts/manuscripts.github.io">source repo</a> for how |
| 53 | +the book gets auto-built with a static site builder and hosted on GitHub Pages. |
| 54 | +</p> |
| 55 | + |
| 56 | + |
| 57 | +<p> |
| 58 | +Questions? Comments? |
| 59 | +Send them along to the |
| 60 | +<a href="http://groups.google.com/group/wwwmake">wwwmake mailing list/forum</a> |
| 61 | +Thanks. |
| 62 | +</p> |
| 63 | + |
| 64 | +<p> |
| 65 | +Onwards. |
| 66 | +</p> |
| 67 | + |
| 68 | + |
| 69 | +<h2>Acknowledgments</h2> |
| 70 | + |
| 71 | +<p> |
| 72 | +Thanks to Mark Harrison and contributors for making it all possible. |
| 73 | +</p> |
| 74 | + |
| 75 | + |
| 76 | +<!-- chapters --> |
| 77 | + |
| 78 | +{% for part in book_contents %} |
| 79 | + <h1 class="part">Part {{ forloop.index }} - {{ part.title }}</h1> |
| 80 | + |
| 81 | + {% assign part_index = forloop.index %} |
| 82 | + {% for chapter in part.sections %} |
| 83 | +<div class="chapter"> |
| 84 | + <h1>Chapter {{ part_index }}.{{ forloop.index }} - {{ chapter.title }}</h1> |
| 85 | + |
| 86 | + <!-- add mini table of contents for chapter if available --> |
| 87 | + {% if chapter.sections %} |
| 88 | + Contents |
| 89 | + <ul> |
| 90 | + {% for sec in chapter.sections %} |
| 91 | + <li>{{ sec.title }} |
| 92 | + {% if sec.sections %} |
| 93 | + <ul> |
| 94 | + {% for subsec in sec.sections %} |
| 95 | + <li>{{ subsec.title }}</li> |
| 96 | + {% endfor %} |
| 97 | + </ul> |
| 98 | + {% endif %} |
| 99 | + </li> |
| 100 | + {% endfor %} |
| 101 | + </ul> |
| 102 | + {% endif %} |
| 103 | + |
| 104 | + <!-- try adding content using include_relative --> |
| 105 | + {% capture txt %}{% include_relative _markdown-lint/{{chapter.path}} %}{% endcapture %} |
| 106 | + |
| 107 | + <!-- hack: cut off yaml front matter header |
| 108 | + possible alternative??: |
| 109 | + try to use collection and use a content lookup with title or path - why? whynot?? |
| 110 | + --> |
| 111 | + {% assign txt_head = txt | truncate: 10 %} |
| 112 | + <!-- note: allow files without front matter --> |
| 113 | + {% if txt_head contains '---' %} |
| 114 | + {% assign txt_ary = txt | replace_first: '---', '' | replace_first: '---', '@@END@@' | split: '@@END@@' %} |
| 115 | + {% assign txt2 = txt_ary[1] %} |
| 116 | + {% else %} |
| 117 | + {% assign txt2 = txt %} |
| 118 | + {% endif %} |
| 119 | + |
| 120 | + {{ txt2 | markdownify }} |
| 121 | +</div> |
| 122 | + {% endfor %} |
| 123 | + |
| 124 | +{% endfor %} |
0 commit comments