madness 1.2.4 → 1.3.0

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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -16
  3. data/app/public/css/main.css +652 -401
  4. data/app/public/css/main.css.map +17 -19
  5. data/app/public/js/theme.js +81 -0
  6. data/app/public/js/vendor/mermaid.min.js +2223 -847
  7. data/app/styles/_anchor.scss +11 -3
  8. data/app/styles/_breadcrumbs.scss +8 -1
  9. data/app/styles/_code.scss +26 -8
  10. data/app/styles/_footnotes.scss +29 -0
  11. data/app/styles/_general.scss +6 -3
  12. data/app/styles/_image.scss +18 -0
  13. data/app/styles/_keyboard.scss +6 -4
  14. data/app/styles/_manifest.scss +1 -2
  15. data/app/styles/_nav.scss +200 -16
  16. data/app/styles/_pandoc_code.scss +55 -51
  17. data/app/styles/_rouge.scss +57 -211
  18. data/app/styles/_scrollbar.scss +17 -3
  19. data/app/styles/_search.scss +20 -8
  20. data/app/styles/_table.scss +6 -5
  21. data/app/styles/_typography.scss +44 -16
  22. data/app/styles/_variables.scss +216 -35
  23. data/app/views/_icon.slim +23 -0
  24. data/app/views/_mobile_search.slim +1 -1
  25. data/app/views/_nav.slim +18 -8
  26. data/app/views/_nav_tree.slim +13 -0
  27. data/app/views/layout.slim +26 -1
  28. data/lib/madness/directory.rb +8 -0
  29. data/lib/madness/document.rb +1 -0
  30. data/lib/madness/inline_table_of_contents.rb +1 -0
  31. data/lib/madness/item.rb +2 -0
  32. data/lib/madness/markdown_document.rb +1 -0
  33. data/lib/madness/navigation.rb +25 -0
  34. data/lib/madness/rendering/pandoc.rb +2 -1
  35. data/lib/madness/rendering/redcarpet_custom.rb +6 -1
  36. data/lib/madness/search.rb +1 -0
  37. data/lib/madness/server.rb +1 -1
  38. data/lib/madness/settings.rb +3 -3
  39. data/lib/madness/templates/madness.yml +7 -2
  40. data/lib/madness/version.rb +1 -1
  41. metadata +10 -20
  42. data/app/public/font/fontello.eot +0 -0
  43. data/app/public/font/fontello.svg +0 -16
  44. data/app/public/font/fontello.ttf +0 -0
  45. data/app/public/font/fontello.woff +0 -0
  46. data/app/public/font/fontello.woff2 +0 -0
  47. data/app/styles/_fontello.scss +0 -59
  48. data/lib/madness/refinements/hash_refinements.rb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5790a84273b260c95800d1497ce38a0d5e7f2eabe77b8231309ebf70eb7acb4
4
- data.tar.gz: 013d8d7b8dd741bc5a03092c58c6326caa2cdf6c82b001be4755615e6184439b
3
+ metadata.gz: 7ae3cdf3ac2b5f6b10c753eea82d7d1582638dbe9cd07d74a3b9dae1538d71ec
4
+ data.tar.gz: 28ad6247d60993951bcdc8523ceffec325db4ec03d9d2fcf3bc39148a4af7660
5
5
  SHA512:
6
- metadata.gz: 942b0408a4ef4e85630703cd31a0c1b0c9d4a5695db685d612cd4280dc01282e725b63629b006dd41abf1ec198ac13df34370444820ea00bdf67c0ffe9c686b4
7
- data.tar.gz: 1d0c07859780758c0ea6211ac6f0f62662f49be96adf2d083aba88703148b69e0979caeea5ca47351b5aa775310172533d74ccdb82566013fbd137172de22d9b
6
+ metadata.gz: a56ccf5bd4beb475f1a1b4d1ccbdc4b35fb22bfb472d9b538316b66263c5c3fc26a7ab2f2154ae43701ea3325dfd10ba5efe59344da7164c57ff543bd072d157
7
+ data.tar.gz: 3b666bcc03cce4e6b93fd1178811cedbc94d36f8caf00f2d38a9e34deebbbf9ad17d30b92522d54968cb49b8c9148ae2740216f7c1ed0a6ae5aa3174d7baccbc
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Madness - Instant Markdown Server
4
4
 
5
+ ![repocard](https://repocard.dannyben.com/svg/madness.svg)
6
+
5
7
  Madness is a command line server for rendering markdown documents in your
6
8
  browser. It is designed to facilitate easy development of internal
7
9
  markdown-based documentation sites.
@@ -40,6 +42,7 @@ $ alias madness='docker run --rm -it -v $PWD:/docs -p 3000:3000 dannyben/madness
40
42
  - Compatible with how markdown files are displayed on GitHub and GitHub pages.
41
43
  - Configure with a configuration file or command arguments.
42
44
  - Fully customizable theme.
45
+ - Built-in light and dark theme support.
43
46
  - Automatic generation of navigation sidebar.
44
47
  - Automatic generation of Table of Contents (site-wide and per page).
45
48
  - Can optionally show additional file types in the navigation menu (e.g. PDF
@@ -134,6 +137,11 @@ sort_order: dirs_first
134
137
  # enable sidebar
135
138
  sidebar: true
136
139
 
140
+ # render the sidebar as a recursive tree of the entire docroot, with
141
+ # collapsible folders. when false, the sidebar shows only the current
142
+ # folder's immediate children.
143
+ nav_tree: false
144
+
137
145
  # add H1 title to files that do not have one
138
146
  auto_h1: true
139
147
 
@@ -149,8 +157,8 @@ auto_toc: true
149
157
  highlighter: true
150
158
 
151
159
  # enable mermaid diagramming and charting
152
- # put your diagram code inside <div class='mermaid'>...</div>
153
- mermaid: false
160
+ # put your diagram code inside ```mermaid ... ``` code fence
161
+ mermaid: true
154
162
 
155
163
  # enable the copy to clipboard icon for code snippets
156
164
  copy_code: true
@@ -224,6 +232,16 @@ For example, for a directory named "API Documentation":
224
232
 
225
233
  Madness comes with a full text search page.
226
234
 
235
+ ### Navigation Tree
236
+
237
+ By default, the sidebar shows the current folder's immediate children. To render
238
+ the sidebar as a recursive tree of the entire documentation root, enable the
239
+ `nav_tree` option:
240
+
241
+ ```yaml
242
+ nav_tree: true
243
+ ```
244
+
227
245
  ### Images and Static Files
228
246
 
229
247
  You can put images and other asset files anywhere in your documentation
@@ -264,19 +282,7 @@ file or a directory in the same directory as the file itself.
264
282
  When the `mermaid` option is enabled, you can embed Mermaid diagrams in your
265
283
  document using either of the following methods:
266
284
 
267
- 1. **Using a `<div>` block with `mermaid` class**:
268
-
269
- ```html
270
- <div class="mermaid">
271
- graph TD;
272
- A-->B;
273
- A-->C;
274
- B-->D;
275
- C-->D;
276
- </div>
277
- ```
278
-
279
- 2. **Using a code fence with `mermaid` language specifier**:
285
+ **Using a code fence with `mermaid` language specifier**:
280
286
 
281
287
  ````markdown
282
288
  ```mermaid
@@ -287,6 +293,18 @@ document using either of the following methods:
287
293
  C-->D;
288
294
  ```
289
295
  ````
296
+
297
+ **Using a `<div>` block with `mermaid` class**:
298
+
299
+ ```html
300
+ <div class="mermaid">
301
+ graph TD;
302
+ A-->B;
303
+ A-->C;
304
+ B-->D;
305
+ C-->D;
306
+ </div>
307
+ ```
290
308
 
291
309
  ### Table of Contents Generation
292
310
 
@@ -377,6 +395,11 @@ auth: <%= ENV['BASIC_AUTH'] %>
377
395
 
378
396
  There are three ways to change how Madness looks.
379
397
 
398
+ The built-in theme supports light and dark color schemes. It follows the
399
+ browser or operating system preference by default, and readers can use the theme
400
+ toggle to switch between light and dark. The selected preference is stored in
401
+ the browser for future visits.
402
+
380
403
  ### Option 1: CSS Overrides
381
404
 
382
405
  Any CSS file found in the `./css` directory of your documentation root will
@@ -470,4 +493,3 @@ For more information about the docker image, see:
470
493
  [dockerfile]: https://github.com/DannyBen/madness/blob/master/Dockerfile
471
494
  [css]: https://github.com/DannyBen/madness/blob/master/app/public/css/main.css
472
495
  [sasstool]: https://github.com/DannyBen/sasstool
473
-