Skip to content

Commit

Permalink
[infra] Fix spec markdown link processing
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed May 7, 2024
1 parent 8eb2e74 commit dfe31a5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/content-modules/adjust-pages.pl
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,13 @@ ()
s|\]\(([^:\)]*?\.md(#.*?)?)\)|]({{% relref "$1" %}})|g;
}

# Rewrite link defs
s|^(\[[^\]]+\]:\s*)([^:\s]*)(\s*(\(.*\))?)$|$1\{{% relref "$2" %}}$3|g;
# Rewrite link defs to local pages such as the following:
#
# [specification]: overview.md
# [faas]: some-path/faas-spans.md (FaaS trace conventions)
#
# The subregex `[:\s]+` excludes external URLs (because they contain a colon after the protocol)
s|^(\[[^\]]+\]:\s*)([^:\s]+)(\s*(\(.*\))?)$|$1\{{% relref "$2" %}}$3|g;

# Make website-local page references local:
s|https://opentelemetry.io/|/|g;
Expand Down

0 comments on commit dfe31a5

Please sign in to comment.