1+ ![ Madness Logo] ( assets/header.png )
2+
13# Madness - Instant Markdown Server
24
35[ ![ Gem Version] ( https://badge.fury.io/rb/madness.svg )] ( https://badge.fury.io/rb/madness )
68
79---
810
9- ## Screenshots (click to zoom)
10-
11- <table ><tr >
12- <td ><a target =' _screenshot ' href =' assets/screen-main.png ' ><img src =' assets/screen-main.png ' /></a ></td >
13- <td ><a target =' _screenshot ' href =' assets/screen-nav.png ' ><img src =' assets/screen-nav.png ' /></a ></td >
14- <td ><a target =' _screenshot ' href =' assets/screen-code.png ' ><img src =' assets/screen-code.png ' /></a ></td >
15- <td ><a target =' _screenshot ' href =' assets/screen-search.png ' ><img src =' assets/screen-search.png ' /></a ></td >
16- </tr ></table >
17-
18- ## Table of Contents
19-
20- * [ Install] ( #install )
21- * [ Design Intentions] ( #design-intentions )
22- * [ Feature Highlights] ( #feature-highlights )
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+ ## Screenshots
18+
19+ [ ![ Screenshots] ( assets/screenshots.gif )] ( assets/screenshots.gif )
3720
3821## Install
3922
@@ -56,11 +39,6 @@ $ brew gem install madness
5639$ alias madness=' docker run --rm -it -v $PWD:/docs -p 3000:3000 dannyben/madness'
5740```
5841
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-
6442## Feature Highlights
6543
6644- Easy to use.
@@ -69,9 +47,13 @@ searching for local, markdown based documentation directories.
6947- Configure with a configuration file or command arguments.
7048- Fully customizable theme.
7149- Automatic generation of navigation sidebar.
72- - Automatic generation of Table of Contents (site-wide and inline).
73- - Can optionally show additional file types in the navigation menu (e.g. PDF files).
50+ - Automatic generation of Table of Contents (site-wide and per page).
51+ - Can optionally show additional file types in the navigation menu (e.g. PDF
52+ files).
7453- Optional support for ` [[Short Link]] ` syntax.
54+ - Optional basic authentication.
55+ - Support for extended markdown syntax, such as footnotes and syntax
56+ highlighting.
7557
7658## Usage
7759
@@ -93,14 +75,14 @@ $ madness --help
9375
9476Madness expects to be executed in a documentation directory.
9577
96- A documentation directory contains only markdown files (` *.md ` ) and
97- sub directories that contain more markdown files.
78+ A documentation directory contains only markdown files (` *.md ` ) and sub
79+ directories that contain more markdown files.
9880
99- The server will consider the file ` index.md ` or ` README.md ` in any directory
100- as the main file describing this directory, where ` index.md ` has priority.
81+ The server will consider the file ` index.md ` or ` README.md ` in any directory as
82+ the main file describing this directory, where ` index.md ` has priority.
10183
102- The navigation sidebar will show all the sub directories and files in
103- the same directory as the viewed file.
84+ The navigation sidebar will show all the sub directories and files in the same
85+ directory as the viewed file.
10486
10587Example structure:
10688
@@ -119,9 +101,17 @@ Example structure:
119101
120102## Configuration File
121103
122- All the command line arguments can also be configured through a
123- configuration file. Create a file named ` .madness.yml ` in your
124- documentation directory, and modify any of the settings below.
104+ Madness uses sensible defaults, so therefore can be executed without configuring
105+ anything. Configuration is mostly done by having a file named ` .madness.yml ` in
106+ your documentation directory.
107+
108+ For convenience, you can generate a template config file by running:
109+
110+ ``` shell
111+ $ madness create config
112+ ```
113+
114+ which will generate this file, with all the default options:
125115
126116``` yaml
127117# .madness.yml
@@ -144,12 +134,14 @@ auto_h1: true
144134# append navigation to directory READMEs
145135auto_nav : true
146136
137+ # replace <!-- TOC --> in any file with its internal table of contents
138+ # set to true to enable it with the default '## Table of Contents' caption,
139+ # or set to any string that will be inserted before it as a caption.
140+ auto_toc : true
141+
147142# enable syntax highlighter for code snippets
148143highlighter : true
149144
150- # enable line numbers for code snippets
151- line_numbers : true
152-
153145# enable the copy to clipboard icon for code snippets
154146copy_code : true
155147
@@ -183,12 +175,6 @@ expose_extensions: ~
183175exclude : ['^[a-z_\-0-9]+$']
184176` ` `
185177
186- For convenience, you can generate a template config file by running:
187-
188- ` ` ` shell
189- $ madness create config
190- ```
191-
192178## Search
193179
194180Madness comes with a full text search page.
@@ -235,13 +221,18 @@ file or a directory in the same directory as the file itself.
235221To generate a Table of Contents file for the entire site (for the directories
236222and files), run `madness --toc FILENAME`
237223
238- ### Inline
224+ # ## In-page
239225
240226If you have long markdown documents, and you wish to add an inline Table of
241227Contents for them, simply add an HTML comment `<!-- TOC -->` where you want
242228the Table of Contents to be generated. The inserted list will only consider
243229H2 and H3 headings.
244230
231+ Note that for this feature to work, your markdown document must use the # -based
232+ heading syntax.
233+
234+ The 'Table of Contents' heading can be customized in the configuration file.
235+
245236# # Hidden Directories
246237
247238Directories that are made only of lowercase letters, underscoes, dash and/or
0 commit comments