Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Integration: #803 guide.add, layout.marginsAndColumns, layout.numberingOptions and file.savePreset describe every param they take

aionggd03b17ef5626
diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs
index 00d853833..82fc9209c 100644
--- a/crates/engine/src/cmd/file.rs
+++ b/crates/engine/src/cmd/file.rs
@@ -27,7 +27,7 @@ pub fn specs() -> Vec<CommandSpec> {
Ok(Value::Array(presets))
}),
cmd!(noundo "file.savePreset", "Save Document Preset", [], None,
- "{name, …the settings file.new takes} — kept with the preferences; `file.new {preset: name}` uses it. A saved preset of that name is replaced; built-in names are refused",
+ "{name, …the settings as file.new} — kept with the preferences; `file.new {preset: name}` uses it. A saved preset of that name is replaced; built-in names are refused",
always, save_preset),
cmd!(noundo "file.deletePreset", "Delete Document Preset", [], None, "{name} — a saved document preset", always, |s, p| {
let name = str_param(p, "name").unwrap_or_default().trim().to_string();
diff --git a/crates/engine/src/cmd/guides.rs b/crates/engine/src/cmd/guides.rs
index b2bc378a5..6acf6a15c 100644
--- a/crates/engine/src/cmd/guides.rs
+++ b/crates/engine/src/cmd/guides.rs
@@ -21,7 +21,7 @@ pub fn specs() -> Vec<CommandSpec> {
"New Guide",
[],
None,
- "{orientation: horizontal|vertical, position (spread coordinate), spread?, page? (index in the spread; default: the page under `at` or the position), at? (the other coordinate), spreadGuide?: bool} → {page, index}; {orientation: both, point: [x, y], …} adds a horizontal guide through y and a vertical guide through x as one undo step → {guides: [{page, index}, {page, index}]}",
+ "{orientation: horizontal|vertical, position (spread coordinate), spread?, page? (index in the spread; default: the page under `at` or the position), at? (the other coordinate), spreadGuide?: bool} or {orientation: both, point: [x, y], spread?, page?, spreadGuide?: bool} → {page, index}; `both` adds a horizontal guide through y and a vertical guide through x as one undo step → {guides: [{page, index}, {page, index}]}",
has_doc,
add
),
diff --git a/crates/engine/src/cmd/layout.rs b/crates/engine/src/cmd/layout.rs
index 2761b17e5..2468faefb 100644
--- a/crates/engine/src/cmd/layout.rs
+++ b/crates/engine/src/cmd/layout.rs
@@ -246,7 +246,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Margins and Columns…",
["Layout"],
None,
- "{pages?: [index] (default all), margins?: number|{top,bottom,inside,outside}, columns?, gutter?, adjustLayout?: bool (objects follow the margins)} — document pages take these as their own margins; with `parent` (a parent's prefix, label or index) the parent's pages change instead (`pages` then indexes them), and so do the document pages without their own",
+ "{pages?: [index] (default all), margins?: number|{top,bottom,inside,outside}, columns?, gutter?, adjustLayout?: bool (objects follow the margins), parent?: a parent's prefix, label or index} — document pages take these as their own margins; with `parent` the parent's pages change instead (`pages` then indexes them), and so do the document pages without their own",
has_doc,
|s, p| {
let pages: Option<Vec<usize>> =
@@ -508,7 +508,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Apply Numbering & Section Options",
[],
None,
- "{page, …layout.section's settings, chapter?: {…layout.chapterNumbering's settings}} — the section and the document's chapter numbering in one undo step; if either is refused nothing changes",
+ "{page, …the settings as layout.section, chapter?: {…the settings as layout.chapterNumbering}} — the section and the document's chapter numbering in one undo step; if either is refused nothing changes",
has_doc,
|s, p| {
let section = SectionEdit::parse("layout.numberingOptions", s, p)?;