Skip to content

Commit

Permalink
auto-link files in doc/antora
Browse files Browse the repository at this point in the history
so that the input file can give the full filename, but the asciidoc
files contain a proper antora xref link
  • Loading branch information
alandekok committed Dec 19, 2023
1 parent b3011c3 commit ce07b48
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/antora/modules/raddb/pages/mods-available/files.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

The `users` file as located in `raddb/mods-config/files/authorize`. (Livingston-style format).

See the in the xref:raddb:mods-config/files/users.adoc[users] file documention for information
See the xref:raddb:mods-config/files/users.adoc[users] file documention for information
on the format of the input file, and how it operates.


Expand Down
2 changes: 1 addition & 1 deletion raddb/mods-available/files
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# The `users` file as located in `raddb/mods-config/files/authorize`. (Livingston-style format).
#
# See the in the xref:raddb:mods-config/files/users.adoc[users] file documention for information
# See the doc/antora/modules/raddb/pages/mods-config/files/users.adoc file documention for information
# on the format of the input file, and how it operates.
#

Expand Down
4 changes: 3 additions & 1 deletion scripts/asciidoc/conf2adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ sub process_file {
$links{$key} = "$opt_a/$key.adoc";
}
elsif ($key =~ /^sites-available\/./) {
$links{$key} = "$opt_a/$key.adoc";
$links{$key} = "$opt_a/$key.adoc";
}

#
Expand Down Expand Up @@ -201,6 +201,8 @@ sub process_file {
$line =~ s,RFC (\d+),https://tools.ietf.org/html/rfc${1}\[RFC $1\],g;
}

$line =~ s,doc/antora/modules/([^/]+)/pages/(.*)/([^/]+).adoc,xref:$1:$2/$3.adoc[$3],g;

if (!$print_code) {
if ($raw && $was_raw) {
push @code, $line if ($opt_t);
Expand Down

0 comments on commit ce07b48

Please sign in to comment.