From bb58b12c29cc393162f9e7c953af06f120f1048a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 23 May 2021 01:30:08 +0100 Subject: [PATCH] docs: wip document shapelibs, move from shapelib-toml Signed-off-by: Ian Jackson --- docs/shapelibs.rst | 10 +++++++++- src/shapelib-toml.rs | 16 +--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/docs/shapelibs.rst b/docs/shapelibs.rst index f99567f3..422e36ee 100644 --- a/docs/shapelibs.rst +++ b/docs/shapelibs.rst @@ -150,6 +150,15 @@ See the existing examples to see what item names usually look like. Parameters ---------- + * ``inherit`` (string: group name). Causes this group to inherit + every parameter (except ``files``) from the group named by + ``inherit`` (recursively, if applicable). + + When inheritance is happening, there is of course a difference + between leaving a value unspecified, and specifying it to have + the usual default value: the latter would override any inherited + setting. + * ``item_prefix``, ``item_suffix`` (strings, default ``""``). Prepaended and appended to ``ITEM-SPEC`` in ``files`` to produce the item name. @@ -163,4 +172,3 @@ Parameters If both are specified, the group parameter is used as a template. ``_s`` is replaced by the sort extra field from the ``files`` list ``_c`` is replaced by the colour, if applicable. - diff --git a/src/shapelib-toml.rs b/src/shapelib-toml.rs index 8874042e..33691703 100644 --- a/src/shapelib-toml.rs +++ b/src/shapelib-toml.rs @@ -18,23 +18,9 @@ pub struct GroupDefn { #[serde(flatten)] pub d: GroupDetails, } -/// Details for a group of pieces. See also [`GroupDefn`]. -/// -/// This is separate from `GroupDefn` only to make the -/// implementation convenient (for complicated reasons). At the -/// library TOML file level, there is no meaningful difference between -/// the fields in this struct, and the ones in `GroupDefn` #[derive(Debug,Deserialize)] pub struct GroupDetails { - /// Causes this group to inherit every setting from the `GroupDefn` - /// and `GroupDetails` of the group named by `inherit` (recursively, - /// if applicable). - /// - /// When inheritance is happening, there is of course a difference - /// between leaving a value unspecified, and specifying it to have - /// the usual default value: the latter would override any inherited - /// setting. - #[cfg(doc)] + #[cfg(doc)] // handled specially inherit: String, /// Should be either a 1- or 2- element list, x and y, or just one -- 2.30.2