madness 0.9.9 → 1.0.0.rc2
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.
- checksums.yaml +4 -4
- data/README.md +74 -76
- data/app/public/css/main.css +494 -248
- data/app/public/css/main.css.map +30 -24
- data/app/public/font/fontello.eot +0 -0
- data/app/public/font/fontello.svg +16 -0
- data/app/public/font/fontello.ttf +0 -0
- data/app/public/font/fontello.woff +0 -0
- data/app/public/font/fontello.woff2 +0 -0
- data/app/public/js/clipboard.js +2 -2
- data/app/styles/_anchor.scss +5 -3
- data/app/styles/_breadcrumbs.scss +2 -1
- data/app/styles/_code.scss +35 -42
- data/app/styles/{_icons.scss → _fontello.scss} +28 -19
- data/app/styles/_footnotes.scss +5 -0
- data/app/styles/_general.scss +7 -3
- data/app/styles/_image.scss +0 -2
- data/app/styles/_keyboard.scss +8 -7
- data/app/styles/_line.scss +1 -26
- data/app/styles/_manifest.scss +12 -8
- data/app/styles/_nav.scss +5 -15
- data/app/styles/_rouge.scss +213 -0
- data/app/styles/_scrollbar.scss +9 -0
- data/app/styles/_search.scss +5 -6
- data/app/styles/_table.scss +12 -7
- data/app/styles/_typography.scss +9 -5
- data/app/styles/_variables.scss +40 -0
- data/app/styles/main.scss +3 -3
- data/app/views/_index_nav.slim +6 -5
- data/app/views/document.slim +2 -6
- data/bin/madness +6 -2
- data/lib/madness/cli.rb +21 -0
- data/lib/madness/commands/base.rb +11 -0
- data/lib/madness/commands/config.rb +48 -0
- data/lib/madness/commands/server.rb +76 -0
- data/lib/madness/commands/theme.rb +36 -0
- data/lib/madness/document.rb +5 -110
- data/lib/madness/exceptions.rb +6 -0
- data/lib/madness/highlight_renderer.rb +10 -0
- data/lib/madness/markdown_document.rb +103 -0
- data/lib/madness/server_base.rb +1 -1
- data/lib/madness/settings.rb +7 -7
- data/lib/madness/templates/madness.yml +6 -4
- data/lib/madness/version.rb +1 -1
- metadata +53 -50
- data/app/public/fonts/fontello.eot +0 -0
- data/app/public/fonts/fontello.svg +0 -16
- data/app/public/fonts/fontello.ttf +0 -0
- data/app/public/fonts/fontello.woff +0 -0
- data/app/public/fonts/fontello.woff2 +0 -0
- data/app/styles/_coderay.scss +0 -37
- data/lib/madness/command_line.rb +0 -139
- data/lib/madness/docopt.txt +0 -98
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9cba6f044834b3b940828d81932f1537e289fdb39f7c4b6c91d5941b1fc441b
|
4
|
+
data.tar.gz: 5d281aa6e131eda5c3f41622b34d2c82ea57ff93677de035c4e55475988c5d28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ecf906622256765245b7a5b5955aab19e6abd26cec1d63cb7a578add0880ade75b4ba2cb27638db9c2e45300ec57f064057ce4bc5cbb113001ba81e9e6aa00a
|
7
|
+
data.tar.gz: 90bba0e9ac05b6674e1691761f319e7dac8cfb9c9d2999ed428753ddad3e4facf288540d441f23e647513c077861c4431404cd75d933c9d7f36f14a1f9475f4b
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://github.com/dannyben/madness)
|
2
|
+
|
1
3
|
# Madness - Instant Markdown Server
|
2
4
|
|
3
5
|
[](https://badge.fury.io/rb/madness)
|
@@ -6,34 +8,20 @@
|
|
6
8
|
|
7
9
|
---
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
* [Usage](#usage)
|
24
|
-
* [Directory Conventions](#directory-conventions)
|
25
|
-
* [Configuration File](#configuration-file)
|
26
|
-
* [Search](#search)
|
27
|
-
* [Images and Static Files](#images-and-static-files)
|
28
|
-
* [Automatic H1](#automatic-h1)
|
29
|
-
* [Shortlinks](#shortlinks)
|
30
|
-
* [Table of Contents Generation](#table-of-contents-generation)
|
31
|
-
* [Hidden Directories](#hidden-directories)
|
32
|
-
* [Controlling Sort Order](#controlling-sort-order)
|
33
|
-
* [Displaying Additional File Types](#displaying-additional-file-types)
|
34
|
-
* [Basic Authentication](#basic-authentication)
|
35
|
-
* [Customizing Theme](#customizing-theme)
|
36
|
-
* [Docker Image](#docker-image)
|
11
|
+
Madness is a command line server for rendering markdown documents in your
|
12
|
+
browser. It is designed to facilitate easy development of internal
|
13
|
+
markdown-based documentation site.
|
14
|
+
|
15
|
+
<!-- MADNESS_TOC -->
|
16
|
+
|
17
|
+
|
18
|
+
> Note: This documentation refers to the 1.0.0 pre-release version
|
19
|
+
> See [documentaton for v0.9.9](https://github.com/dannyben/madness/tree/v0.9.9#readme)
|
20
|
+
> if you are using an earlier version
|
21
|
+
|
22
|
+
## Screenshots
|
23
|
+
|
24
|
+
[](assets/screenshots.gif)
|
37
25
|
|
38
26
|
## Install
|
39
27
|
|
@@ -56,11 +44,6 @@ $ brew gem install madness
|
|
56
44
|
$ alias madness='docker run --rm -it -v $PWD:/docs -p 3000:3000 dannyben/madness'
|
57
45
|
```
|
58
46
|
|
59
|
-
## Design Intentions
|
60
|
-
|
61
|
-
Madness was designed in order to provide easy browsing, viewing and
|
62
|
-
searching for local, markdown based documentation directories.
|
63
|
-
|
64
47
|
## Feature Highlights
|
65
48
|
|
66
49
|
- Easy to use.
|
@@ -69,16 +52,20 @@ searching for local, markdown based documentation directories.
|
|
69
52
|
- Configure with a configuration file or command arguments.
|
70
53
|
- Fully customizable theme.
|
71
54
|
- Automatic generation of navigation sidebar.
|
72
|
-
- Automatic generation of Table of Contents (site-wide and
|
73
|
-
- Can optionally show additional file types in the navigation menu (e.g. PDF
|
55
|
+
- Automatic generation of Table of Contents (site-wide and per page).
|
56
|
+
- Can optionally show additional file types in the navigation menu (e.g. PDF
|
57
|
+
files).
|
74
58
|
- Optional support for `[[Short Link]]` syntax.
|
59
|
+
- Optional basic authentication.
|
60
|
+
- Support for extended markdown syntax, such as footnotes and syntax
|
61
|
+
highlighting.
|
75
62
|
|
76
63
|
## Usage
|
77
64
|
|
78
65
|
Go to any directory that contains markdown files and run:
|
79
66
|
|
80
67
|
```shell
|
81
|
-
$ madness
|
68
|
+
$ madness server
|
82
69
|
```
|
83
70
|
|
84
71
|
And open <http://localhost:3000> in your browser.
|
@@ -93,14 +80,14 @@ $ madness --help
|
|
93
80
|
|
94
81
|
Madness expects to be executed in a documentation directory.
|
95
82
|
|
96
|
-
A documentation directory contains only markdown files (`*.md`) and
|
97
|
-
|
83
|
+
A documentation directory contains only markdown files (`*.md`) and sub
|
84
|
+
directories that contain more markdown files.
|
98
85
|
|
99
|
-
The server will consider the file `index.md` or `README.md` in any directory
|
100
|
-
|
86
|
+
The server will consider the file `index.md` or `README.md` in any directory as
|
87
|
+
the main file describing this directory, where `index.md` has priority.
|
101
88
|
|
102
|
-
The navigation sidebar will show all the sub directories and files in
|
103
|
-
|
89
|
+
The navigation sidebar will show all the sub directories and files in the same
|
90
|
+
directory as the viewed file.
|
104
91
|
|
105
92
|
Example structure:
|
106
93
|
|
@@ -119,9 +106,17 @@ Example structure:
|
|
119
106
|
|
120
107
|
## Configuration File
|
121
108
|
|
122
|
-
|
123
|
-
|
124
|
-
documentation directory
|
109
|
+
Madness uses sensible defaults, so therefore can be executed without configuring
|
110
|
+
anything. Configuration is mostly done by having a file named `.madness.yml` in
|
111
|
+
your documentation directory.
|
112
|
+
|
113
|
+
For convenience, you can generate a template config file by running:
|
114
|
+
|
115
|
+
```shell
|
116
|
+
$ madness config new
|
117
|
+
```
|
118
|
+
|
119
|
+
which will generate this file, with all the default options:
|
125
120
|
|
126
121
|
```yaml
|
127
122
|
# .madness.yml
|
@@ -144,12 +139,14 @@ auto_h1: true
|
|
144
139
|
# append navigation to directory READMEs
|
145
140
|
auto_nav: true
|
146
141
|
|
142
|
+
# replace <!-- TOC --> in any file with its internal table of contents
|
143
|
+
# set to true to enable it with the default '## Table of Contents' caption,
|
144
|
+
# or set to any string that will be inserted before it as a caption.
|
145
|
+
auto_toc: true
|
146
|
+
|
147
147
|
# enable syntax highlighter for code snippets
|
148
148
|
highlighter: true
|
149
149
|
|
150
|
-
# enable line numbers for code snippets
|
151
|
-
line_numbers: true
|
152
|
-
|
153
150
|
# enable the copy to clipboard icon for code snippets
|
154
151
|
copy_code: true
|
155
152
|
|
@@ -172,7 +169,7 @@ open: false
|
|
172
169
|
auth: false
|
173
170
|
|
174
171
|
# if auth is enabled, specify auth realm name
|
175
|
-
auth_zone:
|
172
|
+
auth_zone: Restricted Documentation
|
176
173
|
|
177
174
|
# show files with these extensions in the navigation and search, for example:
|
178
175
|
# expose_extensions: pdf,docx,xlsx,txt
|
@@ -183,17 +180,13 @@ expose_extensions: ~
|
|
183
180
|
exclude: ['^[a-z_\-0-9]+$']
|
184
181
|
```
|
185
182
|
|
186
|
-
|
187
|
-
|
188
|
-
```shell
|
189
|
-
$ madness create config
|
190
|
-
```
|
183
|
+
## Features
|
191
184
|
|
192
|
-
|
185
|
+
### Search
|
193
186
|
|
194
187
|
Madness comes with a full text search page.
|
195
188
|
|
196
|
-
|
189
|
+
### Images and Static Files
|
197
190
|
|
198
191
|
You can put images and other asset files anywhere in your documentation
|
199
192
|
folder.
|
@@ -216,33 +209,38 @@ the path relative to the homepage:
|
|
216
209
|

|
217
210
|
```
|
218
211
|
|
219
|
-
|
212
|
+
### Automatic H1
|
220
213
|
|
221
214
|
If your markdown document does not start with a level 1 heading, it
|
222
215
|
will be automatically added based on the file name.
|
223
216
|
|
224
|
-
|
217
|
+
### Shortlinks
|
225
218
|
|
226
219
|
When the `shortlinks` option is enabled, you may use a shorthand syntax for
|
227
220
|
specifying internal links, where `[[Anything]]` will be converted to
|
228
221
|
`[Anything](Anything)`, which will then be rendered as an internal link to a
|
229
222
|
file or a directory in the same directory as the file itself.
|
230
223
|
|
231
|
-
|
224
|
+
### Table of Contents Generation
|
232
225
|
|
233
|
-
|
226
|
+
#### Site-wide
|
234
227
|
|
235
228
|
To generate a Table of Contents file for the entire site (for the directories
|
236
229
|
and files), run `madness --toc FILENAME`
|
237
230
|
|
238
|
-
|
231
|
+
#### In-page
|
239
232
|
|
240
233
|
If you have long markdown documents, and you wish to add an inline Table of
|
241
234
|
Contents for them, simply add an HTML comment `<!-- TOC -->` where you want
|
242
235
|
the Table of Contents to be generated. The inserted list will only consider
|
243
236
|
H2 and H3 headings.
|
244
237
|
|
245
|
-
|
238
|
+
Note that for this feature to work, your markdown document must use the #-based
|
239
|
+
heading syntax.
|
240
|
+
|
241
|
+
The 'Table of Contents' heading can be customized in the configuration file.
|
242
|
+
|
243
|
+
### Hidden Directories
|
246
244
|
|
247
245
|
Directories that are made only of lowercase letters, underscoes, dash and/or
|
248
246
|
numbers (`/^[a-z_\-0-9]+$/`) will not be displayed in the navigation. In
|
@@ -262,7 +260,7 @@ exclude: [assets, public]
|
|
262
260
|
exclude: ['^public$', 'assets']
|
263
261
|
```
|
264
262
|
|
265
|
-
|
263
|
+
### Controlling Sort Order
|
266
264
|
|
267
265
|
To control the sort order of the automatically generated navigation elements,
|
268
266
|
simply prefix your files and directories with digits followed by a dot and a
|
@@ -275,7 +273,7 @@ will be omitted when they are displayed.
|
|
275
273
|
└── 2. Another file or folder
|
276
274
|
```
|
277
275
|
|
278
|
-
|
276
|
+
### Displaying Additional File Types
|
279
277
|
|
280
278
|
If you wish the navigation and search features to also show other documents
|
281
279
|
and files (for example, PDF files), you may configure the `expose_extensions`
|
@@ -288,7 +286,7 @@ expose_extensions: pdf,docx,xlsx,txt
|
|
288
286
|
|
289
287
|
The default value of this option is `null` (or `~`, which is `null` in YAML).
|
290
288
|
|
291
|
-
|
289
|
+
### Basic Authentication
|
292
290
|
|
293
291
|
To add basic authentication, use the `--auth user:password` command line argument or the equivalent `auth` configuration option.
|
294
292
|
|
@@ -313,7 +311,7 @@ Madness comes with a command that copies the default theme to a folder of
|
|
313
311
|
your choice, where you can customize it to your taste. Run:
|
314
312
|
|
315
313
|
```shell
|
316
|
-
$ madness
|
314
|
+
$ madness theme full my_theme
|
317
315
|
```
|
318
316
|
|
319
317
|
Where `my_theme` is the folder that will be created.
|
@@ -322,7 +320,7 @@ To use the created theme, simply run Madness with the `--theme my_theme`
|
|
322
320
|
option.
|
323
321
|
|
324
322
|
```shell
|
325
|
-
$ madness --theme my_theme
|
323
|
+
$ madness server --theme my_theme
|
326
324
|
```
|
327
325
|
|
328
326
|
Note that the generated theme contains the SCSS files in the `styles`
|
@@ -336,14 +334,15 @@ any tool to do so, or if you do not have a preference, use
|
|
336
334
|
|
337
335
|
### Option 2: Change CSS only
|
338
336
|
|
339
|
-
If you are looking to implement a smaller CSS change,
|
337
|
+
If you are looking to implement a smaller CSS change, run:
|
338
|
+
|
339
|
+
```shell
|
340
|
+
$ madness theme css
|
341
|
+
```
|
340
342
|
|
341
|
-
|
342
|
-
|
343
|
-
- Update it as you see fit.
|
343
|
+
This will create the file `css/main.css` in the current directory. Update the
|
344
|
+
file as you see fit.
|
344
345
|
|
345
|
-
Note that this functionality is not guaranteed to stay as is in future
|
346
|
-
versions of madness.
|
347
346
|
|
348
347
|
## Docker Image
|
349
348
|
|
@@ -353,7 +352,7 @@ This command will start the server on localhost:3000, with the current
|
|
353
352
|
directory as the markdown documentation folder
|
354
353
|
|
355
354
|
```shell
|
356
|
-
$ docker run --rm -it -v $PWD:/docs -p 3000:3000 dannyben/madness
|
355
|
+
$ docker run --rm -it -v $PWD:/docs -p 3000:3000 dannyben/madness server
|
357
356
|
```
|
358
357
|
|
359
358
|
You may create an alias for convenience:
|
@@ -374,7 +373,6 @@ For more information about the docker image, see:
|
|
374
373
|
|
375
374
|
[dockerhub]: https://hub.docker.com/r/dannyben/madness/
|
376
375
|
[dockerfile]: https://github.com/DannyBen/docker-madness
|
377
|
-
[css]: app/public/css/main.css
|
378
|
-
[app]: app
|
376
|
+
[css]: https://github.com/DannyBen/madness/blob/master/app/public/css/main.css
|
379
377
|
[sasstool]: https://github.com/DannyBen/sasstool
|
380
378
|
|