### ----------------------------------------------------
### -- LibXSLT
### -- Licenses: Artistic-2.0
### -- Authors: David Warring
### -- File: etc/resolve-links.raku
### ----------------------------------------------------
constant DocRoot = "https://libxml-raku.github.io";

sub resolve-class(Str() $class) {
    my @path = $class.split('::');
    @path[0] ~= '-raku';
    @path.unshift: DocRoot;
    @path.join: '/';
}

s:g:s/ '](' (LibX[ML|SLT]['::'*%%<ident>]) ')'/{'](' ~ resolve-class($0) ~ ')'}/;


