OTel spec: link to local OTLP, and fix README link (#2857)
Co-authored-by: Phillip Carter <pcarter@fastmail.com>
This commit is contained in:
parent
f6c56866de
commit
c26ef1daff
|
@ -21,7 +21,7 @@
|
||||||
"_prebuild": "run-s get:submodule cp:spec",
|
"_prebuild": "run-s get:submodule cp:spec",
|
||||||
"_prepare:docsy": "cd themes/docsy && npm install",
|
"_prepare:docsy": "cd themes/docsy && npm install",
|
||||||
"_prettier:any": "npx prettier --ignore-path ''",
|
"_prettier:any": "npx prettier --ignore-path ''",
|
||||||
"_serve:hugo": "hugo serve -DFE --minify",
|
"_serve:hugo": "hugo server -DFE --minify",
|
||||||
"_serve:netlify": "netlify dev -c \"npm run _serve:hugo\"",
|
"_serve:netlify": "netlify dev -c \"npm run _serve:hugo\"",
|
||||||
"all": "npm-run-all",
|
"all": "npm-run-all",
|
||||||
"build:preview": "set -x && npm run _build -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
|
"build:preview": "set -x && npm run _build -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
|
||||||
|
|
|
@ -22,6 +22,7 @@ my %versions = qw(
|
||||||
);
|
);
|
||||||
my $otelSpecVers = $versions{'spec:'};
|
my $otelSpecVers = $versions{'spec:'};
|
||||||
my $otlpSpecVers = $versions{'otlp:'};
|
my $otlpSpecVers = $versions{'otlp:'};
|
||||||
|
my $unused;
|
||||||
|
|
||||||
sub printTitleAndFrontMatter() {
|
sub printTitleAndFrontMatter() {
|
||||||
print "---\n";
|
print "---\n";
|
||||||
|
@ -33,7 +34,8 @@ sub printTitleAndFrontMatter() {
|
||||||
}
|
}
|
||||||
my $titleMaybeQuoted = ($title =~ ':') ? "\"$title\"" : $title;
|
my $titleMaybeQuoted = ($title =~ ':') ? "\"$title\"" : $title;
|
||||||
print "title: $titleMaybeQuoted\n" if $frontMatterFromFile !~ /title: /;
|
print "title: $titleMaybeQuoted\n" if $frontMatterFromFile !~ /title: /;
|
||||||
($linkTitle) = $title =~ /^OpenTelemetry (.*)/;
|
($unused, $linkTitle) = $title =~ /^OpenTelemetry (Protocol )?(.*)/;
|
||||||
|
$linkTitle = 'Design Goals' if $title eq 'Design Goals for OpenTelemetry Wire Protocol';
|
||||||
print "linkTitle: $linkTitle\n" if $linkTitle and $frontMatterFromFile !~ /linkTitle: /;
|
print "linkTitle: $linkTitle\n" if $linkTitle and $frontMatterFromFile !~ /linkTitle: /;
|
||||||
print "$frontMatterFromFile" if $frontMatterFromFile;
|
print "$frontMatterFromFile" if $frontMatterFromFile;
|
||||||
if ($ARGV =~ /otel\/specification\/(.*?)_index.md$/) {
|
if ($ARGV =~ /otel\/specification\/(.*?)_index.md$/) {
|
||||||
|
@ -91,6 +93,8 @@ while(<>) {
|
||||||
}
|
}
|
||||||
s|\(https://github.com/open-telemetry/opentelemetry-specification/\w+/\w+/specification([^\)]*)\)|($specBasePath/otel$1)|;
|
s|\(https://github.com/open-telemetry/opentelemetry-specification/\w+/\w+/specification([^\)]*)\)|($specBasePath/otel$1)|;
|
||||||
|
|
||||||
|
s|(https://)?github.com/open-telemetry/opentelemetry-proto/(blob/main/)?docs/specification.md|$specBasePath/otlp/|g;
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
s|(\.\./)?internal(/img/[-\w]+\.png)|$2|g;
|
s|(\.\./)?internal(/img/[-\w]+\.png)|$2|g;
|
||||||
s|(\]\()(img/.*?\))|$1../$2|g if $ARGV !~ /(logs|schemas)._index/ && $ARGV !~ /otlp\/docs/;
|
s|(\]\()(img/.*?\))|$1../$2|g if $ARGV !~ /(logs|schemas)._index/ && $ARGV !~ /otlp\/docs/;
|
||||||
|
@ -108,7 +112,7 @@ while(<>) {
|
||||||
s|\.\./README.md\b|$otlpSpecRepoUrl/|g if $ARGV =~ /\/tmp\/otlp/;
|
s|\.\./README.md\b|$otlpSpecRepoUrl/|g if $ARGV =~ /\/tmp\/otlp/;
|
||||||
s|\.\./examples/README.md\b|$otlpSpecRepoUrl/tree/$otlpSpecVers/examples/|g if $ARGV =~ /\/tmp\/otlp/;
|
s|\.\./examples/README.md\b|$otlpSpecRepoUrl/tree/$otlpSpecVers/examples/|g if $ARGV =~ /\/tmp\/otlp/;
|
||||||
|
|
||||||
s|\bREADME.md\b|_index.md|g;
|
s|\bREADME.md\b|_index.md|g if $ARGV !~ /otel\/specification\/protocol\/_index.md/;
|
||||||
|
|
||||||
# Rewrite paths that are outside of the main spec folder as external links
|
# Rewrite paths that are outside of the main spec folder as external links
|
||||||
s|(\.\.\/)+(experimental\/[^)]+)|$otelSpecRepoUrl/tree/$otelSpecVers/$2|g;
|
s|(\.\.\/)+(experimental\/[^)]+)|$otelSpecRepoUrl/tree/$otelSpecVers/$2|g;
|
||||||
|
|
Loading…
Reference in New Issue