Repository navigation
feat: prepare the staged README for the packaged toolbox - #82
Draft
ehennestad wants to merge 2 commits into
Draft
ehennestad wants to merge 2 commits into
ehennestad wants to merge 2 commits into
Conversation
A README copied from the project root through RootFilesToPackage is the package readme on R2026b, and File Exchange shows it. Its badges and relative links only work on GitHub. packageToolbox now rewrites the staged copy named by Readme, once the version is known, with matbox.toolbox.internal.prepareReadme: - Lines made only of Markdown images are removed from the leading block, before the first line of prose. Image lines further down, such as figures, and HTML <img> lines are kept. - Relative destinations of Markdown links and images, reference definitions and the HTML attributes href, src and srcset become absolute URLs at the tag v<major>.<minor>.<patch>: blob for a file, tree for a folder, the raw URL for an image. Fenced code blocks are not changed. The repository URL comes from GITHUB_SERVER_URL and GITHUB_REPOSITORY on GitHub Actions, else from the origin remote. Without either, the links stay relative and MatBox:Package:RepositoryUrlNotFound is issued. A readme committed in the source folder is not processed. stageRootFilesForPackaging returns the paths of the staged copies, so packageToolbox can tell a staged copy from a committed file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Test Results133 tests 132 ✅ 43s ⏱️ Results for commit 9b49818. ♻️ This comment has been updated with latest results. |
ehennestad
marked this pull request as draft
November 4, 2026 11:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On R2026b the package readme is the file named by
Readme, and File Exchange shows it as the submission text. A project README copied into the package throughRootFilesToPackageis written for GitHub: its badges and relative links and image paths do not resolve on File Exchange.Changes
packageToolboxrewrites the staged copy of the file named byReadmeafter the version is known, with the newmatbox.toolbox.internal.prepareReadme. A readme committed in the source folder is not changed.stageRootFilesForPackagingnow returns the paths of the copies it staged, which is howpackageToolboxtells the two apart.<img>lines, such as logos, are kept.href,srcandsrcsetbecome absolute at the tagv<major>.<minor>.<patch>of the packaged version. A file becomes<repository>/blob/<tag>/<path>, a folder<repository>/tree/<tag>/<path>, and an imagehttps://raw.githubusercontent.com/<owner>/<repo>/<tag>/<path>(<repository>/raw/<tag>/<path>off github.com). A leading./or/is dropped and a query or fragment is kept. Destinations with a scheme, starting with#,//or../, and everything inside fenced code blocks are left as they are.matbox.toolbox.internal.getRepositoryUrltakes the repository fromGITHUB_SERVER_URLandGITHUB_REPOSITORYon GitHub Actions, else from theoriginremote, with SSH addresses and credentials converted tohttps://<host>/<owner>/<repo>. Without either, links stay relative andMatBox:Package:RepositoryUrlNotFoundis issued.prepareReadmeFilereads and writes the readme as UTF-8.PrepareReadmeTestcovers the transform and the repository URL. InTasksTest, the packaged readme of theReadmetest is now compared with the processed text, and a new test checks that a committed readme is packaged unchanged.docs/ci.mddescribe the processing.Notes
On EBRAINS-MATLAB the processing removes the seven badge lines and turns the four relative links into
blobandtreeURLs. On openMINDS_MATLAB the logo block before the title is kept, with its/img/...paths made absolute.🤖 Generated with Claude Code