-
+ <%VaultList%>
+
diff --git a/Docs/Design/FileFormats/vaults/native.html b/Docs/Design/FileFormats/vaults/native.html new file mode 100644 index 000000000..879242ca2 --- /dev/null +++ b/Docs/Design/FileFormats/vaults/native.html @@ -0,0 +1,928 @@ + + + + +
+ ++ This file format is the default vault data format used by CodeSnip Vault. +
+ ++ The format comprises a single XML file along with a number of data files located in the same directory. Each user can have zero or more snippet vaults that use this format. +
+ +
+ The XML file is named vault.xml
. It contains all the information about about the vault, except for the source code of each snippet.
+
+ Snippet source code is stored in separate data files – one per snippet. Each source code file is referenced by the XML file. +
+ ++ The format allows for later revisions. Files are versioned and comply with the principles of Semantic Versioning. Details of all the changes between versions are listed in the Change Log at the end of this document. +
+ +
+ All files are text files that use UTF-8 encoding, without any UTF-8 preamble (BOM). The XML processing instruction of vault.xml
has its encoding atrribute set to UTF-8
.
+
+ The following information applies to file format v1.0. +
+ ++ Attributes: +
+
1.0
.
+ UTF-8
.
+ + Parent node that contains all the vault data. +
++ Attributes: +
+882BAD68-8C3E-44E3-BBF4-17E55143DAF8
, regardless of the file version.
+ 1
.
+ 0
.
+ + Contains a list of all categories used by the vault. +
++ Contains information about a single category. There is one node per category. +
++ Attributes: +
++ Description of the category. +
++ Contains list of the unique keys of all snippets in this category. May be omitted if there are no snippets in the category. +
++ Contains the key of a snippet in the category. There is one node for each snippet in the category. +
++ The value must be: +
++ Contains defintiions of all snippets in the vault. +
++ Contains information about a snippet. There is one node per snippet. +
++ Attributes: +
++ The snippet key. +
++ The value must be: +
++ The unique id of the category to which the snippet belongs. +
++ The value must correspond to the id attribute of one of the vault/categories/category nodes. +
++ The type of snippet. +
++ Valid values are: +
+freeform
routine
type
const
class
unit
+ The values are not case sensitive. +
+
+ If vault/snippets/snippet/source-code/language has any value other than Pascal
then this attribute must have value freeform
.
+
+ The snippet's display name. +
++ Description of the snippet. +
++ Content must be valid REML markup. REML v6 is supported. +
++ This node may be omitted if there is no description. +
++ Additional information about the snippet. +
++ Content must be valid REML markup. REML v6 is supported. +
++ This node may be omitted if there are no notes. +
++ Contains information about a snippet's source code. +
++ Attributes: +
++ Name of the file containing the snippet's source code. +
++ The named file must exist in the same directory as this XML file. +
++ Identifies the programming language, if any, used by the source code. +
++ Valid values are: +
+text
– the snippet is plain text, not source code.
+ unknown
– the snippet's source code language is unknown to CodeSnip.
+ pascal
– the snippet's source code is written in Object Pascal.
+ + Contains a list of compile results for the snippet. +
++ This node has no meaning and must be omitted if either of the following two conditions apply: +
+pascal
.
+ freeform
.
+ + The compile result for a given compiler. There is an entry for each known compiler. +
++ Attributes: +
++ Identifies the compiler. Valid identifiers are are one of: +
++ The values are not case sensitive. +
++ The compile result for the compiler. Valid values are: +
+y
– Compiles with the identified compiler.
+ n
– Does not compile with the identified compiler.
+ q
– Compile result for this compiler is not known.
+ + The values are not case sensitive. +
++ There is no text content. +
+
+ Omitting a node for any compiler is permitted and is equivalent to specifying q
.
+
+ Provides information about the level of testing applied to this snippet. +
++ Attributes: +
++ The level of testing achieved. Valid values are: +
+none
– the snippet has not been tested.
+ basic
– the snippet has passed some simple, unspecified testing.
+ advanced
– the snippet has passed more advanced, but unspecified testing.
+ unit-tests
– the snippet has passed unit tests.
+ demo-code
– there exists demo code that exercises the snippet.
+ + The URL of any unit tests or demo code. +
+
+ This attribute must only be provided when the level attribute has value unit-tests
or demo-code
.
+
+ There is no text content. +
+
+ This node may be omitted if the unit has not been tested. In this case a testing level of none
will be assumed.
+
+ List of units required to compile the snippet. +
++ The node may be omitted if there are no required units. +
+
+ If vault/snippets/snippet/source-code/language has any value other than Pascal
then this node has no meaning and must be omitted.
+
+ Name of a unit within the required units list. +
++ Must be a valid Pascal identifier. +
++ List of snippets that are required to compile the snippet. +
++ The node may be omitted if there are no required snippets. +
+
+ If vault/snippets/snippet/source-code/language has any value other than Pascal
then this node has no meaning and must be omitted.
+
+ Key of a snippet within the required snippets list. +
++ List of cross-referenced snippets. +
++ The node may be omitted if there are no cross referenced snippets. +
++ Key of a snippet within the cross-references list. +
++ Contains license information for the vault. +
++ Attributes: +
++ The license's SPDX identifier. +
++ If the license has a SPDX identifier the attribute's value must be a valid SPDX identifier from the SPDX License List. +
++ If the license has no associated SPDX identifier then this attribute may be either omitted or have an empty value. +
++ The name of the license. +
++ If the spdx attribute refers to a valid SPDX identifier then this attribute should, but is not required to, contain the name of the matching license per the SPDX License List. +
+ If no license name is provided then this attribute may be either omitted or have an empty value. + ++ The URL of the full license text. +
++ If a URL is provided then the linked license should, but is not required to, have the same text as any license text in the file referenced by the license-file-name attribute. +
++ If no license URL is provided then this attribute may be either omitted or have an empty value. +
++ The name of a file containing the full license text. +
++ If a file name is provided then it must refer to an existing, non-empty, file in the same folder as the XML file. +
++ If no such license files exists then this attribute may be either omitted or have an empty value. +
++ This node has no text content. +
++ The node may be omitted if there are no values for any attributes. A missing node is taken to mean that there is no license information. +
++ Contains information about the copyright that applies to the vault. +
++ Attributes: +
++ The date of the copyright. +
+
+ The copyright date may be either a year (e.g. 2024
) or a range of years (e.g. 2009-2021
).
+
+ If no copyright date is provided then this attribute may be either omitted or have an empty value. +
++ The name(s) of the copyright holder(s). +
+
+ If there are numerous contributors to the vault, who each have a claim on copyright, they must be listed under the vault/copyright/contributors node and this attribute's value should refer to the fact, e.g. Alice Jones & contributors
or simply Contributors
.
+
+ If no copyright holder is provided then this attribute may be either omitted or have an empty value. +
++ A URL where additional copyright information can be found. +
++ If there is no such URL then this attribute may be either omitted or have an empty value. +
++ The node may be omitted if there are no values for any attributes the vault/copyright/contributors is not present. A missing node is taken to mean that there is no copyright information. +
++ Contains a list of contributors to the project who have a claim on copyright. +
++ The node may be omitted if there are no contributors. +
++ The name of a contributor. One node per contributor. +
++ Contains a list of names of people who have contributed in some way the the project. +
++ The node may be omitted if no people are acknowledged. +
++ Name being acknowledged. One node per name in the list. +
+
+ Source code is stored separately from the main XML file. The source code of each snippet has its own file. File names relate to the relevant snippet's key and have extension .source
.
+
+ Source code files are referenced by the file-name attribute of a snippet's vault/snippets/snippet/source-code node in the XML file. +
+ ++ Any license text is stored in separately from the main XML file. +
+ ++ This file may not be present if there is no license text specified. +
+ ++ The file is named according to the license-file-name attribute of the vault/license node. +
+ ++ This section describes the changes between versions of the file format. +
+ +- The DelphiDabbler - Code Snippets Database is a resource containing numerous fragments of useful Object Pascal code. You are using version <%Version%>. -
- -- The source code in the database is copyright © <%CopyrightYear%> by <%CopyrightHolders%>. It is made available under the terms of the <%DBLicense%>. -
- -- No copyright or licensing information is available. -
- -- The code is used entirely at your own risk. -
- -- Credits -
- -- The following people have contributed code to the database, or have helped to test it: -
- -- Credits, License and Copyright information are not available. The main database may be corrupt. Please use the Database | Install or Update DelphiDabbler Snippets Database menu option to display the Install or Update DelphiDabbler Snippets Database dialogue box and follow the instructions there to get the latest version of the database. -
- -- The database is not installed. -
- -- You can install it from the Database | Install or Update DelphiDabbler Snippets Database menu option. Learn more. -
- -- Before going any further you are strongly advised to take a backup of your snippets database. Use the Database | Backup User Database menu option to do this. + This action cannot be undone. You will loose all the snippets in the chosen vault. The vault itself will remain but will be empty.
- This action cannot be undone: you will loose all your user-defined snippets. + Before going any further you are strongly advised to take a backup of the vault you are planning to delete. Use the Database | Backup Vault menu option to do this.
- To confirm enter DELETE
MY
SNIPPETS
(in capital letters) in the box below, then click OK.
+ To proceed, first choose the vault you want to delete from the Choose vault drop down list. Then confirm the action by entering DELETE
MY
SNIPPETS
(in capital letters) in the Confirm deletion edit box.
- There will be no further chances to change your mind. + When you click OK there will be no further chances to change your mind.
diff --git a/Src/Res/HTML/info-empty-selection-tplt.html b/Src/Res/HTML/info-empty-selection-tplt.html index dd2b9fdd3..208243076 100644 --- a/Src/Res/HTML/info-empty-selection-tplt.html +++ b/Src/Res/HTML/info-empty-selection-tplt.html @@ -23,7 +23,7 @@ -