-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarkdown-lint.html
128 lines (95 loc) · 2.93 KB
/
markdown-lint.html
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
layout: default
title: Markdown Lint Tool Documentation
---
{% assign book = site.data.markdown_lint.book %}
<!-- todo: check - can we use book.contents - why? why not? -->
{% assign book_contents = site.data.markdown_lint.contents %}
<p>
<a href="index.html">Up & Down Press</a>
</p>
<!-- cover -->
<h1>{{ book.title }}</h1>
<h3>by {{ book.author.name }}</h3>
<!-- fix: use book.subtitle -->
<p>A tool to check markdown files and flag style issues</p>
<!-- table of contents -->
<div class='toc'>
Contents
<!-- todo: auto-add refs from ids (if refs missing/not present)
-->
<ul>
{% for part in book_contents %}
<li>{{ part.title }}
<ul>
{% for chapter in part.sections %}
<li>
{% if chapter.ref %}
<a href="#{{ chapter.ref }}">{{ chapter.title }}</a>
{% else %}
{{ chapter.title }}
{% endif %}
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
<h2>Preface</h1>
<p>
<b>Note:</b> The book edition is still an early release and a work-in-progess.
</p>
<p>
This is the <a href="https://github.com/mivok/markdownlint">official documentation</a>
for the markdown lint style rules checker
reformatted in a single-page book edition.
</p>
<p>
See the <a href="https://github.com/updownpress/updownpress.github.io">source repo</a> for how
the book gets auto-built with a static site builder and hosted on GitHub Pages.
</p>
<p>
Questions? Comments?
Send them along to the
<a href="http://groups.google.com/group/wwwmake">wwwmake mailing list/forum</a>
Thanks.
</p>
<p>
Onwards.
</p>
<h2>Acknowledgments</h2>
<p>
Thanks to Mark Harrison and contributors for making it all possible.
</p>
<!-- chapters -->
{% for part in book_contents %}
<h1 class="part">{{ part.id }} {{ part.title }}</h1>
{% for chapter in part.sections %}
<div class="chapter">
<!-- fix/todo: use h1#id instead of ancher -->
{% if chapter.ref %}
<a name="{{ chapter.ref }}"></a>
{% endif %}
<h1>{{ chapter.id }} {{ chapter.title }}</h1>
<!-- try adding content using include_relative -->
{% capture txt %}{% include_relative _markdown-lint/{{chapter.path}} %}{% endcapture %}
<!-- hack: cut off yaml front matter header
possible alternative??:
try to use collection and use a content lookup with title or path - why? whynot??
-->
<!-- fix/todo:
how to get parsed front matter as hash - use yamlify if exit or something??
-->
{% assign txt_head = txt | truncate: 10 %}
<!-- note: allow files without front matter -->
{% if txt_head contains '---' %}
{% assign txt_ary = txt | replace_first: '---', '' | replace_first: '---', '@@END@@' | split: '@@END@@' %}
{% assign txt2 = txt_ary[1] %}
{% else %}
{% assign txt2 = txt %}
{% endif %}
{{ txt2 | markdownify }}
</div>
{% endfor %}
{% endfor %}