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

fix(macros/CSSRef): include level two functions #10679

Merged
merged 6 commits into from
Apr 16, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions kumascript/macros/CSSRef.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,13 @@ const hasTag = page.hasTag;
const rtlLocales = ['ar', 'he', 'fa'];

const pageList = await page.subpagesExpand('/en-US/docs/Web/CSS');

// some functions are at depth two
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved
const levelTwoPages = pageList.reduce((list, page)=>{
list.push(...page.subpages);
return list;
}, pageList);
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved

const standardPages = pageList.filter(page => !hasTag(page, "Non-standard"));

const groups = [];
Expand All @@ -946,7 +953,7 @@ const combinators = [];
const pseudoClasses = [];
const pseudoElements = [];
const atRules = [];
const functions = [];
let functions = [];
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved
const types = [];

for (const page of standardPages) {
Expand Down Expand Up @@ -982,7 +989,9 @@ for (const page of standardPages) {
}
}

properties = properties.sort((a, b) => a.title.localeCompare(b.title));
const sortByTitle = (a, b) => a.title.localeCompare(b.title);
properties = properties.sort(sortByTitle);
functions = functions.sort(sortByTitle);
OnkarRuikar marked this conversation as resolved.
Show resolved Hide resolved

function smartLink(href, title, content, subpath) {
let basepath = subpath;
Expand Down