Skip to content
Merged
Show file tree
Hide file tree
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
502 changes: 60 additions & 442 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"test": "npm run test --ws --if-present",
"lint": "npm run lint --ws --if-present",
"build": "npm run build --ws --if-present",
"format:check": "npm run format:check --ws --if-present"
"format:check": "npm run format:check --ws --if-present",
"postinstall": "patch-package"
}
}
5 changes: 2 additions & 3 deletions packages/blockly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"langfiles": "gulp langfiles",
"minify": "gulp minify",
"package": "gulp pack",
"postinstall": "patch-package",
"prepareDemos": "gulp prepareDemos",
"publish": "npm ci && gulp publish",
"publish:beta": "npm ci && gulp publishBeta",
Expand Down Expand Up @@ -105,8 +104,8 @@
"@blockly/theme-modern": "^7.0.1",
"@hyperjump/browser": "^1.1.4",
"@hyperjump/json-schema": "^1.5.0",
"@microsoft/api-documenter": "7.22.4",
"@microsoft/api-extractor": "^7.29.5",
"@microsoft/api-documenter": "7.30.5",
"@microsoft/api-extractor": "7.58.7",
"ajv": "^8.17.1",
"async-done": "^2.0.0",
"chai": "^6.0.1",
Expand Down
41 changes: 21 additions & 20 deletions packages/blockly/scripts/gulpfiles/docs_tasks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -368,38 +368,39 @@ const buildAlternatePathsMap = function(allFiles) {
}

/**
* Parse HTML tables from the blockly.md file to extract classes, interfaces, etc.
* @param {string} fileContent The content of blockly.md
* Parse HTML tables from blockly.mdx to extract classes, interfaces, etc.
* Each ## section contains an HTML table with markdown links in the first column.
* @param {string} fileContent The content of blockly.mdx
* @returns {Object} Object with sections as keys and arrays of {name, path} as values
*/
const parseHtmlTables = function(fileContent) {
const result = {};

// Split by ## headings
const linkRegex = /\[([^\]]+)\]\(\/reference\/([^\)]+)\)/g;
const tableRegex = /<table[\s>][\s\S]*?<\/table>/gi;

// Split by ## headings (skip preamble before the first heading)
const sections = fileContent.split('##');
for (let section of sections) {
const lines = section.split('\n');
const sectionName = lines[0].trim();

for (let i = 1; i < sections.length; i++) {
const section = sections[i];
const sectionName = section.split('\n')[0].trim();

if (!sectionName || sectionName === 'blockly package') continue;

// Match links in markdown pipe tables: | [Name](/reference/path) | ...
const tableRowRegex = /\|\s*\[([^\]]+)\]\(\/reference\/([^\)]+)\)/g;

const items = [];

let match;
while ((match = tableRowRegex.exec(section)) !== null) {
const name = match[1];
const href = match[2];
items.push({ name, path: href });
let tableMatch;
while ((tableMatch = tableRegex.exec(section)) !== null) {
let linkMatch;
while ((linkMatch = linkRegex.exec(tableMatch[0])) !== null) {
items.push({name: linkMatch[1], path: linkMatch[2]});
}
}

if (items.length > 0) {
result[sectionName] = items;
}
}

return result;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/context-menu-option/add-a-context-menu-item
description: How to add a context menu item to the registry.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/context-menu-option/callback
description: How to add a callback to a context menu item.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
pagination_prev: null
slug: /codelabs/context-menu-option/codelab-overview
description: Overview of the "Customizing context menus" codelab.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/context-menu-option/display-text
description: How to set the display text of a context menu item.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/context-menu-option/precondition-blockly-state
description: How to include a context menu item based on Blockly's state.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/context-menu-option/precondition-external-state
description: How to include a context menu item based on an external condition.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/context-menu-option/precondition-node-type
description: How to include a context menu item based on the node type.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/context-menu-option/separators
description: How to add a separator to a context menu.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/context-menu-option/setup
description: Setting up the "Customizing context menus" codelab.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
pagination_next: null
slug: /codelabs/context-menu-option/summary
description: Summary of the "Customizing context menus" codelab.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/context-menu-option/weight-and-id
description: How to set the weight and ID of a context menu item.
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/css/blocks.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Use CSS in Blockly - Blocks
slug: /codelabs/css/blocks
description: Styling blocks with CSS
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/css/categories.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Use CSS in Blockly - Toolbox Categories
slug: /codelabs/css/categories
description: Styling toolbox categories with CSS
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/css/codelab-overview.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
pagination_prev: null
title: Use CSS in Blockly - Codelab Overview
slug: /codelabs/css/codelab-overview
description: Overview of the CSS in Blockly codelab
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/css/components.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Use CSS in Blockly - Components
slug: /codelabs/css/components
description: Styling Blockly components with CSS
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/css/setup.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Use CSS in Blockly - Setup
slug: /codelabs/css/setup
description: Setup for the CSS in Blockly codelab
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/css/summary.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
pagination_next: null
title: Use CSS in Blockly - Summary
slug: /codelabs/css/summary
description: Summary of the CSS in Blockly codelab
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/css/tour.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Use CSS in Blockly - A tour of Blockly's elements
slug: /codelabs/css/tour
description: Explore Blockly's HTML and SVG elements in the CSS codelab
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-generator/array-block-generator
description: How to write a block code generator that creates an array.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-generator/block-generator-overview
description: Introduction to block generators.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
pagination_prev: null
slug: /codelabs/custom-generator/codelab-overview
description: Overview of the "Build a custom generator" codelab.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-generator/generating-a-stack
description: How to generate code for the blocks in a stack.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-generator/member-block-generator
description: How to write a block code generator using field and input values.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-generator/object-block-generator
description: How to write a block code generator that creates an object.
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/custom-generator/setup.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-generator/setup
description: Setting up the "Build a custom generator" codelab.
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/custom-generator/summary.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
pagination_next: null
slug: /codelabs/custom-generator/summary
description: Summary of the "Build a custom generator" codelab.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-generator/the-basics
description: How to define and call a language generator.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-generator/value-block-generators
description: How to write a block code generator for a simple value block.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-renderer/change-connection-shapes
description: How to change connection shapes.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
pagination_prev: null
slug: /codelabs/custom-renderer/codelab-overview
description: Overview of the "Build custom renderers" codelab.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-renderer/define-and-register-a-custom-renderer
description: How to register a custom renderer.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-renderer/observe-the-built-in-renderers
description: Introduction to the built-in renderers.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-renderer/override-constants
description: How to override the constants in a renderer.
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/custom-renderer/setup.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-renderer/setup
description: Setting up the "Build custom renderers" codelab.
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/custom-renderer/summary.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
pagination_next: null
slug: /codelabs/custom-renderer/summary
description: Summary of the "Build custom renderers" codelab.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-renderer/typed-connection-shapes
description: How to set connection shapes based on connection types.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-renderer/understand-connection-shapes
description: Introduction to connection shapes.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-toolbox/add-an-icon-to-your-category
description: How to add an icon to your category.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-toolbox/adding-a-custom-toolbox-item
description: How to add a custom item to a toolbox.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-toolbox/change-the-category-HTML
description: How to change the HTML used by a category.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-toolbox/change-the-look-of-a-category
description: How to change the look of a category.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-toolbox/change-the-look-of-a-selected-category
description: How to change the look of a selected category.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
pagination_prev: null
slug: /codelabs/custom-toolbox/codelab-overview
description: Overview of the "Customizing a Blockly toolbox" codelab.
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/custom-toolbox/setup.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/custom-toolbox/setup
description: Setting up the "Customizing a Blockly toolbox" codelab.
---

Expand Down
1 change: 0 additions & 1 deletion packages/docs/docs/codelabs/custom-toolbox/summary.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
pagination_next: null
slug: /codelabs/custom-toolbox/summary
description: Summary of the "Customizing a Blockly toolbox" codelab.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/getting-started/add-blockly-libraries
description: How to add Blockly libraries to an app.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
pagination_prev: null
slug: /codelabs/getting-started/codelab-overview
description: Overview of the "Getting started with Blockly" codelab.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/getting-started/create-a-blockly-workspace
description: How to add a workspace to your app.
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
slug: /codelabs/getting-started/create-a-custom-block
description: How to create a custom block.
---

Expand Down
Loading
Loading