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

Why is there no support for multiple templates? #4

Closed
Ayfri opened this issue Feb 9, 2021 · 4 comments
Closed

Why is there no support for multiple templates? #4

Ayfri opened this issue Feb 9, 2021 · 4 comments
Labels
wontfix This will not be worked on

Comments

@Ayfri
Copy link

Ayfri commented Feb 9, 2021

I think that you should make multiple differents templates, ones with categories, ones without, one without emojis, etc, and let us select it through the CLI (with a --template argument for example).
This would greatly improve this project!

@maximousblk
Copy link
Owner

I knew someone would ask 😃

I originally wanted this to be more of a DIY solution where you have the info and you can arrange it as you desire and do whatever with the output.

I would add multiple templates but there is so much info and so many ways to create changelogs and everyone wants it to be a certain way. so I only have one (opinionated) template by default and export all the info (sorted and unsorted) for people to create their own.

for example, in the default template, I put a link to the commit with the short hash. some like to have the link on the commit text, some like to put it on the end, some only like to put the hash but not a link, some people would prefer not to have it altogether. this would either require me to add every requested template, or create a templating language which is dynamic enough. I'd rather that language be javascript/typescript than creating my own.

@maximousblk maximousblk added the wontfix This will not be worked on label Feb 9, 2021
@maximousblk maximousblk pinned this issue Feb 9, 2021
@Ayfri
Copy link
Author

Ayfri commented Feb 9, 2021

Mh I see, but for example:
When I tried to modify this to only have only 1 "Changelog" category, I struggled a lot because code is very axed for multiple categories, maybe you should change this, like regrouping every part of the configuration in 1 ts file?

@maximousblk
Copy link
Owner

maximousblk commented Feb 10, 2021

if you just want a list of commits, you can do something like:

// ghlog@0.2.x
const { _meta } = await getChangeLog("owner/repo");
const changelog = `CHANGELOG

${ _meta.commits.all.map(({ message }) => `- ${message}` ).join("\n") }
`

// write `changelog` to file

I'm trying to think of a good way for how to structure the output of getChangeLog() so that it's as flexible as possible.

@Ayfri
Copy link
Author

Ayfri commented Feb 10, 2021

Mh I see okay, I was just doing it badly!

@maximousblk maximousblk changed the title Suggestion: Add multiple template with template selection Why is there no support for multiple templates? Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants