Skip to content
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

When using towncrier create --edit, use .md or .rst #527

Closed
ocharles opened this issue Jul 7, 2023 · 5 comments · Fixed by #594
Closed

When using towncrier create --edit, use .md or .rst #527

ocharles opened this issue Jul 7, 2023 · 5 comments · Fixed by #594

Comments

@ocharles
Copy link

ocharles commented Jul 7, 2023

Currently when I use towncrier create --edit, my $EDITOR is opened pointing at a .txt file. It would be better if this was actually a .md or .rst file, as my editor will then automatically enable syntax highlighting.

@adiroiban
Copy link
Member

adiroiban commented Jul 7, 2023

thanks for the report

can you please provide more info about how to reproduce this?

What is the actual result and the expected result?

Which $EDITOR do you use?

This is what I get on my side, no .txt file :)

$ towncrier create --edit 123.feature

VI is opened, I change the file, save and exit

Created news fragment at /home/adi/chevah/towncrier/src/towncrier/newsfragments/123.feature

$ git st
?? src/towncrier/newsfragments/123.feature

@ocharles
Copy link
Author

ocharles commented Jul 7, 2023

When vim is open are you not editing a /tmp/foo.txt file? That's what happens for me, using Helix. Once I'm back home I'll try and provide more details

@adiroiban
Copy link
Member

adiroiban commented Jul 7, 2023

I got it now :)
True. The file is /tmp/editor-9c8f91am.txt

So, actual behaviour

$ towncrier create --edit 123.feature

The editor is opened with a file with a name like /tmp/editor-9c8f91am.txt

Expected behaviour:

$ towncrier create --edit 123.feature

The editor is opened with a file with a name like /tmp/editor-9c8f91am.rs

Happy to review a PR for this.

Not sure how to tell if you want MD or RST.

I guess that we will one more configuration option for towncrier, to specify the format if the files... this can be a separate ticket / PR.

@ocharles
Copy link
Author

ocharles commented Jul 7, 2023

Not sure how to tell if you want MD or RST.

I think the same way that towncrier build decides which format to use (which I think is by checking the extension of filename).

@adiroiban
Copy link
Member

I see some work was done here #483

True. we can use the file extension.

Instead of using .txt, use the same extension as the filename configuration.

Sound like a good plan :)

@SmileyChris SmileyChris mentioned this issue May 6, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants