Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

A javascript file to generate a content navigation for the markdown document.

Notifications You must be signed in to change notification settings

PulsGarney/markdownpad2-nav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MarkdownPad2 Content Navigation Auto Generator

A javascript file to generate a content navigation for the document.

How to Use

Add the content of the file 4MarkdownPad2-head.html to MarkdownPad2's HTML Head Editor, Then, Disable your Stylesheets as followed. Or just use mine(PG.css).

body {
    /*max-width: 960px;*/
    /*margin: 0 auto;*/
}

In MarkdownPad2, You can added the codes through "Menu > Tools > Options > Advanced > HTML Head Editor"

Functions

  • In the JS code, The "Book Name Mode" will be active when the param FirstH1BookName equals true(Pic 1) It's specially for somebody might use Markdown to write a book or something, like myself. it'll set the first title as the Book Name and Make it look a bit different, for example, apart it from the numbering. and as Regular Mode if it's false(Pic 2). Try it on and you'll see.

  • Click the cadetblue little slider on the windows' left will collapse the whole content.

Effect

It shall work as follow pictures, and also Link

Book Name Mode

Book Name Mode

Regular Mode

Regular Mode

NOTE

It can only reaches to 3 different levels of the content navigator or it comes errors.

Reference I took: https://github.com/chris-peng/markdown_nav

中文 CN

MarkdownPad2 自動生成目錄 JQuery 插件

使用方式

4MarkdownPad2-head.html 文件中的內容添加到 MarkdownPad 中的 HTML Head 編輯器 中, 並作如下禁用掉你的CSS,或者直接使用我的CSS(PG.css)。

body {
    /*max-width: 960px;*/
    /*margin: 0 auto;*/
}

在MarkdownPad2中,可以通过菜单->工具->选项->高级->HTML head编辑器来自动插入以上代码。

功能

  • JS代碼中,變量 FirstH1BookName 等於true時啟用書名模式(見效果圖1)這是考慮到有的人可能用Markdown來寫書之類的,比如我自己,在書名模式下,第一個標題會被當成 書名 並應用不同的格式,並且不會計在編號中,當為False時為普通模式(見效果圖2),不明白的話試試看就清楚了。

  • 點擊窗口最左邊的綠色小條可以收起整個目錄。

效果

效果如下圖: 示例頁:傳送

書名模式

開啟書名模式

普通模式

關閉書名模式

注意

目錄只能使用到3級目錄,超出3級的話會出錯

參考項目: https://github.com/chris-peng/markdown_nav