isocpp / CppCoreGuidelines

The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
Other
42.81k stars 5.44k forks source link

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

Open Lob2018 opened 6 months ago

Lob2018 commented 6 months ago

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 commented 2 months ago

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 https://github.com/isocpp/CppCoreGuidelines/issues/2210#issuecomment-2346844932); 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 https://github.com/isocpp/CppCoreGuidelines/commit/50afe0234ce4f2f6bde7d9b0d86e926bd479f9aa modification : CppCoreGuidelines.md (got a doubt for Rh-public l.376 : (e.g., for C.134 it is "Rh-public"))