Skip to content

Conversation

katrinafyi
Copy link
Contributor

@katrinafyi katrinafyi commented Sep 14, 2025

This PR is two changes in one:

  • Changes the CLI options page to fetch from https://raw.githubusercontent.com/lycheeverse/lychee/master/README.md at build-time. (The previous CLI options were somewhat out of date and would've needed updating anyway).
  • Adds anchor links to each option in the help text output. This is done using astro-expressive-code's line markers feature which allows annotating certain lines with custom text. We use a small custom plugin to convert these text markers into anchored hyperlinks.

The result looks like this. Each line beginning with # is a hyperlink to that line. The anchor links work as expected when clicking on the same page and when navigating to the page from elsewhere.

image

One thing to be aware of with the automatic fetching of README.md is that this will always get the latest version from master. This might be undesirable because re-builds of the same docs could fetch different copies of README.md. Also, it may show options which are not yet available in an official version.

I've added a LYCHEE_VERSION variable for specifying the version which it fetches from, but I don't know where this variable should be defined - in CI maybe?

Also, it would be easy to split this PR into two if it would be easier to discuss the two changes separately.

Related to #95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant