You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,33 +18,32 @@ for location in "." "docs"; do
21
18
if [ -f"$file" ];then
22
19
echo" Processing $file"
23
20
temp_file="${file}.tmp"
24
-
25
-
# IMPROVED: Use awk for better GitHub-style admonition conversion
21
+
26
22
awk '
27
-
/^> \[!NOTE\]/ {
28
-
print "{: .note }";
29
-
in_note = 1;
30
-
next;
23
+
/^> \[!NOTE\]/ {
24
+
print "{: .note }";
25
+
in_note = 1;
26
+
next;
31
27
}
32
-
/^> \[!TIP\]/ {
33
-
print "{: .highlight }";
34
-
in_note = 1;
35
-
next;
28
+
/^> \[!TIP\]/ {
29
+
print "{: .highlight }";
30
+
in_note = 1;
31
+
next;
36
32
}
37
-
/^> \[!IMPORTANT\]/ {
38
-
print "{: .important }";
39
-
in_note = 1;
40
-
next;
33
+
/^> \[!IMPORTANT\]/ {
34
+
print "{: .important }";
35
+
in_note = 1;
36
+
next;
41
37
}
42
-
/^> \[!WARNING\]/ {
43
-
print "{: .warning }";
44
-
in_note = 1;
45
-
next;
38
+
/^> \[!WARNING\]/ {
39
+
print "{: .warning }";
40
+
in_note = 1;
41
+
next;
46
42
}
47
-
/^> \[!CAUTION\]/ {
48
-
print "{: .warning }";
49
-
in_note = 1;
50
-
next;
43
+
/^> \[!CAUTION\]/ {
44
+
print "{: .warning }";
45
+
in_note = 1;
46
+
next;
51
47
}
52
48
/^> / {
53
49
if(in_note) {
@@ -60,15 +56,13 @@ for location in "." "docs"; do
60
56
print;
61
57
}
62
58
'"$file">"$temp_file"
63
-
64
-
# Fix examples link in GETTING_STARTED
59
+
65
60
if [[ "$file"=~ GETTING_STARTED.md ]];then
66
61
sed "${SED_INPLACE[@]}"'s|\[examples\](test/form/definitions)|\[examples\](https://github.com/DEFRA/forms-engine-plugin/tree/main/test/form/definitions)|g'"$temp_file"
67
62
fi
68
-
69
-
# Fix double baseurl prepending for links to PLUGIN_OPTIONS
63
+
70
64
sed "${SED_INPLACE[@]}"'s|/forms-engine-plugin/forms-engine-plugin/|/forms-engine-plugin/|g'"$temp_file"
@@ -146,83 +137,29 @@ for dir in code-based configuration-based; do
146
137
print;
147
138
}
148
139
'"$file">"$temp_file"
149
-
150
-
# Fix URL paths based on file type
140
+
151
141
if [[ "$file"=="PAGE_VIEWS.md" ]];then
152
-
# Fix links to PAGE_EVENTS in PAGE_VIEWS.md
153
142
sed "${SED_INPLACE[@]}"'s|\(see our guidance on page events\)(\.\./configuration-based/PAGE_EVENTS.md)|\1(/features/configuration-based/PAGE_EVENTS)|g'"$temp_file"
154
-
# Fix links to GitHub repos that shouldn't have baseurl
155
143
sed "${SED_INPLACE[@]}"'s|\[plugin option\](/forms-engine-plugin/https://|[plugin option](https://|g'"$temp_file"
156
144
fi
157
-
145
+
158
146
if [[ "$file"=="PAGE_TEMPLATES.md" ]];then
159
-
# Fix links to PLUGIN_OPTIONS
160
147
sed "${SED_INPLACE[@]}"'s|\[PLUGIN_OPTIONS.md\](../../PLUGIN_OPTIONS.md#custom-filters)|\[Plugin Options](/PLUGIN_OPTIONS#custom-filters)|g'"$temp_file"
161
148
fi
162
-
163
-
# Fix double baseurl prepending for all external links
149
+
164
150
sed "${SED_INPLACE[@]}"'s|/forms-engine-plugin/forms-engine-plugin/|/forms-engine-plugin/|g'"$temp_file"
165
151
sed "${SED_INPLACE[@]}"'s|/forms-engine-plugin/https://|https://|g'"$temp_file"
0 commit comments