Colin-b / keepachangelog

Convert keep a changelog markdown file into python dict

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parse category entries

aogier opened this issue · comments

Ciao, I'd like to share a thought w/ you. Given the problem domain I think stripping the leading - in category entries could be the right thing to do, you already assert an entry is an entry by placing it in relevant section after all.

That could be a future-proof evolution of the lib (eg. tomorrow KAC choose to use * instead of -) that could even keep it as a valuable resource should someone decide to implement a transcoding app.

And btw, I'm totally in a total rust reimplementation, getting faster speed by two order of magnitude. Do you like rust? I do like it, I'm still learning but so far so good!

ciao

What behaviour would you expect for sub structures ? Let's say I have the following:

  • Entry 1
    • sub entry 1
    • sub entry 2

Would you expect a list with 3 entries or a list with one entry being a dict with one key linking to a list of 2 entries?

In my opinion what you've already did fit perfectly, although stripping parsed data from presentation bit could be more useful, ie. '- added foo' => 'added foo'. The fact those entries are indeed already part of a list is expressed by them being part of a list, no need to include presentation's bit in data struct. What do you think? :)

ps: of course it should strip any presentation information, not only the '- ' string eg '*' et al. I'll work on that on my rust implementation because in my opinion that's the right thing to do!

Ciao :)

Change is available in 0.3.0