Description
Continuing the conversation from #4371, the goal is to create a parser that accepts markdown as input as spits out a list of headings that can be easily formatted into a table of contents or similar.
@isoos From the other thread:
The TocNode is an incomplete API for this use case: it doesn't hold the content, it was created for a different reason, and while it could be simple to reuse it, it may be better to just have a clean start. As we really want to use this for changelog parsing too, it could be a better starting point to collect different kind of requirements for that and how it would look in a parsed form.
For reference, here is the TocNode
class:
pub-dev/app/lib/frontend/templates/views/shared/toc.dart
Lines 35 to 51 in 4acdc2b
Can you elaborate here:
- Why is the content needed? For either the changelog or details page, isn't it enough to just have the title be a clickable link? Right now it is a string, I can definitely change it to be a markdown
Node
, but I don't see where we'd want the content to be - What exactly do we want for the Changelog page? A similar ToC of all releases? Should we nest for major/minor/patches? That would be tricky if the author did not use nested headers. I went through some older issues and PRs and couldn't really find a clear description of exactly what's wanted here
- Should I make my new API be the new
TocNode
and refactor the admin page to use that?