From effe60f50056c02c94a6184f3be948f53451970c Mon Sep 17 00:00:00 2001 From: Chris Clark Date: Sat, 18 Jun 2022 06:24:23 -0400 Subject: [PATCH 1/2] Set default indentation to 2 Two spaces conforms with markdownlint. See: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md007 --- markdown-toc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown-toc.el b/markdown-toc.el index 869ae57..cc885ac 100644 --- a/markdown-toc.el +++ b/markdown-toc.el @@ -95,7 +95,7 @@ Example: '-' for unordered lists or '1.' for ordered lists." :group 'markdown-toc :type 'string) -(defcustom markdown-toc-indentation-space 4 +(defcustom markdown-toc-indentation-space 2 "Let the user decide the indentation level." :group 'markdown-toc :type 'integer) From a98e1d17eb995666ce0f6a23d9c7feff40e51bfa Mon Sep 17 00:00:00 2001 From: Chris Clark Date: Sun, 19 Jun 2022 04:23:12 -0400 Subject: [PATCH 2/2] Update tests --- test/markdown-toc-test.el | 240 +++++++++++++++++++------------------- 1 file changed, 120 insertions(+), 120 deletions(-) diff --git a/test/markdown-toc-test.el b/test/markdown-toc-test.el index 82a6be8..0a5a633 100755 --- a/test/markdown-toc-test.el +++ b/test/markdown-toc-test.el @@ -22,19 +22,19 @@ (ert-deftest markdown-toc--to-markdown-toc () (should (equal "- [some markdown page title](#some-markdown-page-title) - [main title](#main-title) - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) - - [Melpa-stable](#melpa-stable) - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) + - [Melpa-stable](#melpa-stable) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) - [another title](#another-title) - - [with](#with) - - [some](#some) - - [heading](#heading)" + - [with](#with) + - [some](#some) + - [heading](#heading)" (markdown-toc--to-markdown-toc '((0 . "some markdown page title") (0 . "main title") (1 . "Sources") @@ -120,16 +120,16 @@ NB-LINES-FORWARD is the number of lines to get back to." **Table of Contents** - [something](#something) - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) - - [Melpa-stable](#melpa-stable) - - [Melpa (~snapshot)](#melpa-snapshot) - - [[配置 SPF Sender Policy Framework 记录]](#配置-spf-sender-policy-framework-记录) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) + - [Melpa-stable](#melpa-stable) + - [Melpa (~snapshot)](#melpa-snapshot) + - [[配置 SPF Sender Policy Framework 记录]](#配置-spf-sender-policy-framework-记录) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -173,16 +173,16 @@ For this, you need to install a snippet of code in your emacs configuration file - [something](#something-1) - [something](#something-2) - [something](#something-3) - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) - - [Melpa-stable](#melpa-stable) - - [Melpa (~snapshot)](#melpa-snapshot) - - [[配置 SPF Sender Policy Framework 记录]](#配置-spf-sender-policy-framework-记录) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) + - [Melpa-stable](#melpa-stable) + - [Melpa (~snapshot)](#melpa-snapshot) + - [[配置 SPF Sender Policy Framework 记录]](#配置-spf-sender-policy-framework-记录) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -229,7 +229,7 @@ For this, you need to install a snippet of code in your emacs configuration file ** foobar ** - [something](#something) - - [Sources](#sources) + - [Sources](#sources) blahblah. @@ -250,15 +250,15 @@ blahblah. (should (equal " **Table of Contents** - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) - - [Melpa-stable](#melpa-stable) - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) + - [Melpa-stable](#melpa-stable) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -298,15 +298,15 @@ For this, you need to install a snippet of code in your emacs configuration file **Table of Contents** - [Packages](#packages) - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) - - [Melpa-stable](#melpa-stable) - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) + - [Melpa-stable](#melpa-stable) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -327,12 +327,12 @@ For this, you need to install a snippet of code in your emacs configuration file " **Table of Contents** - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -359,15 +359,15 @@ For this, you need to install a snippet of code in your emacs configuration file **Table of Contents** - [Packages](#packages) - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) - - [Melpa-stable](#melpa-stable) - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) + - [Melpa-stable](#melpa-stable) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -390,12 +390,12 @@ For this, you need to install a snippet of code in your emacs configuration file **Table of Contents** - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -422,15 +422,15 @@ For this, you need to install a snippet of code in your emacs configuration file **Table of Contents** - [Packages](#packages) - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) - - [Melpa-stable](#melpa-stable) - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) + - [Melpa-stable](#melpa-stable) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -453,12 +453,12 @@ For this, you need to install a snippet of code in your emacs configuration file **Table of Contents** - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -482,16 +482,16 @@ For this, you need to install a snippet of code in your emacs configuration file **Table of Contents** - [something](#something) - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) - - [Melpa-stable](#melpa-stable) - - [Melpa (~snapshot)](#melpa-snapshot) - - [[配置 SPF Sender Policy Framework 记录]](#配置-spf-sender-policy-framework-记录) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) + - [Melpa-stable](#melpa-stable) + - [Melpa (~snapshot)](#melpa-snapshot) + - [[配置 SPF Sender Policy Framework 记录]](#配置-spf-sender-policy-framework-记录) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -535,15 +535,15 @@ For this, you need to install a snippet of code in your emacs configuration file **Table of Contents** - [Packages](#packages) - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) - - [Melpa-stable](#melpa-stable) - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) + - [Melpa-stable](#melpa-stable) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -566,12 +566,12 @@ For this, you need to install a snippet of code in your emacs configuration file **Table of Contents** - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -643,12 +643,12 @@ For this, you need to install a snippet of code in your emacs configuration file " **Table of Contents** - - [Melpa (~snapshot)](#melpa-snapshot) - - [Install](#install) - - [Load org-trello](#load-org-trello) - - [Alternative](#alternative) - - [Git](#git) - - [Tar](#tar) + - [Melpa (~snapshot)](#melpa-snapshot) + - [Install](#install) + - [Load org-trello](#load-org-trello) + - [Alternative](#alternative) + - [Git](#git) + - [Tar](#tar) To install **org-trello** in your emacs, you need a few steps. @@ -751,8 +751,8 @@ should not matter ")))) (with-temp-buffer (insert "- [some markdown page title](#some-markdown-page-title) - [main title](#main-title) - - [Sources](#sources) - - [Marmalade (recommended)](#marmalade-recommended) + - [Sources](#sources) + - [Marmalade (recommended)](#marmalade-recommended) # main title ## Sources