Skip to content

Commit 148b399

Browse files
authored
[CI] Support relative links to oteps from OTel spec (#6372)
1 parent 86d2fbd commit 148b399

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

scripts/content-modules/adjust-pages.pl

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/perl -w -i
2+
#
3+
# cSpell:ignore oteps
24

35
$^W = 1;
46

@@ -169,7 +171,7 @@ ()
169171
next;
170172
}
171173
}
172-
if(! $title) {
174+
if (! $title) {
173175
($title) = /^#\s+(.*)/;
174176
$linkTitle = '';
175177
printFrontMatter() if $title;
@@ -180,7 +182,7 @@ ()
180182
while(<>) { $lineNum++; last if /<\/details>/; }
181183
next;
182184
}
183-
if(/<!-- toc -->/) {
185+
if (/<!-- toc -->/) {
184186
my $tocstop = '<!-- tocstop -->';
185187
while(<>) {
186188
$lineNum++;
@@ -227,9 +229,13 @@ ()
227229
# Rewrite paths that are outside of the spec folders as external links:
228230
s|\.\.\/README.md|$otelSpecRepoUrl/|g if $ARGV =~ /specification._index/;
229231
s|\.\.\/README.md|/docs/specs/otel/| if $ARGV =~ /specification\/library-guidelines.md/;
230-
231-
s|(\.\.\/)+(experimental\/[^)]+)|$otelSpecRepoUrl/tree/v$otelSpecVers/$2|g;
232-
s|(\.\.\/)+(supplementary-guidelines\/compatibility\/[^)]+)|$otelSpecRepoUrl/tree/v$otelSpecVers/$2|g;
232+
s{
233+
(\.\.\/)+
234+
(
235+
(?:oteps|supplementary-guidelines)\/
236+
[^)]+
237+
)
238+
}{$otelSpecRepoUrl/tree/v$otelSpecVers/$2}gx;
233239

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

0 commit comments

Comments
 (0)