Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(datasource/deb): All items in the urls array are wrapped between []() character. #31161

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Prtik12
Copy link

@Prtik12 Prtik12 commented Sep 2, 2024

Changes

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@CLAassistant
Copy link

CLAassistant commented Sep 2, 2024

CLA assistant check
All committers have signed the CLA.

@viceice viceice changed the title FIX #30312 All items in the urls array are wrapped between []() character. docs(datasource/Deb): All items in the urls array are wrapped between []() character. Sep 2, 2024
@viceice viceice requested a review from HonkingGoose September 2, 2024 15:40
@rarkins
Copy link
Collaborator

rarkins commented Sep 3, 2024

Does this already work if merged, or needs some changes to our docs generation first?

@viceice viceice changed the title docs(datasource/Deb): All items in the urls array are wrapped between []() character. docs(datasource/deb): All items in the urls array are wrapped between []() character. Sep 3, 2024
@HonkingGoose
Copy link
Collaborator

Fails if merged

Does this already work if merged, or needs some changes to our docs generation first?

The mkdocs build step fails:

WARNING -  Doc file 'modules/versioning/deb/index.md' contains a link '[Debian Policy Manual - Version Control Fields](https://www.debian.org/doc/debian-policy/ch-controlfields.html#version)', but the target 'modules/versioning/deb/[Debian Policy Manual - Version Control Fields](https:/www.debian.org/doc/debian-policy/ch-controlfields.html' is not found among documentation files.
WARNING -  Doc file 'modules/versioning/deb/index.md' contains a link '[Debian Manual - deb-version(7)](https://manpages.debian.org/unstable/dpkg-dev/deb-version.7.en.html)', but the target 'modules/versioning/deb/[Debian Manual - deb-version(7)](https:/manpages.debian.org/unstable/dpkg-dev/deb-version.7.en.html)' is not found among documentation files.

This is the code that generates the ## References section and puts the links in a list:

export function formatUrls(urls: string[] | null | undefined): string {
if (Array.isArray(urls) && urls.length) {
return `## References\n\n${urls
.map((url) => ` - [${url}](${url})`)
.join('\n')}\n\n`;
}
return '';
}

I'll let you programmers figure out what the proper fix is. 😉

Scope

I guess this PR only tries to fix the bad links in the Debian datasource file, but there are still bare links in other files, for example:

export const urls = [
'https://getcomposer.org/doc/articles/versions.md',
'https://packagist.org/packages/composer/semver',
'https://madewithlove.be/tilde-and-caret-constraints/',
'https://semver.mwl.be',
];

Test that finds bad links

I would also like to see a test to check for bad links in the const urls. That way we can use the test to find all bad links. 😄

Copy link
Collaborator

@HonkingGoose HonkingGoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment in the PR for more info, to summarize:

  • The docs build should pass
  • The docs should have a list with human-readable links

@viceice viceice enabled auto-merge September 8, 2024 08:21
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.

5 participants