Closed nojaf closed 10 months ago
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. https://github.com/ionide/KeepAChangelog/issues/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 markdown body
can be somehing as simple as:
* 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:
```fs
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
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.
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.