Skip to content

Commit 46ae69b

Browse files
committed
Fix error in export file format documentation
Documentation of XML tags relating to storing snippet xrefs in export files was removed as erroneous. The error was noted and the file format bumped to v8 following this change. Updated the current file version number in the UCodeImportExport unit to v8. Fixes #151 Updated the export help topic to note that snippet categories and xrefs are not exported.
1 parent 0a06818 commit 46ae69b

File tree

3 files changed

+48
-37
lines changed

3 files changed

+48
-37
lines changed

Docs/Design/FileFormats/export.html

+41-34
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
66
* obtain one at https://mozilla.org/MPL/2.0/
77
*
8-
* Copyright (C) 2012-2024, Peter Johnson (gravatar.com/delphidabbler).
8+
* Copyright (C) 2012-2025, Peter Johnson (gravatar.com/delphidabbler).
99
*
1010
* CodeSnip File Format Documentation: Export
1111
-->
@@ -57,6 +57,9 @@ <h2>
5757
<li>
5858
<a href="#file-format">File Format</a>
5959
</li>
60+
<li>
61+
<a href="#erratum">Erratum</a>
62+
</li>
6063
<li>
6164
<a href="#changelog">Change Log</a>
6265
</li>
@@ -114,8 +117,8 @@ <h2>
114117
</h2>
115118

116119
<p>
117-
There have been seven different versions of the XML export file format &ndash; v1 to
118-
v7. Tags used by all versions are explained below, with notes describing
120+
There have been eight different versions of the XML export file format &ndash; v1 to
121+
v8. Tags used by all versions are explained below, with notes describing
119122
which versions a tag applies to. Where there is no note the tag is valid in
120123
all versions.
121124
</p>
@@ -176,7 +179,7 @@ <h2>
176179
</dt>
177180
<dd>
178181
Identifies major version of file. Determines which tags are valid and
179-
establishes rules concerning content. Valid versions are 1 to 7.
182+
establishes rules concerning content. Valid versions are 1 to 8.
180183
</dd>
181184
</dl>
182185
</dd>
@@ -198,7 +201,7 @@ <h2>
198201
<span class="highlight">versions 1 to 6:</span> Contains information about user who created the file &nbsp; used for submissions to the online database, omitted for other exports.
199202
</li>
200203
<li>
201-
<span class="highlight">version 7:</span> Not supported. Ignored if present.
204+
<span class="highlight">version 7 and later:</span> Not supported. Ignored if present.
202205
</li>
203206
</ul>
204207
</dd>
@@ -212,7 +215,7 @@ <h2>
212215
<span class="highlight">versions 1 to 6:</span> User's name or nickname.
213216
</li>
214217
<li>
215-
<span class="highlight">version 7:</span> Not supported. Ignored if present.
218+
<span class="highlight">version 7 and later:</span> Not supported. Ignored if present.
216219
</li>
217220
</ul>
218221
</dd>
@@ -226,7 +229,7 @@ <h2>
226229
<span class="highlight">versions 1 to 6:</span> User's email address.
227230
</li>
228231
<li>
229-
<span class="highlight">version 7:</span> Not supported. Ignored if present.
232+
<span class="highlight">version 7 and later:</span> Not supported. Ignored if present.
230233
</li>
231234
</ul>
232235
</dd>
@@ -240,7 +243,7 @@ <h2>
240243
<span class="highlight">versions 1 to 6:</span> Any comments provided by user.
241244
</li>
242245
<li>
243-
<span class="highlight">version 7:</span> Not supported. Ignored if present.
246+
<span class="highlight">version 7 and later:</span> Not supported. Ignored if present.
244247
</li>
245248
</ul>
246249
</dd>
@@ -687,33 +690,21 @@ <h2>
687690
</ul>
688691
</dd>
689692

690-
<dt>
691-
<strong>codesnip-export/routines/routine/xref</strong>
692-
</dt>
693-
<dd>
694-
List of cross-referenced snippets.
695-
</dd>
693+
</section>
696694

697-
<dt>
698-
<strong>codesnip-export/routines/routine/xref/pascal-name</strong>
699-
</dt>
700-
<dd>
701-
<div class="half-spaced">
702-
Name of a snippet within cross-reference list.
703-
</div>
704-
<ul class="squashed">
705-
<li>
706-
<span class="highlight">versions 1 to 4:</span> Name must begin with an
707-
English language letter or the underscore.
708-
</li>
709-
<li>
710-
<span class="highlight">version 5 and later:</span> Name can begin with
711-
any character that is valid as the first character of a Unicode Pascal
712-
identifier.
713-
</li>
714-
</ul>
715-
</dd>
716-
</dl>
695+
<section id="erratum">
696+
697+
<h2>
698+
Erratum
699+
</h2>
700+
701+
<p>
702+
The <em>codesnip-export/routines/routine/xref</em> and <em>codesnip-export/routines/routine/xref/pascal-name</em> tags were included in versions 1 to 7 of this specification in error. XRefs were never intended to be written to export files by any version of CodeSnip, as source code comments make clear.
703+
</p>
704+
705+
<p>
706+
These tags have been removed from this document entirely of specification version 8.
707+
</p>
717708

718709
</section>
719710

@@ -1008,6 +999,18 @@ <h2>
1008999
</dd>
10091000
</dl>
10101001
</dd>
1002+
1003+
<dt>
1004+
<strong>Version 8 - 15 April 2025</strong>
1005+
</dt>
1006+
<dd>
1007+
<p>
1008+
Introduced with CodeSnip v4.24.3.
1009+
</p>
1010+
<p>
1011+
The <em>codesnip-export/routines/routine/xref</em> and <em>codesnip-export/routines/routine/xref/pascal-name</em> tags were removed from the specification. See <a href="#erratum">Erratum</a> above for details.
1012+
</p>
1013+
</dd>
10111014
</dl>
10121015

10131016
</section>
@@ -1058,6 +1061,10 @@ <h2>
10581061
Readers of v2 files and later can parse REML as v6, since all versions of REML up to v6 are backwards compatible.
10591062
</p>
10601063

1064+
<p>
1065+
Readers of v1 to v7 files must ignore any <em>codesnip-export/routines/routine/xref</em> tags and sub tags in the unlikely event that they are found. For an explanation see <a href="#erratum">Erratum</a> above.
1066+
</p>
1067+
10611068
</section>
10621069

10631070
</body>

Src/Help/HTML/dlg_export.htm

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
55
* obtain one at https://mozilla.org/MPL/2.0/
66
*
7-
* Copyright (C) 2008-2021, Peter Johnson (gravatar.com/delphidabbler).
7+
* Copyright (C) 2008-2025, Peter Johnson (gravatar.com/delphidabbler).
88
*
99
* Help topic for Export Snippets dialogue box.
1010
-->
@@ -57,6 +57,10 @@ <h1>
5757
and the dialogue box remains open. The export can be aborted by clicking
5858
the <em>Cancel</em> button.
5959
</p>
60+
<p>
61+
<strong>Note:</strong> Snippet categories and cross references are not
62+
included in the export file.
63+
</p>
6064
</body>
6165
</html>
6266

Src/UCodeImportExport.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2008-2023, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2008-2025. Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Implements classes that can import and export user defined snippets from and
99
* to XML.
@@ -181,7 +181,7 @@ implementation
181181
cWatermark = 'B46969D4-D367-4F5F-833E-F165FBA78631';
182182
// file version numbers
183183
cEarliestVersion = 1; // earliest file version supported by importer
184-
cLatestVersion = 7; // current file version written by exporter
184+
cLatestVersion = 8; // current file version written by exporter
185185

186186
{ TCodeExporter }
187187

0 commit comments

Comments
 (0)