Skip to content

Commit

Permalink
feat: Add function to generate TOC starting with h2
Browse files Browse the repository at this point in the history
  • Loading branch information
qjcg committed Aug 19, 2024
1 parent a5c4838 commit 1e8d090
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 40 deletions.
10 changes: 8 additions & 2 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
;;; Directory Local Variables -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")

((markdown-mode . ((markdown-toc-indentation-space . 2)
(markdown-toc-header-toc-title . "## Contents"))))
((markdown-mode . ((markdown-toc-user-toc-structure-manipulation-fn . (lambda (markdown-list)
(let* ((remaining-list (cdr markdown-list))
(processed-list (mapcar (lambda (item)
(cons (1- (car item)) (cdr item)))
remaining-list)))
processed-list)))
(markdown-toc-indentation-space . 2)
(markdown-toc-header-toc-title . "## Contents"))))
2 changes: 1 addition & 1 deletion .ecrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"Exclude": [".git", "LICENSE"]
"Exclude": [".git", "LICENSE", ".dir-locals.el"]
}
73 changes: 36 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,42 @@ PRs welcomed!
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
## Contents

- [Awesome Typst](#awesome-typst)
- [Official Project Links](#official-project-links)
- [Unofficial Project Links](#unofficial-project-links)
- [Integrations & Tools](#integrations--tools)
- [Browser Extensions](#browser-extensions)
- [Chatbots](#chatbots)
- [CI/CD](#cicd)
- [CLI Tools](#cli-tools)
- [Editors](#editors)
- [Editor Integrations](#editor-integrations)
- [Online Tools](#online-tools)
- [Programming](#programming)
- [Typst As A Service](#typst-as-a-service)
- [Templates & Libraries](#templates--libraries)
- [Official](#official)
- [General](#general)
- [Assignments](#assignments)
- [CV](#cv)
- [Examples](#examples)
- [Templates](#templates)
- [Calendar / Timetable](#calendar--timetable)
- [Footnotes & Endnotes](#footnotes--endnotes)
- [Formatting](#formatting)
- [Graphics](#graphics)
- [Letters](#letters)
- [Linguistics](#linguistics)
- [Mathematics](#mathematics)
- [Music](#music)
- [Physics](#physics)
- [Conferences](#conferences)
- [Journals](#journals)
- [Grants/Proposals](#grantsproposals)
- [Engineering](#engineering)
- [Plotting](#plotting)
- [Posters](#posters)
- [Scripting](#scripting)
- [Slides](#slides)
- [Official Project Links](#official-project-links)
- [Unofficial Project Links](#unofficial-project-links)
- [Integrations & Tools](#integrations--tools)
- [Browser Extensions](#browser-extensions)
- [Chatbots](#chatbots)
- [CI/CD](#cicd)
- [CLI Tools](#cli-tools)
- [Editors](#editors)
- [Editor Integrations](#editor-integrations)
- [Online Tools](#online-tools)
- [Programming](#programming)
- [Typst As A Service](#typst-as-a-service)
- [Templates & Libraries](#templates--libraries)
- [Official](#official)
- [General](#general)
- [Assignments](#assignments)
- [CV](#cv)
- [Examples](#examples)
- [Templates](#templates)
- [Calendar / Timetable](#calendar--timetable)
- [Footnotes & Endnotes](#footnotes--endnotes)
- [Formatting](#formatting)
- [Graphics](#graphics)
- [Letters](#letters)
- [Linguistics](#linguistics)
- [Mathematics](#mathematics)
- [Music](#music)
- [Physics](#physics)
- [Conferences](#conferences)
- [Journals](#journals)
- [Grants/Proposals](#grantsproposals)
- [Engineering](#engineering)
- [Plotting](#plotting)
- [Posters](#posters)
- [Scripting](#scripting)
- [Slides](#slides)

<!-- markdown-toc end -->

Expand Down

0 comments on commit 1e8d090

Please sign in to comment.