Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(macros/EmbedLiveSample): deprecate screenshot URL parameter #10697

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions kumascript/macros/EmbedLiveSample.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// $0 - The ID of the header block containing the sample
// $1 - The width of the iframe (optional)
// $2 - The height of the iframe (optional)
// $3 - The url of a screenshot of the sample working as intended (optional)
// $3 - (Deprecated) The url of a screenshot of the sample working as intended (optional)
// $4 - (Deprecated) The slug from which to load the sample (optional; current page used if not provided)
// $5 - (Deprecated) The class name of the frame; defaults to "sample-code-frame". If you
// pass this parameter and give it a value other than "sample-code-frame",
Expand All @@ -15,12 +15,18 @@
//
// See also : LiveSampleLink

// We have deprecated the use of the $4 to $6 parameters
// If one of this parameter is not empty, we raise a MacroDeprecationError flaw
// When there will be 0 use left on translated-content (May 2022: 203 occurrences for $4),
// We have deprecated the $3, $4, and $5 parameters.
// If a non-empty value is provided for a deprecated parameter, we raise a MacroDeprecationError flaw
// When there are 0 uses in translated-content,
// we will be able to simplify this macro (and likely the whole of MDN).
if ($4 !== "" || $5 !== "") {
mdn.deprecatedParams("The fourth and fifth parameters of 'EmbedLiveSample' are deprecated");
if ($3 !== "") {
mdn.deprecatedParams("'EmbedLiveSample' parameter $3 is deprecated (no screenshot URLs).");
}
if ($4 !== "") {
mdn.deprecatedParams("'EmbedLiveSample' parameter $4 is deprecated (no sample slug).");
}
if ($5 !== "") {
mdn.deprecatedParams("'EmbedLiveSample' parameter $5 is deprecated (no iframe classes).");
}

var sampleIdOrOffset = $0 || $token.location.start.offset;
Expand Down
Loading