Updated Wiki content

OrcaSlicerBot
2025-12-02 13:52:46 +00:00
parent 007f891d15
commit 587bc13d2a
2 changed files with 57 additions and 8 deletions

@@ -42,7 +42,7 @@ jobs:
const references = collectReferences(source); const references = collectReferences(source);
if (!references.length) { if (!references.length) {
core.info('No double-string append_single_option_line entries found.'); core.info('No Tab link references found.');
return; return;
} }
@@ -122,10 +122,10 @@ jobs:
core.info(`Validated ${references.length} Tab link(s). All good.`); core.info(`Validated ${references.length} Tab link(s). All good.`);
function collectReferences(text) { function collectReferences(text) {
const pattern = /append_single_option_line\s*\(\s*"([^"]+)"\s*(?:,\s*"([^"]+)")?/g;
const refs = []; const refs = [];
const appendSinglePattern = /append_single_option_line\s*\(\s*"([^"]+)"\s*(?:,\s*"([^"]+)")?/g;
let match; let match;
while ((match = pattern.exec(text)) !== null) { while ((match = appendSinglePattern.exec(text)) !== null) {
if (!match[2]) { if (!match[2]) {
continue; continue;
} }
@@ -135,6 +135,25 @@ jobs:
line: lineFromIndex(text, match.index), 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; return refs;
} }

@@ -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. 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 ```cpp
optgroup->append_single_option_line("OPTION_NAME"); // Option without wiki page/redirection 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]", "[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: Example:
```cpp ```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 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 ## Formatting and Style
Follow these style and formatting conventions when contributing to the wiki. Follow these style and formatting conventions when contributing to the wiki.