Skip to content

Commit 2a24620

Browse files
bsmthcaugner
andauthored
chore(macros/EmbedLiveSample): deprecate screenshot URL parameter (#10697)
Co-authored-by: Claas Augner <[email protected]>
1 parent 49c84bb commit 2a24620

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

kumascript/macros/EmbedLiveSample.ejs

+12-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// $0 - The ID of the header block containing the sample
66
// $1 - The width of the iframe (optional)
77
// $2 - The height of the iframe (optional)
8-
// $3 - The url of a screenshot of the sample working as intended (optional)
8+
// $3 - (Deprecated) The url of a screenshot of the sample working as intended (optional)
99
// $4 - (Deprecated) The slug from which to load the sample (optional; current page used if not provided)
1010
// $5 - (Deprecated) The class name of the frame; defaults to "sample-code-frame". If you
1111
// pass this parameter and give it a value other than "sample-code-frame",
@@ -15,12 +15,18 @@
1515
//
1616
// See also : LiveSampleLink
1717
18-
// We have deprecated the use of the $4 to $6 parameters
19-
// If one of this parameter is not empty, we raise a MacroDeprecationError flaw
20-
// When there will be 0 use left on translated-content (May 2022: 203 occurrences for $4),
18+
// We have deprecated the $3, $4, and $5 parameters.
19+
// If a non-empty value is provided for a deprecated parameter, we raise a MacroDeprecationError flaw
20+
// When there are 0 uses in translated-content,
2121
// we will be able to simplify this macro (and likely the whole of MDN).
22-
if ($4 !== "" || $5 !== "") {
23-
mdn.deprecatedParams("The fourth and fifth parameters of 'EmbedLiveSample' are deprecated");
22+
if ($3 !== "") {
23+
mdn.deprecatedParams("'EmbedLiveSample' parameter $3 is deprecated (no screenshot URLs).");
24+
}
25+
if ($4 !== "") {
26+
mdn.deprecatedParams("'EmbedLiveSample' parameter $4 is deprecated (no sample slug).");
27+
}
28+
if ($5 !== "") {
29+
mdn.deprecatedParams("'EmbedLiveSample' parameter $5 is deprecated (no iframe classes).");
2430
}
2531
2632
var sampleIdOrOffset = $0 || $token.location.start.offset;

0 commit comments

Comments
 (0)