From 4f493f1a8367096d887a655a9c22b949744778fd Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 26 Jul 2019 13:37:01 +0200 Subject: [PATCH 1/3] Fix broken links to extended attribute subsections --- docs/reference/item.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/item.md b/docs/reference/item.md index c2cace28d..b9fc48cf4 100644 --- a/docs/reference/item.md +++ b/docs/reference/item.md @@ -285,7 +285,7 @@ In this example, an extended attribute `invented-by` is added to the item. invented-by: jane@example.com ``` -**Defaults for extended attributes** +## Defaults for extended attributes Optionally, you can add custom default values for extended attributes. Add them as key-value pairs to the `defaults` dictionary under the `attributes` @@ -310,7 +310,7 @@ attributes: attribute-key-3: ... default values can be arbitrarily complex ``` -**Extended reviewed attributes** +## Extended reviewed attributes By default, the values of extended attributes do **not** contribute to the [fingerprint](item.md#reviewed) of the item. Optionally, you can add the From 7be6b2f3bf4af6179dd4a4d003c9eeda9ade46dc Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 25 Jul 2019 17:52:43 +0200 Subject: [PATCH 2/3] Document configuration options --- docs/cli/creation.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/cli/creation.md b/docs/cli/creation.md index b649e2358..8a5622d42 100644 --- a/docs/cli/creation.md +++ b/docs/cli/creation.md @@ -39,3 +39,41 @@ linked item: TST001 (@/reqs/tests/TST001.yml) -> REQ001 (@/reqs/REQ001.yml) It is not allowed to create links which would end up in a self reference or cyclic dependency. + +# Document Configuration + +The settings and attribute options of each document are stored in a +corresponding `.doorstop.yml` file. Some configuration options can be set via +`doorstop create` command line parameters such as the document *prefix*, the +item UID *digits*, and the *parent* prefix. Others can only be changed by +manually editing the configuration file. The list of options follows: + +* *settings* + + * *digits*: defines the number of digits in an item UID. The default value + is 3. Optionally, you can set it through the `-d` command line option of + the `doorstop create` command. It is a mandatory and read-only document + setting. + + * *parent*: defines the parent document prefix. You set it through the `-p` + command line option of the `doorstop create` command. It is an optional + and read-only document setting. + + * *prefix*: defines the document prefix. You set it through the prefix of + the `doorstop create` command. It is a mandatory and read-only document + setting. + + * *sep*: defines the separator between the document prefix and the number in + an item UID. The default value is the empty string. You have to set it + manually before an item is created. Afterwards, it should be considered as + read-only. This document setting is mandatory. + +* *attributes* + + * *defaults*: defines the + [defaults for extended attributes](../reference/item.md#defaults-for-extended-attributes). + This is an optional document configuration option. + + * *reviewed*: defines which + [ extended attributes contribute to the item fingerprint](../reference/item.md#extended-reviewed-attributes). + This is an optional document configuration option. From 3dac3deee7409a0fe4c10519d8f1ad3644e8fb90 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 25 Jul 2019 15:40:26 +0200 Subject: [PATCH 3/3] Simplify Document.save() --- doorstop/core/document.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doorstop/core/document.py b/doorstop/core/document.py index 2d3692c85..100f6853e 100644 --- a/doorstop/core/document.py +++ b/doorstop/core/document.py @@ -183,15 +183,11 @@ def save(self): for key, value in self._data.items(): if key == 'prefix': sets[key] = str(value) - elif key == 'sep': - sets[key] = value - elif key == 'digits': - sets[key] = value elif key == 'parent': if value: sets[key] = value else: - data[key] = value + sets[key] = value data['settings'] = sets # Save the attributes attributes = {}