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

C++ Core Guidelines Markdown explicit anchor links not working (updated the 20/05/2024) #2198

Open
Lob2018 opened this issue May 10, 2024 · 1 comment
Assignees

Comments

@Lob2018
Copy link

Lob2018 commented May 10, 2024

Thanks again for your document C++ Core Guidelines.

Markdown links for C++ Core Guidelines Markdown don't work because anchor test must always be lowercase and not contain spaces, as describe in this article.

I used Sublime Text to find and replace by regular expression with these values, it looks correct but I haven't checked everything (updated the 20/05/2024):
Find: name="([^"]*)"
Replace: name="\L\1\E"
and
Find: ]\(#([^)]*)\)
Replace: ](#\L\1\E)

Attached the .diff, the modified and the old Markdown files :
CppCoreGuidelines - old.md
CppCoreGuidelines.diff.txt
CppCoreGuidelines.md

@Lob2018 Lob2018 changed the title C++ Core Guidelines Markdown explicit anchor links not working C++ Core Guidelines Markdown explicit anchor links not working (updated the 20/05/2024) May 20, 2024
@Lob2018
Copy link
Author

Lob2018 commented Sep 6, 2024

A small Python program that checks that links, internal links, and anchors, are lowercase without spaces (it could be used as a basis with GitHub Actions in the future see #2210 (comment)); I fixed the errors (see the .diff).

The CppCoreGuidelines.md file must be in the same folder of ChecksLinksAndAnchorsFromCppCoreGuidelinesInCurrentDirectory.py.
Error examples:

fixed :
Error on line 13828: the href link 'Rper-reason' is not in lowercase.
Error on line 13829: the href link 'Rper-Knuth' is not in lowercase.
Error on line 22113: the href link 'S-abstract' is not in lowercase.
and by the way (not fixed) :
Error on line 2931: the internal link '???' is not in lowercase.
Error on line 3673: the internal link '???' is not in lowercase.
Error on line 3781: the internal link '???' is not in lowercase.
Error on line 3796: the internal link '???' is not in lowercase.
Error on line 3796: the internal link '???' is not in lowercase.
Error on line 5606: the internal link '???' is not in lowercase.
Error on line 8184: the internal link '???' is not in lowercase.
Error on line 11168: the internal link '???' is not in lowercase.
Error on line 15607: the internal link '???' is not in lowercase.
Error on line 20346: the internal link '???' is not in lowercase.
Error on line 20503: the internal link '???' is not in lowercase.
Error on line 20504: the internal link '???' is not in lowercase.
Error on line 20527: the internal link '???' is not in lowercase.
Error on line 20528: the internal link '???' is not in lowercase.
Error on line 20529: the internal link '???' is not in lowercase.
Error on line 20530: the internal link '???' is not in lowercase.
Error on line 20531: the internal link '???' is not in lowercase.
Error on line 20532: the internal link '???' is not in lowercase.

Attached, the Python program, the .diff, the old and the modified Markdown files :
ChecksLinksAndAnchorsFromCppCoreGuidelinesInCurrentDirectory.zip
CppCoreGuidelines.diff.txt
CppCoreGuidelines - old.md
With 50afe02 modification :
CppCoreGuidelines.md
(got a doubt for Rh-public l.376 : (e.g., for C.134 it is "Rh-public"))

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

No branches or pull requests

2 participants