-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'features/discrete-headings'
* features/discrete-headings: (27 commits) Rewrite according to suggestions Remove requirements.txt as it's not related to the feature itself Cleanup: Removing extra white space Delete wrong line Fix sentence Add message for 4.1.0 Update TOC Add 'Excluded heading' into README Fix unit test Fix unit tests pip install black pip install pycodestyle Fix Python version Suppress appveyor error? rename discrete to exclude, fix unittests unit tests fixed quote alignment quotes rename: discrete → exclude Cleanup ...
- Loading branch information
Showing
7 changed files
with
100 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.7.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# MarkdownTOC - 4.1.0 | ||
|
||
## Changes | ||
|
||
- Add Excluded heading feature Ref: [#140](https://github.com/naokazuterada/MarkdownTOC/issues/140), [#149](https://github.com/naokazuterada/MarkdownTOC/pull/149) | ||
- Update "Coding Style" in CONTRIBUTING.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# coding:utf-8 | ||
from base import TestBase | ||
|
||
class TestExcludeHeading(TestBase): | ||
'''Ignore exclude heading''' | ||
|
||
# for debug | ||
# def tearDown(self): | ||
# pass | ||
|
||
text_1 = ''' | ||
<!-- MarkdownTOC --> | ||
<!-- /MarkdownTOC --> | ||
# heading 1 | ||
<!-- MarkdownTOC:excluded --> | ||
# heading 2 | ||
# heading 3 | ||
''' | ||
|
||
def test_exclude_heading(self): | ||
'''Default is no limit''' | ||
toc = self.init_update(self.text_1)['toc'] | ||
self.assert_In('- heading 1', toc) | ||
self.assert_NotIn('- heading 2', toc) | ||
self.assert_In('- heading 3', toc) | ||
|
||
text_2 = ''' | ||
<!-- MarkdownTOC --> | ||
<!-- /MarkdownTOC --> | ||
# level 1 | ||
<!-- MarkdownTOC:excluded --> | ||
## level 2 | ||
### level 3 | ||
<!-- MarkdownTOC:excluded --> | ||
#### level 4 | ||
<!-- MarkdownTOC:excluded --> | ||
##### level 5 | ||
###### level 6 | ||
''' | ||
|
||
def test_exclude_heading_level(self): | ||
'''Existence and level is correct''' | ||
toc = self.init_update(self.text_2)['toc'] | ||
# existence | ||
self.assert_NotIn('- level 2', toc) | ||
self.assert_NotIn('- level 4', toc) | ||
self.assert_NotIn('- level 5', toc) | ||
# level | ||
self.assert_In('''- level 1 | ||
- level 3 | ||
- level 6''', toc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters