Skip to content

Commit fa357a8

Browse files
committed
[[ Community Docs ]] Update contributing document and format reference
1 parent 6f54235 commit fa357a8

2 files changed

Lines changed: 97 additions & 26 deletions

File tree

Lines changed: 71 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,77 @@
1-
# Contributing to the LiveCode Dictionary
1+
# Contributing to LiveCode Documentation
22

3-
*Note this document is specifically about contributing to the documentation of LiveCode.
4-
If you are looking for a general guide to contributing to the LiveCode source, see the
3+
*Note this document is specifically about contributing to the
4+
documentation of LiveCode. If you are looking for a general guide to
5+
contributing to the LiveCode source, see the
56
[toplevel CONTRIBUTING.md document](../CONTRIBUTING.md)*
67

7-
Have you noticed an error in the documentation? Do you want to add an instructive example?
8-
Or can you explain a concept better than it is currently explained? Please consider submitting
9-
your proposed changes directly to the livecode repo on GitHub.
8+
Have you noticed an error in the documentation? Do you want to add an
9+
instructive example? Or can you explain a concept better than it is
10+
currently explained? Please consider submitting your proposed changes
11+
directly to the LiveCode repo on GitHub.
1012

11-
Before you start, please familiarize yourself with the [documentation format specification](../../../../livecode-ide/blob/develop/Documentation/guides/Extending LiveCode.md#documentation-markup).
13+
If your changes constitute a substantial rewrite of a dictionary entry,
14+
please familiarize yourself with the
15+
[documentation format specification](guides/LiveCode Documentation Format Reference.md).
1216

1317
# Documentation Objectives
1418

19+
Our objectives for the LiveCode documentation can be categorised as
20+
- Completeness
21+
- Correctness
22+
- Instructiveness
23+
1524
## Completeness
1625

26+
In the context of the dictionary, completeness clearly entails the
27+
documentation of all LiveCode syntax. The most basic form of
28+
incompleteness is a completely missing dictionary entry. If you intend
29+
to write a missing dictionary entry, please bear these documentation
30+
objectives in mind and consult the
31+
[documentation format specification](guides/LiveCode Documentation Format Reference.md),
32+
33+
The dictionary ought to contain *all* the relevant information about a
34+
particular piece of LiveCode syntax. Every syntax variant should be
35+
explained in detail in the description. Some of the most commonly
36+
missing information in our current dictionary is as follows:
37+
- Inadequate or missing explanation of a parameter's function
38+
- Omitted description of side effects, especially when `the result` or
39+
`it` may be affected
40+
- Omitted description of the function of optional syntax elements
41+
1742
## Correctness
1843

19-
## Runnable examples
44+
Correctness of documentation comes in two forms.
2045

21-
Where possible, the `Example:` elements of the docs should be complete and runnable.
22-
This means that where possible one of the following should apply:
23-
* The example can be copied, pasted into the message box and executed to demonstrate
24-
the functionality being described.
25-
* The example contains commented commands and functions which, can be copied and pasted
26-
into the script of an object, and which when called with appropriate parameters
27-
demonstrates the functionality being described.
46+
Firstly, the information contained in the descriptions of elements
47+
should be accurate and up-to-date. Some of our documentation was written
48+
prior to major developments in both our software and the hardware it
49+
runs on.
50+
51+
Secondly, dictionary Syntax elements must be correct. The
52+
[documentation format specification](guides/LiveCode Documentation Format Reference.md)
53+
contains a description of the Syntax element.
2854

55+
Thirdly, the dictionary files must be formatted correctly. This means
56+
conforming to the aforementioned format reference, and also for
57+
parameters defined in the Syntax elements to correspond exactly to those
58+
described later on in the entry.
59+
60+
## Instructiveness
61+
62+
One major objective we have with our documentation is to improve our
63+
code examples. Where possible, the `Example:` elements of the docs
64+
should be complete and runnable.
65+
This means that where possible one of the following should apply:
66+
-The example can be copied, pasted into the message box and executed to
67+
demonstrate the functionality being described.
68+
-The example contains commented commands and functions which, can be
69+
copied and pasted into the script of an object, and which when called
70+
with appropriate parameters demonstrates the functionality being
71+
described.
2972

30-
In general, the way to ensure this is to use constants where possible, rather than
31-
variables and objects:
73+
In general, the way to ensure this is to use constants where possible,
74+
rather than variables and objects:
3275

3376
(Good)
3477
`put sentence 1 of "Hello! Is it me you're looking for?" -- output is 'Hello! '`
@@ -72,21 +115,23 @@ end fibonacciNumber
72115

73116
## Tags
74117

75-
Tags are a great way to help users find what they want in the dictionary. However badly
76-
coordinated tags can quickly become a hindrance. Ensure the tag you want to add doesn't
77-
exist already in a slightly different form, and consider starting a dialogue about a new
78-
tag and what entries could be most usefully tagged with it.
118+
Tags are a great way to help users find what they want in the dictionary.
119+
However badly coordinated tags can quickly become a hindrance. Ensure
120+
the tag you want to add doesn't exist already in a slightly different
121+
form, and consider starting a dialogue about a new tag and what entries
122+
could be most usefully tagged with it.
79123

80124
# Community Documentation Contribution Process
81125

82-
After creating an account on GitHub at https://github.com/join, there are three main ways
83-
of submitting pull requests. The first exclusively uses the GitHub website, and is most suitable
84-
for people with no experience of git or other version control systems.
126+
After creating an account on GitHub at https://github.com/join, there
127+
are three main ways of submitting pull requests. The first exclusively
128+
uses the GitHub website, and is most suitable for people with no
129+
experience of git or other version control systems.
85130

86131
## Using the GitHub Web Interface
87132

88-
It is possible to contribute to the LiveCode dictionary using the GitHub website, without
89-
having to download any software or use the command line.
133+
It is possible to contribute to the LiveCode dictionary using the GitHub
134+
website, without having to download any software or use the command line.
90135

91136
### Making your dictionary change
92137

docs/guides/LiveCode Documentation Format Reference.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,32 @@ The glossary-level entries have part of their content generated from the API-lev
5151
A description of how to use or call this facet of the API. May just be the name itself, for keywords etc.
5252
An entry may have a number of Syntax elements, if there are variations within the same entry.
5353

54+
The following can be used to specify livecode syntax:
55+
- [optional]
56+
- ... (repeated)
57+
- { variant 1 | variant 2 }
58+
- <parameterName>
59+
60+
For example, the syntax for the first variant of the `split` command:
61+
62+
split <variable> {by | using | with} <primaryDelimiter> [and <secondaryDelimiter>]
63+
64+
describes the following possible usages:
65+
- `split tVar by comma`
66+
- `split tVar using return`
67+
- `split tVar with "a"`
68+
- `split tVar by comma and return`
69+
- `split tVar using the rowdel and the columndel`
70+
- `split tVar with tDelim1 and tDelim2`
71+
72+
The syntax for `answer file with type`:
73+
74+
answer file[s] <prompt> [with <defaultPath>] [with type <types> [or type <types> ...]] [titled <windowTitle>] [as sheet]
75+
76+
gives an example of the repetition notation, namely it allows something like
77+
78+
answer files with type tType1 or type tType2 or type tType3 or type tType4
79+
5480
>*Note:* For inline docs, the Syntax elements are automatically generated
5581
5682
### Summary (required)

0 commit comments

Comments
 (0)