From 587bc13d2a9dab2f60630a77848e281cf9dffb38 Mon Sep 17 00:00:00 2001 From: OrcaSlicerBot Date: Tue, 2 Dec 2025 13:52:46 +0000 Subject: [PATCH] Updated Wiki content --- .github/workflows/validate_tab_links.yml | 25 +++++++++++++-- developer-reference/How-to-wiki.md | 40 +++++++++++++++++++++--- 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/.github/workflows/validate_tab_links.yml b/.github/workflows/validate_tab_links.yml index 74c16bf..bb75d5c 100644 --- a/.github/workflows/validate_tab_links.yml +++ b/.github/workflows/validate_tab_links.yml @@ -42,7 +42,7 @@ jobs: const references = collectReferences(source); if (!references.length) { - core.info('No double-string append_single_option_line entries found.'); + core.info('No Tab link references found.'); return; } @@ -122,10 +122,10 @@ jobs: core.info(`Validated ${references.length} Tab link(s). All good.`); function collectReferences(text) { - const pattern = /append_single_option_line\s*\(\s*"([^"]+)"\s*(?:,\s*"([^"]+)")?/g; const refs = []; + const appendSinglePattern = /append_single_option_line\s*\(\s*"([^"]+)"\s*(?:,\s*"([^"]+)")?/g; let match; - while ((match = pattern.exec(text)) !== null) { + while ((match = appendSinglePattern.exec(text)) !== null) { if (!match[2]) { continue; } @@ -135,6 +135,25 @@ jobs: line: lineFromIndex(text, match.index), }); } + + const labelPathPattern = /label_path\s*=\s*"([^"]+)"/g; + while ((match = labelPathPattern.exec(text)) !== null) { + refs.push({ + option: 'label_path', + target: match[1].trim(), + line: lineFromIndex(text, match.index), + }); + } + + const appendOptionLinePattern = /append_option_line\s*\(\s*[^,]+,\s*[^,]+,\s*"([^"]+)"/g; + while ((match = appendOptionLinePattern.exec(text)) !== null) { + refs.push({ + option: 'append_option_line', + target: match[1].trim(), + line: lineFromIndex(text, match.index), + }); + } + return refs; } diff --git a/developer-reference/How-to-wiki.md b/developer-reference/How-to-wiki.md index f57c48b..40dc0d7 100644 --- a/developer-reference/How-to-wiki.md +++ b/developer-reference/How-to-wiki.md @@ -88,15 +88,18 @@ When creating new pages, follow these file-naming conventions: OrcaSlicer can redirect users from the GUI to the appropriate wiki pages, making it easier to find relevant documentation. -The option-to-wiki mapping is defined in [src/slic3r/GUI/Tab.cpp](https://github.com/OrcaSlicer/OrcaSlicer/blob/main/src/slic3r/GUI/Tab.cpp). Any option added with `append_single_option_line` can be mapped to a wiki page using a second string argument. +The option-to-wiki mapping is defined in [src/slic3r/GUI/Tab.cpp](https://github.com/OrcaSlicer/OrcaSlicer/blob/main/src/slic3r/GUI/Tab.cpp). +The links naming uses the same format as the [Wiki Navigation described above](#index-and-navigation), `[filename]#[section(optional)]` e.g. `quality_settings_seam` or `quality_settings_seam#scarf-joint-seam`. + +There are 3 main ways to set up these links: + +1. Using `append_single_option_line` with a second string argument for the wiki page. ```cpp -optgroup->append_single_option_line("OPTION_NAME"); // Option without wiki page/redirection -optgroup->append_single_option_line("OPTION_NAME", "WIKI_PAGE"); // Option with wiki page and redirection +optgroup->append_single_option_line("[OPTION_NAME]"); // Option without wiki page/redirection +optgroup->append_single_option_line("[OPTION_NAME]", "[WIKI_LINK]"); // Option with wiki page and redirection ``` -You can also point to a specific section within a wiki page by appending a fragment identifier (for example `#section-name`). - Example: ```cpp @@ -104,6 +107,33 @@ optgroup->append_single_option_line("seam_gap","quality_settings_seam"); // Wiki optgroup->append_single_option_line("seam_slope_type", "quality_settings_seam#scarf-joint-seam"); // Wiki page and redirection to `Scarf Joint Seam` section ``` +2. Using `append_option_line` with a third string argument for the wiki page. + +```cpp +append_option_line([optgroup], [opt_key], "[WIKI_LINK]"); +``` + +Example: + +```cpp +append_option_line(optgroup, "machine_max_acceleration_x", "printer_motion_ability#acceleration-limitation"); +``` + +3. Using grouped rows with `append_line` and setting the wiki target via `line.label_path`. + +```cpp +line.label_path = "[WIKI_LINK]"; +``` + +Example: + +```cpp +Line line = { L("Overhang speed"), L("...") }; +line.label_path = "speed_settings_overhang_speed#slow-down-for-overhang"; +line.append_option(optgroup->get_option("overhang_1_4_speed")); +optgroup->append_line(line); +``` + ## Formatting and Style Follow these style and formatting conventions when contributing to the wiki.