-
Notifications
You must be signed in to change notification settings - Fork 166
New changelog page. #3327
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
New changelog page. #3327
Conversation
sigurdm
left a comment
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.
I like that we try to parse the changelog.
I worry that we are too lenient.
Perhaps we should document a much more strict format, and give a pana penality to packages that fail to parse.
We can land something like this to get on with the new design.
| for (final node in nodes) { | ||
| final version = (node is m.Element && | ||
| node.children.isNotEmpty && | ||
| node.children.first is m.Text) |
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 implies that styled text is not accepted (that would give a nested m.Element)
|
|
||
| String markdownToHtml(String text, String baseUrl, {String baseDir}) { | ||
| /// Renders markdown [text] to HTML. | ||
| String markdownToHtml( |
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.
We should split this in three parts along the lines of:
m.Document parseMarkdown(text, baseUrl, baseDit)m.Document formatChangelog(m.Document)String markdownToHtml(m.Document)
| return null; | ||
| } | ||
|
|
||
| /// Group corresponding changelog nodes together, if it matches the following |
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.
We need to document our supported changelog formats publically.
That should of course be handled in another pr.
| /// pattern: | ||
| /// - version identifiers are the only content in a single line | ||
| /// - heading level or other style doesn't matter | ||
| /// - optional `v` prefix is accepted |
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.
@jonasfj suggested other variations that we might want to recognize:
## version 1.0.0
## v. 1.0.0
## V1.0.0
| var nodes = document.parseLines(lines); | ||
|
|
||
| if (isChangelog) { | ||
| nodes = _groupChangelogNodes(nodes).toList(); |
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.
We could consider trying to remove a heading # Changelog to make changelogs appear more uniform.
| /// Group corresponding changelog nodes together, if it matches the following | ||
| /// pattern: | ||
| /// - version identifiers are the only content in a single line | ||
| /// - heading level or other style doesn't matter |
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.
@jonasfj suggests we might want to limit ourselves to allowing h1 and h2
|
I agree with all of the suggestions, but the feature space exploded a bit, and it is slightly unrelated to the UI changes. I'd rather land a PR with the UI structure, and iterate on the other features separately. I've collected the requests that were not addressed yet in the PR here: #3331, let me know which of those do you want to land with this PR. |
sigurdm
left a comment
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.
LGTM
I've started to implement this with CSS-only, but it only worked for a limited case. Rewriting the markdown tree is a bit more work, but creates a consistent experience.
Desktop view: