Skip to content

Commit

Permalink
[CI] Support relative links to oteps from OTel spec (open-telemetry#6372
Browse files Browse the repository at this point in the history
)
  • Loading branch information
chalin authored Feb 18, 2025
1 parent 86d2fbd commit 148b399
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scripts/content-modules/adjust-pages.pl
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/perl -w -i
#
# cSpell:ignore oteps

$^W = 1;

Expand Down Expand Up @@ -169,7 +171,7 @@ ()
next;
}
}
if(! $title) {
if (! $title) {
($title) = /^#\s+(.*)/;
$linkTitle = '';
printFrontMatter() if $title;
Expand All @@ -180,7 +182,7 @@ ()
while(<>) { $lineNum++; last if /<\/details>/; }
next;
}
if(/<!-- toc -->/) {
if (/<!-- toc -->/) {
my $tocstop = '<!-- tocstop -->';
while(<>) {
$lineNum++;
Expand Down Expand Up @@ -227,9 +229,13 @@ ()
# Rewrite paths that are outside of the spec folders as external links:
s|\.\.\/README.md|$otelSpecRepoUrl/|g if $ARGV =~ /specification._index/;
s|\.\.\/README.md|/docs/specs/otel/| if $ARGV =~ /specification\/library-guidelines.md/;

s|(\.\.\/)+(experimental\/[^)]+)|$otelSpecRepoUrl/tree/v$otelSpecVers/$2|g;
s|(\.\.\/)+(supplementary-guidelines\/compatibility\/[^)]+)|$otelSpecRepoUrl/tree/v$otelSpecVers/$2|g;
s{
(\.\.\/)+
(
(?:oteps|supplementary-guidelines)\/
[^)]+
)
}{$otelSpecRepoUrl/tree/v$otelSpecVers/$2}gx;

s|\.\./((?:examples/)?README\.md)|$otlpSpecRepoUrl/tree/v$otlpSpecVers/$1|g if $ARGV =~ /^tmp\/otlp/;

Expand Down

0 comments on commit 148b399

Please sign in to comment.