token-js / token.js

Integrate 200+ LLMs with one TypeScript SDK using OpenAI's format.
https://docs.tokenjs.ai/
MIT License
111 stars 11 forks source link

Add an automated check for dead URLS, relative Markdown links, and Markdown anchor tags #66

Open sam-goldman opened 3 months ago

sam-goldman commented 3 months ago

Context

An example of a relative Markdown link is the path ./path/to/file.md in the Markdown snippet below:

[Link Text](./path/to/file.md)

An example of a Markdown anchor tag is #my-section in the Markdown snippet below:

[My section](#my-section)

Problem

Currently, we must manually check that URLs, relative Markdown links, and Markdown anchor tags are valid in user-facing areas of our codebase, particularly our documentation. This a tedious, error-prone process. Also, it's possible that URLs to external websites will become dead after they have been added to our documentation, in which case we won't know until somebody reports it.

Solution

We should have an automated process that checks for dead relative Markdown links and dead URLs. This process should be included in our CI process. We only need to check for dead Markdown links and anchor tags in Markdown files, but we should check for dead URLs in our entire codebase because we may include URLs in user-facing error messages in the future.