Feature: Add an option to allow indention
Farnsi opened this issue · 5 comments
Currently the lines are trimed on output.
I want to show an indented message under the subject
Example:
- Subject
The Message
Current output is:
- Subject
The Message
In Handlebar templates we can manually control the indention with ~
, example {{~subject~}}
removes whitespace before and after.
Does custom templates not solve this?
@cookpete I use a custom template, the problem is, that the rendered content will be trimmed on output by auto-changlog, not by handlebars.
Ah good spot! I should add an option to not remove indentation from templates.
Or maybe just never remove indentation for custom templates? Actually, that gets tricky when you have four spaces of indentation...
like this
So maybe a --keep-indentation
option?
Yes for compatibility it would be the best solution.
I've found this to be an issue for me too.
I don't work with web tech, but I had a quick peek into the codebase.
This was fairly quick and easy to figure out.
You'd want to do the following:
- Add an option to
run.js
- This will propagate into template generator
Lines 28 to 31 in 79acd55
- Check the option in
template.js
, skipping thecleanTemplate
method if the option is toggled.
auto-changelog/src/template.js
Lines 76 to 100 in 79acd55
I believe that should do it. Fairly simple patch.
In my case, I wanted to do nested bullet points
- Main Text
- Sub Text
Currently it's not possible to do when generating markdown.
Anyway, with that out of the way, it's really down to just deciding what an appropriate name for the parameter would be, --keep-whitespace
would be my preferred choice.