|
35 | 35 |
|
36 | 36 | my %versFromSubmod = %versions; # Actual version of submodules. Updated by getVersFromSubmodule().
|
37 | 37 |
|
38 |
| -sub printTitleAndFrontMatter() { |
| 38 | +sub printFrontMatter() { |
39 | 39 | print "---\n";
|
40 | 40 | if ($title eq 'OpenTelemetry Specification') {
|
41 | 41 | $title .= " $otelSpecVers";
|
|
46 | 46 | $frontMatterFromFile =~ s/(title|linkTitle): .*/$& $otlpSpecVers/g;
|
47 | 47 | # TODO: add to spec landing page
|
48 | 48 | $frontMatterFromFile .= "weight: 20\n" if $frontMatterFromFile !~ /^\s*weight/;
|
49 |
| - } elsif ($ARGV =~ /semconv\/docs\/\w+.md$/) { |
| 49 | + } elsif ($ARGV =~ /^tmp\/semconv\/docs\/\w+.md$/) { |
50 | 50 | $title .= " $semconvVers";
|
51 | 51 | $frontMatterFromFile =~ s/linkTitle: .*/$& $semconvVers/;
|
52 | 52 | # $frontMatterFromFile =~ s/body_class: .*/$& td-page--draft/;
|
|
59 | 59 | # applyPatchOrPrintMsgIf('2024-12-01-bridge-api', 'spec', '1.39.0');
|
60 | 60 | # }
|
61 | 61 |
|
| 62 | + if ($ARGV =~ m{^tmp/semconv/docs.*/(README|_index)\.md$} |
| 63 | + && applyPatchOrPrintMsgIf('2025-01-29-path-base', 'semconv', '1.30.0-19-g') |
| 64 | + && $frontMatterFromFile =~ /^path_base_for_github_subdir:/m |
| 65 | + ) { |
| 66 | + $frontMatterFromFile =~ s/\npath_base_for_github_subdir:.*?\n/\n/; |
| 67 | + $frontMatterFromFile =~ s|\n from: tmp/semconv/docs/.*?\n|\n|; |
| 68 | + $frontMatterFromFile =~ s/\n to: .*README.md($|\n)/$1/; |
| 69 | + } |
| 70 | + |
62 | 71 | my $titleMaybeQuoted = ($title =~ ':') ? "\"$title\"" : $title;
|
63 | 72 | print "title: $titleMaybeQuoted\n" if $frontMatterFromFile !~ /title: /;
|
64 | 73 | if ($title =~ /^OpenTelemetry (Protocol )?(.*)/) {
|
|
103 | 112 |
|
104 | 113 | sub patchSemConv1_30_0() {
|
105 | 114 | return unless $ARGV =~ /^tmp\/semconv\/docs\//
|
106 |
| - && applyPatchOrPrintMsgIf('2025-01-24-emit-an-event', 'semconv', '1.30.0-3-g'); |
| 115 | + && applyPatchOrPrintMsgIf('2025-01-24-emit-an-event-etc', 'semconv', '1.30.0-18-g'); |
107 | 116 |
|
108 | 117 | s|Emit Event API|Log API|;
|
109 | 118 | s|(docs/specs/otel/logs/api.md#emit-a)n-event|$1-logrecord|;
|
|
162 | 171 | if(! $title) {
|
163 | 172 | ($title) = /^#\s+(.*)/;
|
164 | 173 | $linkTitle = '';
|
165 |
| - printTitleAndFrontMatter() if $title; |
| 174 | + printFrontMatter() if $title; |
166 | 175 | next;
|
167 | 176 | }
|
168 | 177 |
|
|
0 commit comments