Skip to content

Commit 80aa38f

Browse files
authored
Merge branch 'main' into fi-bump-version-0-2-0
2 parents 236ea1a + bff8f0c commit 80aa38f

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

framework/docs/build-versioned-docs.sh

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,49 @@ END
9494
)
9595
echo "$corrected_versions" >> source/conf.py
9696
fi
97-
97+
98+
if [ "$current_version" = "v1.6.0" ] || \
99+
[ "$current_version" = "v1.7.0" ] || \
100+
[ "$current_version" = "v1.8.0" ] || \
101+
[ "$current_version" = "v1.9.0" ] || \
102+
[ "$current_version" = "v1.10.0" ] || \
103+
[ "$current_version" = "v1.11.0" ] || \
104+
[ "$current_version" = "v1.11.1" ] || \
105+
[ "$current_version" = "v1.12.0" ] || \
106+
[ "$current_version" = "v1.13.0" ] || \
107+
[ "$current_version" = "v1.13.1" ] || \
108+
[ "$current_version" = "v1.14.0" ] || \
109+
[ "$current_version" = "v1.15.0" ] || \
110+
[ "$current_version" = "v1.15.1" ] || \
111+
[ "$current_version" = "v1.15.2" ]; then
112+
awk '
113+
# when we see the start of the old block, switch mode
114+
/html_context\["versions"\] = list\(\)/ {
115+
print "html_context[\"versions\"] = list()"
116+
print "versions = sorted("
117+
print " ["
118+
print " tag.name"
119+
print " for tag in repo.tags"
120+
print " if not tag.name.startswith(\"intelligence/\")"
121+
print " and tag.name[0] == \"v\""
122+
print " and int(tag.name[1]) > 0"
123+
print " and int(tag.name.split(\".\")[1]) >= 8"
124+
print " ],"
125+
print " key=lambda x: [int(part) for part in x[1:].split(\".\")]"
126+
print ")"
127+
print "versions.append(\"main\")"
128+
print "for version in versions:"
129+
print " html_context[\"versions\"].append({\"name\": version})"
130+
skip=1
131+
next
132+
}
133+
# skip lines until we reach a blank line (or some other heuristic)
134+
skip && /^$/ { skip=0 }
135+
skip { next }
136+
{ print }
137+
' source/conf.py > source/conf_new.py && mv source/conf_new.py source/conf.py
138+
fi
139+
98140
# Copy updated version of html files
99141
cp -r ${tmp_dir}/_templates source
100142

0 commit comments

Comments
 (0)