-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
changelog markdown lint issue #274
Comments
Definitely prefer the line breaks, not so sure about moving from headings to nested lists. Why that change? |
Hey there @clarsonneur, I appreciate you bringing up this issue. Headers in Markdown are often auto-linked, the choice to make groupings headers is purposeful as they are headers in a changelog. I'm not familiar with Markdown Lint but I also know that efforts to lint Markdown are often tricky considering there are myriad different competing Markdown implementations that don't follow the same rules or even offer the same syntax. I'd be fine to consider this if we were producing broken output but we're not, this is a concern that you can solve by making an exception to your linter. Or perhaps contributing to the linter to fix the perfectly valid Markdown syntax we're using. That said, have you tried using appropriate line breaks for your document. There should be no reasons to smoosh all these lines together, does this pass your linter: ## [Unreleased]
### Added
- security tools
- Make
### Changed
- Update to python3
- Helm v2.12.2
### Removed
### Fixed
## [1.0.1] - 2019-07-01
### Changed
- Kops v1.11.0
I know a lot of people find space and line breaks wasteful, but they often have meaning, especially in Markdown which is a paragraph-sensitive markup language that defaults to producing inline HTML elements when lines aren't separated by character returns. See: https://daringfireball.net/projects/markdown/syntax#p A simple example is the difference between these two Markdown chunks: This
is
multiple
lines Output: This This
is
multiple
lines Output: This is multiple lines In GitHub-flavored Markdown, the output is multi-line in both cases. In many other forms of Markdown, they're not. There are also several Markdown implementations (or configurations if you use language-specific parsers) that prohibit header tangence (no empty line between the headers and the following content) with the rest of the content. I suspect this might be what you're dealing with here. But even if it's not. I really don't want to bend around linter rules. If we were writing changelogs in a strict markup language with consistent rules across the board, I'd be with you. It would be silly to go against the flow. The trick with Markdown is that there is no standard despite many attempts at creating one. With Keep a Changelog, I've made GitHub's Markdown parser my first target for output because in general a lot more people read the changelog Markdown output on GitHub than almost anywhere else. So you could say my linter is: does it look good on GitHub? And these days that extends to other major code hosting sites like GitLab, BitBucket, etc. PS: Sorry for the lengthy response, please don't take this as a smackdown or the end of the discussion. It's common for maintainers like me to have a lot of unpublished thoughts and reasonings about why they picked something and avoided something else, and sometimes I catch a notification right after I've had my first coffee of the day. I promise it's nothing against you. 😃 |
hi @olivierlacan, Thank you very much for your valuable feedback. And don't worry, I'm open minded, as maintainer of other projects as well... So I really appreciate your answer. I do not have the whole picture of markdown linter used by others, as well. Actually, I'm using VSC with the I believe that VSC become so popular, so for that reason, I thought that would make sense to report and contribute to your project. But this is not necessarily a good argument.
Yes, I did it. It is better than without line breaks. But no, it still reports me few warnings: Line 1:
Line 3:
Line 4:
etc ... My proposal eliminates most of those warnings. I have no trouble with line breaks in paragraph rendering and lint. So, it was really more related to line breaks after headers. An answer to @himedlooff question:
Related to github markdown, I noticed also an issue when we set, multiple times, the same header, like [...]
### changed
[...]
### changed Each headers are HTML labelled, so that we can create a link to the appropriate header. If there is duplicated headers, label are duplicated as well but then not unique. That's why I got the lint warning as well And of course, if you create a TOC (like the automated TOC plugin), it becomes unreadable and useless. |
That's a good point. I wish GFM's header anchor generator dealt with that by creating unique identifiers and appending them to duplicate headings. There's nothing wrong with having headers named the same in HTML so I don't see why that should be a limitation of a markup language that creates HTML output. This is a pretty good example of the kinds of limitations we risk falling into if we try to abide by linters. Semantically, More importantly, a grouping header list item with no children list item will end up looking like a broken entry unless something like ## [Unreleased]
- **Changed**
- Update to python3
- **Deprecated** Compared to: ## [Unreleased]
### Changed
- Update to python3
### Deprecated
That's only because
It's a pretty good argument. 😄
If I understand correctly, after the spacing changes I suggested and if you include the changelog example document headers, the only linting issue left is:
That is a concern, I agree. We can definitely talk about it. |
Yes. That's correct.
I understand and agree. FYI, In our context, we added the MD lint to the pipeline. So, that at least, we are quite sure that the document is well written from markdown perspective. The best for us, would be a |
I also use VS Code and have this problem. All that's required is:
The last issue re: duplicate headings is fixed by creating a .markdownlint.json file in the root of your workspace or project with this content:
From then on the VS Code markdown lint knows to allow that. |
This project should be fixed to just work with default, or contain proper instructions to configure linter accordingly. |
Thank you for the suggestion! As in my project I wanted to keep the rule active, but make this exception only for <!-- markdownlint-configure-file {"MD024": { "siblings_only": true } } --> |
Hi,
This site is a great reference. We use it, so that anyone can understand what really changed.
But if I follow the current syntax, as a markdown document, my markdown lint reports some bad practices.
As an example, a changelog like as follow do not respect markdow linter:
linter feedback:
In order to respect Markdown lint, I would propose such format:
For me it looks a little bit more readable, as well.
Feedback?
I can propose a PR with that kind of proposal.
The text was updated successfully, but these errors were encountered: