-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow subsections and section less items #22
Conversation
Tests do run on my Windows. Feels like a new line failure thing. |
The code looks good! If you can get it green I'd be happy to merge and re-release! |
I believe there is another direction possible to support Fable changelog and any changelog like the one from Nacara that are really detailed. #16 That direction is to consider Changelog as a header specification on top of Markdown. What I mean by that is that Changelog specs is to structure the header of the file which consist in:
Example: # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
## 2.0.0 - 2023-12-04
### Added
<!-- Markdown body -->
### Changed
<!-- Markdown body -->
## 1.0.0 - 2023-12-03
### Added
<!-- Markdown body --> The * Item 1
* Item 2 or complex like: #### JavaScript
* Item 1
* Item 2
#### All
* Layout system has been added
User can add `layouts` node to `nacara.js`, it takes an object.
Example:
```js
{
default: standard.Default,
changelog: standard.Changelog
}
``` The idea is that this will simplify the parser a lot because it will not depends on a specific structure. Domains would looks like: type ChangelogData =
{
Added: string
Changed: string
Deprecated: string
Removed: string
Fixed: string
Security: string
Custom: Map<string, string>
}
type Release =
{
Version: SemanticVersion
Date: DateTime
Categories: ChangelogData option
}
type Changelog =
{
Title: string // option
Description: string option
Unreleased: ChangelogData option
Releases: ChangelogData option
} |
Yeah maybe, it looks like KeepAChangelog/src/Ionide.KeepAChangelog.Tasks/Library.fs Lines 23 to 32 in e30765a
is just combining items again as string. |
RE: @MangelMaxime's comments, I think that's a good direction to go for this library. The KAC 'spec' (such as it is) mentions no structure to the sections, just that there are sections. On the initial version of Ionide.KAC I probably over-corrected because the examples on the KAC website are mostly lists. |
@baronfel this is ready. It can now parse all Fable changelog files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, but before I merge @nojaf can you please validate if the change to use string interpolation breaks VS consumers?
WHAT
🤖[deprecated] Generated by Copilot at 4a1d224
Added support for more flexible changelog formats. The
Section
type now has aSubSections
property and can be empty. TheParser
andToMarkdown
functions can handle changelogs with sub-sections and section-less entries. The tests were updated accordingly.🤖[deprecated] Generated by Copilot at 4a1d224
🎁🛠️🧪
WHY
HOW
🤖[deprecated] Generated by Copilot at 4a1d224
Section
type andSectionLessItems
field to support sub-sections and section-less entries (link, link, link, link, link, link)ToMarkdown
method to handleSection
type andSectionLessItems
field in markdown output (link, link)pEntriesInASection
function to parse items and sub-sections in a section (link)pCustomSection
andpSection
parsers to usepEntriesInASection
function (link, link)pSectionLessItems
parser to parse entries that are not tied to any section (link, link)FableSample
andFableSectionLessSample
values (link)Oh hey @baronfel!
This is an attempt to make KAC work for the Fable changelogs.
They didn't fully play ball and have subsections or items without sections.
This PR aims to support those as well.