@@ -25,21 +25,8 @@ def main():
25
25
"docs/cli.adoc" ,
26
26
]
27
27
)
28
- subprocess .check_output (
29
- [
30
- "asciidoctor" ,
31
- "-b" ,
32
- "html5" ,
33
- "-D" ,
34
- "website/public/" ,
35
- "-o" ,
36
- "cli/index.html" ,
37
- "docs/cli.adoc" ,
38
- ]
39
- )
40
28
41
29
process_man ()
42
- process_html ()
43
30
44
31
45
32
def process_man ():
@@ -79,85 +66,6 @@ def process_man():
79
66
file_path .write_text (contents )
80
67
81
68
82
- def process_html ():
83
- file_path = pathlib .Path ("website/public/cli/index.html" )
84
- contents = file_path .read_text ()
85
-
86
- top = """<!-- Copyright (C) 2020 Matthew Glazar -->
87
- <!-- See end of file for extended copyright information. -->
88
- <!-- This file was generated using generate-cli-docs. -->
89
- """
90
- bottom = """
91
-
92
- <!--
93
- quick-lint-js finds bugs in JavaScript programs.
94
- Copyright (C) 2020 Matthew Glazar
95
-
96
- This file is part of quick-lint-js.
97
-
98
- quick-lint-js is free software: you can redistribute it and/or modify
99
- it under the terms of the GNU General Public License as published by
100
- the Free Software Foundation, either version 3 of the License, or
101
- (at your option) any later version.
102
-
103
- quick-lint-js is distributed in the hope that it will be useful,
104
- but WITHOUT ANY WARRANTY; without even the implied warranty of
105
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
106
- GNU General Public License for more details.
107
-
108
- You should have received a copy of the GNU General Public License
109
- along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>.
110
- -->
111
- """
112
- head = """<head>
113
- <title>quick-lint-js: CLI documentation</title>
114
- <meta charset="utf-8" />
115
- <link href="../main.css" rel="stylesheet" />
116
- </head>"""
117
- header = """<header>
118
- <h1><a href="..">quick-lint-js</a></h1>
119
- <nav>
120
- <ul>
121
- <li class="side-bar-only"><a href="..">Home</a></li>
122
- <li><a href="../install/">Install</a></li>
123
- <li><a href="../demo/">Try online</a></li>
124
- <li><a href="../errors/">Error docs</a></li>
125
- <li class="current-page">CLI docs</li>
126
- <li><a href="../benchmarks/">Benchmarks</a></li>
127
- <li>
128
- <a href="https://github.com/quick-lint/quick-lint-js"
129
- >Code on GitHub</a
130
- >
131
- </li>
132
- </ul>
133
- </nav>
134
- </header>
135
- <p>This page documents the quick-lint-js command-line interface (CLI).</p>"""
136
- footer = """<footer>
137
- <nav>
138
- <ul>
139
- <li><a href="..">quick-lint-js home page</a></li>
140
- <li><a href="../hiring/">we're hiring! get paid to code</a></li>
141
- <li><a href="../benchmarks/">benchmarks vs other linters</a></li>
142
- <li><a href="../demo/">try quick-lint-js in your browser</a></li>
143
- <li>
144
- <a href="https://github.com/quick-lint/quick-lint-js">source code on GitHub</a>
145
- </li>
146
- <li><a href="../license/">copyright and license information</a></li>
147
- </ul>
148
- </nav>
149
- </footer>"""
150
-
151
- l = len ("<!DOCTYPE html>" )
152
- contents = contents [: l + 1 ] + top + contents [l + 1 :] + bottom
153
- contents = re .sub (r"(?s)<head>(.*?)</head>" , head , contents )
154
- contents = re .sub (r"(?s)<h1>(.*?)</h1>" , header , contents )
155
- contents = re .sub (r'(?s)<div id="footer">(.*?)</div>\n</div>' , footer , contents )
156
- contents = contents .replace ('<body class="article">' , '<body class="article side-bar-nav">' )
157
-
158
- file_path .write_text (contents )
159
-
160
-
161
69
if __name__ == "__main__" :
162
70
main ()
163
71
0 commit comments