Skip to content

feat: combining shared code markdown renderer readme & changelog #2717

Open
WilcoSp wants to merge 258 commits into
npmx-dev:mainfrom
WilcoSp:feat/markdown-kit
Open

feat: combining shared code markdown renderer readme & changelog #2717
WilcoSp wants to merge 258 commits into
npmx-dev:mainfrom
WilcoSp:feat/markdown-kit

Conversation

@WilcoSp

@WilcoSp WilcoSp commented May 11, 2026

Copy link
Copy Markdown
Contributor

click here to preview pr

🔗 Linked issue

🧭 Context

Currently changelog uses a seperate marked markdown renderer from readme, this pr takes the shared code and makes it into a "markdown kit" so that code that can be shared will be shared

📚 Description

Moves shared code for both changelog & readme to a shared markdown kit while still allowing for each to have their unique needs.

additional changes

  • Heading have been changed to be more consistent and easier to use by users to the following:
    ## heading -> <hx><a href="#...>heading</a></hx>
    ## [Example](https://example.com) -> <hx><a href="https://example.com">Example</a><a href="#...></a></hx>
  • Tests have been added for the changelog markdown renderer for what not shared or changed for changelog.
  • Thanks to the tests also some bugs have been fixed.
  • Also for changelog.md the jumping to the requested version has been fixed, now if "3.5.1" is requested then "3.5.11" won't be selected.
  • 502 will now only be returned when ungh.cc is exhausted, others have been changed to 500
  • at package.takumi.vue & externallinks.vue the provider icons are now given via the useProviderIcon composable
  • change the unocss config to include useProviderIcon composable
  • fixed a bug to where when switching between package tabs that the message "package doesn't have changelogs" is being shown while earlier it did have it.
  • changed how the skeleton loaders is shown in package changelog, now pending is being used from useLazyFetch in the ChangelogReleases & ChangelogMarkdown components instead of using <suspense> at the package-changelog page, this should remove/reduce the blank screen between showing the skeleton laoders & showing data.
  • each release has now a direct link to the original release on github (and future git providers)
  • adding minor nl translations
  • fixed issue when #{issue/pr number} starts a line/listItem that it's transformed to a heading
    • added an exception for changelog to the heading extension so that issues/PRs won't be turned into headings
    • because of ^, changelog has it's own instance of marked, I've named it clMarked to prevent future confusion
  • some further smaller refactors

AI usage

For app/utils/header-version-matcher.ts I've used Gemini to get the regex for matching more exact the requested version in a toc item text

The regex for the heading extension to excempt issues/PRs is thanks to chatgpt, didn't know \b existed in regex.

notes

The branch of this pr was based on #1233 initially, that's why there are so many commits, file changes does show correctly what has changed

the createLink factory function will receive in future PRs changes, due to future plans to format git links to #pr, @person etc

WilcoSp and others added 30 commits February 8, 2026 20:47
excludes changelog releases due to needing api calls
…gelog info endpoint will return ChangelogMarkdownInfo instead of ChangelogReleaseInfo
…ded to changelog markdown rendering

added scroll margin to the changes page
now showing the date as of when the release was made
fixed icon for changelog button at package page
@WilcoSp

WilcoSp commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

I'm putting this into draft, so that I can include the fix for #2869 into this pr.

@WilcoSp WilcoSp marked this pull request as draft June 8, 2026 09:46
…began at the beginning of an sentence/listitem
@WilcoSp WilcoSp marked this pull request as ready for review June 8, 2026 18:10
@WilcoSp WilcoSp marked this pull request as draft June 8, 2026 18:17
@WilcoSp

WilcoSp commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

fixed the issue for #2869 by having an exemption for issue/pr format #{number} for in changelog in the atx heading extension to allow for no space headings.
for this I also needed to define a new separate Marked instance for changelog, otherwise Readme's atx heading ext settings will override the one for changelog.

@WilcoSp WilcoSp changed the title refactor: combining shared code markdown renderer readme & changelog feat: combining shared code markdown renderer readme & changelog Jun 15, 2026
@WilcoSp

WilcoSp commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

is it maybe an idea to rename this pr due to the many changes?

maybe something like "feat: several improvements to changelog", also the "refactor" was changed to "feat" due to the ci not allowing it anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review This PR is waiting for a review from a maintainer

Projects

None yet

3 participants