-
Notifications
You must be signed in to change notification settings - Fork 122
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
Markdown lines should not have '# ' prepended #648
Comments
build.py line 235 btw |
for reference towncrier/src/towncrier/build.py Lines 230 to 239 in afa6cc0
|
Thanks for the report I am not very familiar to how people want to use towncrier with Markdown. I am only using towncrier with reStructuredText. I can see that this change was introduced here #610 Isn't this a bug ? Why would you want this generated: Do we need to ensure backward compatiblity ? |
Thanks for the quick reply. I'm relatively new to towncrier so didn't want to pre-supposed a solution. Given how recent the change is and how nobody else has piped up for a pretty obvious bug - I think the right short-term solution is just to get rid of '# ' in that f-string if it's a recent addition and few people (if any) use it. Worse case is that people who expect a Heading 1 (title) formatting can just put "# " in their title_string. This also has the benefit that you aren't putting markdown-specific encodings into the code. |
@SmileyChris as the author - any comments re: above? |
Well. By reading the PR, I can see that the Can you please provide your full configuration so that we can review what can be done ? If you need to have the titles as sub-sections, maybe we can have this logic for MD format:
I am not sure how valid is this logic ... just brainstorming on Sunday night :p |
Fundamentally, having one format won't work given how the code is now. Markdown uses '#' ➝ '######' as a preface for various header levels, while rst uses underlines. My config is per below. A few things:
I'd posit that the quick solution again is just to remove '# ' on that line. I would actually recommend avoiding going for a "one line for any format" kinda model... while there are a lot of similarities with rst & md, there are enough differences that things will get obnoxious quickly, like links. Better to let the user define it with whatever template they are using, or just don't support md and tell all us md users to either hop on the rst bus or use our favorite rst_to_md tool. :) Note: the only other place I see markdown is for the issue type headers, which are correctly (IMHO) third-level and using three '###'s, but those look like they are in the template.md file (which overall seems OK, although I'm trying to figure out how title_format from above gets inserted as it clearly does in my setup but I don't see exactly how). |
Thanks. The markup should be left to the title_format and the template file. I agree that removing the I have approved the previous PR as I don't care that much about Markdown , and this was something that was ok for a Markdown user. If you have time, please consider sending a PR to remove the code and update the tests. Maybe extend the current markdown test to improve coverage for various configurations. Thanks |
Just to jump in. Firstly, thanks for the package, it is amazing. As another markdown user, #610 was a (slightly) painful regression. I hope to find time to make a PR to fix this. If you want someone to ping to review markdown related PRs, I'd be happy to volunteer. |
I will try to ping you for MD related reviews. The imporant part is to make sure we have a good set of tests for all kind of Markdown usecase. The problem is that towncriew was started with RST only support, and it was initially created only to support the specific needs for the twisted/twisted repo. So, I think that the main problem with MD support, is the lack of a good set of tests. |
While we wait for a fix to twisted/towncrier#648
Fair, will see what I can do |
Fix is in #651. I think it needs a maintainer to approve the workflow run? |
Sorry for the lethargic response, but yes, it looks like my fix in #610 was definitely a bug. Removing the underlines made sense, but assuming the "#" was silly. PS @adiroiban -- using the markdown doc page to determine what should and shouldn't be done isn't the best course of action. In reality, I'd prefer that page be deprecated or rewritten because unless you specifically care about the specific "Keep a Changelog" standardazation then you can now use towncrier for markdown without any of the steps required on that page. |
Thanks for the feedback. So my only reference for MD is the current documentation and tests. I think that is up to the people who use markdown to make sure that the towncrier tests and documentation are ok |
Is there interest in this as well for the |
Hi Ilan. Sorry I don't understand your request. If there is anything that you would like to see in |
@adiroiban What I mean is that if you do this same thing with each individual fragment title format, you end up with the extra space as in the full title when using markdown i.e.,
produces |
With twisted/towncrier#648 now fixed, we can just rely on a correctly-set title_format again for properly formatted markdown changelogs.
if using Markdown, each title has a '# ' prepended (build.py). However, this makes it a top-line header, and the example creates titles like:
# ## <rest of title>
as opposed of:
## <rest of title>
Certainly a few ways to fix this, such as a config like "default_md_prefix" which would be "# " and could be overridden to "" to ensure backwards compatibility. Happy to send a PR.
The text was updated successfully, but these errors were encountered: