-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implementation: excluded heading options #149
implementation: excluded heading options #149
Conversation
Very nice! What would the default fallback value of the |
Currently it falls back to False. As I look for |
I think it's fine since it's an optional feature. It would also be good if the default behavior could be overridden in the User configuration of MarkdownTOC. |
I will work on a setting |
Rather, I believe there is no need for a true or false argument. The presence of discrete will indicate it is desired. I’ll update this PR tonight. |
@TheSecEng Thank you for creating the PR!! However, I don't understand the need for a discrete_fallback. Basically, all headings should be reflected in the TOC, and I think this discrete feature is meant to exclude some headings as exceptions. Therefore, I don't think there is a need for Wouldn't a grammar like the one below be simpler and more necessary, as @tajmone suggested in the original Issue?
@TheSecEng @tajmone How about a comment like this one?
In addition, I think that the word
Are these too much? |
The second topic is simply what I thought, the word |
- Add level check test
I believe this is the best option
|
@TheSecEng Before we move forward with this issue, could you please review the PR I sent you? |
Adding tests and some fixes
@naokazuterada Thanks ! I didn't realize you already handling the indentation level. These Unittests are working locally, I am not sure why they are failing. |
I'll let you update it and test before pushing more. |
@TheSecEng Can you merge upstream master branch? There are some fixes for failure on CI. |
oh, still failing...but I think it would be fine... same issue? @TheSecEng don't mind failure on CI, just keep checking in your local. |
Doesn't look like the same issue, I also looked at other appveyor issues and couldn't figure it out. Likely something to do with the It is ready to merge otherwise. |
@naokazuterada, sorry for the late reply .... I agree with your alternative proposal to |
@tajmone thanks for reply! I will make a final decision based on your feedbacks. @TheSecEng thanks for modifying your PR! I will see it to final check and write down docs soon. |
Hi @TheSecEng The added tests seem to fail on Windows (appveyor). It looks as if the tests need to be adjusted to work on Windows and not only on Windows.
REF: https://ci.appveyor.com/project/naokazuterada/markdowntoc/builds/33090269 Perhaps REF: https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRegex |
@naokazuterada let me know if you want a hand with the documentation or a review |
I will test that tonight. I guess maybe it’s the line endings being different on those platforms. |
@TheSecEng I am a Python n00b so I am not so familiar with the testing framework, but it looks as if the whitespace characters are interpreted literally according to file encoding. |
@TheSecEng:
I don't know Python, but I've experienced some EOL issues in various repositories CI builds due to the In Bash scripts that rely on GREP RegEx, I've solved the issue by using You can find a practical example in this Travis CI Bash script that I wrote to check for trailing whitespace: I hope this might help. |
@naokazuterada unit tests working as expected. Feel free to merge |
Thanks for the great work @TheSecEng ! |
fixes #140
Implements the feature requested in 140 by @tajmone
Discrete Heading are configurable inside of the MD file like such:
<!-- discrete=true -->
or<!-- discrete="true" -->
"
and'
or no quotesPassed the UnitTesting.
Note Unrelated
Failing unit test
test_uniquify_id_2