Skip to content

Commit

Permalink
Fix links validator issue with anchor links
Browse files Browse the repository at this point in the history
  • Loading branch information
omckeon committed Aug 28, 2024
1 parent e3a5a37 commit e520e9a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
28 changes: 20 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"sharp": "0.33.4",
"solid-js": "1.8.17",
"squoosh": "0.0.0",
"starlight-links-validator": "0.8.0",
"starlight-links-validator": "0.10.1",
"swiper": "11.1.3",
"tailwindcss": "3.4.3"
},
Expand Down
13 changes: 9 additions & 4 deletions scripts/components.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const languageLabelMappings = {
const languageOrder = ["cpp", "csharp", "python", "pascal"];
var name = "";

const sk_colors = ["alice_blue", "antique_white", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanched_almond", "blue", "blue_violet", "bright_green", "brown", "burly_wood", "cadet_blue", "chartreuse", "chocolate", "coral", "cornflower_blue", "cornsilk", "crimson", "cyan", "dark_blue", "dark_cyan", "dark_goldenrod", "dark_gray", "dark_green", "dark_khaki", "dark_magenta", "dark_olive_green", "dark_orange", "dark_orchid", "dark_red", "dark_salmon", "dark_sea_green", "dark_slate_blue", "dark_slate_gray", "dark_turquoise", "dark_violet", "deep_pink", "deep_sky_blue", "dim_gray", "dodger_blue", "firebrick", "floral_white", "forest_green", "fuchsia", "gainsboro", "ghost_white", "gold", "goldenrod", "gray", "green", "green_yellow", "honeydew", "hot_pink", "indian_red", "indigo", "ivory", "khaki", "lavender", "lavender_blush", "lawn_green", "lemon_chiffon", "light_blue", "light_coral", "light_cyan", "light_goldenrod_yellow", "light_gray", "light_green", "light_pink", "light_salmon", "light_sea_green", "light_sky_blue", "light_slate_gray", "light_steel_blue", "light_yellow", "lime", "lime_green", "linen", "magenta", "maroon", "medium_aquamarine", "medium_blue", "medium_orchid", "medium_purple", "medium_sea_green", "medium_slate_blue", "medium_spring_green", "medium_turquoise", "medium_violet_red", "midnight_blue", "mint_cream", "misty_rose", "moccasin", "navajo_white", "navy", "old_lace", "olive", "olive_drab", "orange", "orange_red", "orchid", "pale_goldenrod", "pale_green", "pale_turquoise", "pale_violet_red", "papaya_whip", "peach_puff", "peru", "pink", "plum", "powder_blue", "purple", "red", "rosy_brown", "royal_blue", "saddle_brown", "salmon", "sandy_brown", "sea_green", "sea_shell", "sienna", "silver", "sky_blue", "slate_blue", "slate_gray", "snow", "spring_green", "steel_blue", "swinburne_red", "tan", "teal", "thistle", "tomato", "transparent", "turquoise", "violet", "wheat", "white", "white_smoke", "yellow", "yellow_green"];

function Mappings(jsonData) {
//generate mappings from API
Expand Down Expand Up @@ -228,13 +229,17 @@ fs.readFile(`${__dirname}/api.json`, "utf8", async (err, data) => {
);
}

mdxContent += `${formattedName}`;

// Color boxes
if (functionName.startsWith("color_") && !functionName.endsWith("to_string")) {
// Color boxes next to heading
if (functionName.startsWith("color_") && sk_colors.includes(functionName.replace("color_", ""))) {
mdxContent += `\n#### <span style="display:none;">${functionName2}</span>\n` // Added to fix links validator issue
mdxContent += `${formattedName}`;
const rgbValues = getColorRGBValues(functionName, jsonColors);
mdxContent += ` <div class='color-box' style="background:rgba${rgbValues}"></div>`
}
else {

mdxContent += `${formattedName}`;
}

mdxContent += "\n\n";

Expand Down

0 comments on commit e520e9a

Please sign in to comment.