Raku / doc

🦋 Raku documentation
https://docs.raku.org/
Artistic License 2.0
292 stars 291 forks source link

bad design link #4540

Open coke opened 1 month ago

coke commented 1 month ago

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.

finanalyst commented 1 month ago

@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 commented 1 month ago

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 commented 3 weeks ago

@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' (.*?) $ / 
  3. any '#' part needs to be transformed so the title is lower case and all '_' are replaced with '-'
  4. 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 commented 3 weeks ago

sounds good!

finanalyst commented 3 weeks ago

@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 commented 3 weeks ago

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

finanalyst commented 3 weeks ago

@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 commented 3 weeks ago

We can just remove that paragraph. Or at least most of it.

On Sun, Dec 29, 2024 at 10:09 AM Richard Hainsworth < @.***> wrote:

@coke https://github.com/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 https://github.com/lizmat May be the document contents can be changed to something more up to date?

— Reply to this email directly, view it on GitHub https://github.com/Raku/doc/issues/4540#issuecomment-2564753187, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAMIUIZKLZVH44BV6GWFFT2IAGCNAVCNFSM6AAAAABTFKJ53CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRUG42TGMJYG4 . You are receiving this because you were mentioned.Message ID: @.***>

finanalyst commented 2 weeks ago

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&raquo; to «https://github.com/Raku/old-design-docs/blob/master/S06-routines.pod#%22pointy-blocks%22&raquo; Link check
In «../doc/Language/5to6-perlfunc.rakudoc», line 1362 changed «https://design.raku.org/S05.html#Extensible_metasyntax_(%3C...%3E)&raquo; to «https://github.com/Raku/old-design-docs/blob/master/S05-regex.pod#extensible-metasyntax-(%3c...%3e)&raquo; Link check
In «../doc/Language/5to6-perlfunc.rakudoc», line 1562 changed «https://design.raku.org/S03.html#line_4019&raquo; to «https://github.com/Raku/old-design-docs/blob/master/S03-operators.pod#line-4019&raquo; Link check
In «../doc/Language/5to6-perlvar.rakudoc», line 319 changed «https://design.raku.org/S02.html#line_1126&raquo; to «https://github.com/Raku/old-design-docs/blob/master/S02-bits.pod#line-1126&raquo; Link check