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

bad design link #4540

Open
coke opened this issue Dec 6, 2024 · 9 comments
Open

bad design link #4540

coke opened this issue Dec 6, 2024 · 9 comments
Labels
docs Documentation issue (primary issue type)

Comments

@coke
Copy link
Collaborator

coke commented Dec 6, 2024

https://docs.raku.org/language/regexes#Quoted_lists_are_LTM_matches

links to

https://design.raku.org/S05.html#Longest-token_matching

but that's just a github repo at this point - not a 404 so it doesn't fail.

Ideally, remove the link and describe the strategy internally to the docs.

@coke coke added the docs Documentation issue (primary issue type) label Dec 6, 2024
@finanalyst
Copy link
Collaborator

@coke I think that the Docs used to contain a lot of links to Sxx documents, and they have gradually been replaced. Is one of the utilities for testing the documents able to pick out any other / 'L<' .+? 'S' \d+ .+? '.html' / occurrences?

@coke
Copy link
Collaborator Author

coke commented Dec 10, 2024

The problem is, the link works, it just goes to a github repo front page now instead of the original deep link, so the test we have doesn't complain.

Anything in

rak 'https://design.raku.org/' doc

needs fixing to point to the new structure.

@finanalyst
Copy link
Collaborator

@coke
A list is given at the bottom of the files.
I looked at the examples above,
https://design.raku.org/S05.html#Longest-token_matching
could be matched to
https://github.com/Raku/old-design-docs/blob/master/S05-regex.pod#longest-token-matching

May be the following algorithm would work:

  1. collect the full names in the new structure by S numbers into a hash %S-files, so 'S05' => https://github.com/Raku/old-design-docs/blob/master/S05-regex.pod
  2. Run a regex like the following
m/ 'L<' .+? '|' \s* 'https://design.raku.org/' ('S'\d+) '.html' (.*?) $ / 
  1. any '#' part needs to be transformed so the title is lower case and all '_' are replaced with '-'
  2. substitute back into the rakudoc files

@coke let me know and I can try to do this. I could manage a single PR with all the changes to all the files, but I'm not sure I could programmatically create one PR for each file changed.

The following files were reported by rak 'https://design.raku.org/' doc --files-with-matches.

doc/Language/pod.rakudoc
doc/Language/glossary.rakudoc
doc/Language/haskell-to-p6.rakudoc
doc/Language/regexes.rakudoc
doc/Language/5to6-nutshell.rakudoc
doc/Language/modules.rakudoc
doc/Language/5to6-perlop.rakudoc
doc/Language/performance.rakudoc
doc/Language/mop.rakudoc
doc/Language/syntax.rakudoc
doc/Language/rb-nutshell.rakudoc
doc/Language/list.rakudoc
doc/Language/5to6-perlsyn.rakudoc
doc/Language/5to6-perlfunc.rakudoc
doc/Language/about.rakudoc
doc/Language/5to6-perlvar.rakudoc

@coke
Copy link
Collaborator Author

coke commented Dec 29, 2024

sounds good!

@finanalyst
Copy link
Collaborator

finanalyst commented Dec 29, 2024

@coke Just committed first batch of changes. I had intended to raise a PR first for review. My bad.
There is a gist of the report changes with links.

@finanalyst
Copy link
Collaborator

now working on those with internal links eg ....html#some-link_hi

@finanalyst
Copy link
Collaborator

@coke Not sure how to deal with this one:

../doc/Language/mop.rakudoc:181:L<design documents|https://design.raku.org/> are very light on details.

Its a one-off as there is not Sdd design document to fall back to.
@lizmat May be the document contents can be changed to something more up to date?

@coke
Copy link
Collaborator Author

coke commented Dec 29, 2024 via email

@finanalyst
Copy link
Collaborator

four soft fail now. The link goes to the correct page, but the internal destination is not reached. Targets have percent encoding or refer to a line.

Failures to get to internal targets:
In «../doc/Language/5to6-perlfunc.rakudoc», line 444 changed «https://design.raku.org/S06.html#%22Pointy_blocks%22» to «https://github.com/Raku/old-design-docs/blob/master/S06-routines.pod#%22pointy-blocks%22» Link check

In «../doc/Language/5to6-perlfunc.rakudoc», line 1362 changed «https://design.raku.org/S05.html#Extensible_metasyntax_(%3C...%3E)» to «https://github.com/Raku/old-design-docs/blob/master/S05-regex.pod#extensible-metasyntax-(%3c...%3e)» Link check

In «../doc/Language/5to6-perlfunc.rakudoc», line 1562 changed «https://design.raku.org/S03.html#line_4019» to «https://github.com/Raku/old-design-docs/blob/master/S03-operators.pod#line-4019» Link check

In «../doc/Language/5to6-perlvar.rakudoc», line 319 changed «https://design.raku.org/S02.html#line_1126» to «https://github.com/Raku/old-design-docs/blob/master/S02-bits.pod#line-1126» Link check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type)
Projects
None yet
Development

No branches or pull requests

2 participants