Skip to content

Commit 28c5a99

Browse files
committed
Tweak the new indexing policy document as asked
1 parent 6d14cbe commit 28c5a99

File tree

2 files changed

+81
-62
lines changed

2 files changed

+81
-62
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ in the [#raku IRC channel](https://raku.org/community/irc).
1919
# TABLE OF CONTENTS
2020
- [General principles](#general-principles)
2121
- [Writing code examples](#writing-code-examples)
22+
- [Indexing content](#indexing-content)
2223
- [Adding a new Language document](#adding-a-new-language-document)
2324
- [Documenting types](#documenting-types)
2425
- [Writing and Testing Examples](#writing-and-testing-examples)
@@ -66,6 +67,11 @@ in the [#raku IRC channel](https://raku.org/community/irc).
6667
See [EXAMPLES.md](writing-docs/EXAMPLES.md) for detailed information on the options
6768
available when writing code examples in the documentation.
6869

70+
## Indexing content
71+
72+
See [INDEXING.md](writing-docs/INDEXING.md) for detailed information on how
73+
indexing of terms and locations in the documentation works.
74+
6975
## Adding a new Language document
7076

7177
We suggest you discuss proposing a new Language document on the #raku
@@ -175,68 +181,6 @@ the page to activate debug mode. The state of debug mode will be remembered by
175181
`window.sessionStorage` and will not survive a browser restart or opening the
176182
docs in a new tab.
177183

178-
### Search indexing rules
179-
180-
Bits of the content can be indexed for quick navigation.
181-
182-
An index item is created using the Pod formatting code `X` in those formats:
183-
184-
# the `text` is rendered, an item with text `item` under the category `category`
185-
# is added to the index
186-
X<text|category,item>
187-
# can index more than one item
188-
X<text|category1,item1;category2,item2;...>
189-
# can omit text, nothing is rendered, but an index item will be created
190-
X<|category,item>
191-
192-
Valid examples are:
193-
194-
X<|Syntax,does>
195-
X<|Language,\ (container binding)>
196-
X<Subroutines|Syntax,sub>
197-
X<|Variables,$*PID>
198-
X<Automatic signatures|Variables,@_;Variables,%_>
199-
X<Typing|Language,typed array;Syntax,[ ] (typed array)>
200-
X<Attributes|Language,Attribute;Other languages,Property;Other languages,Member;Other languages,Slot>
201-
202-
To avoid cluttering of index item categories, only a number of categories is allowed to specify,
203-
so when indexing new items be sure to use one of the:
204-
205-
* `Types` (used for reference of Raku types)
206-
* `Modules` (used for built-in modules in Raku)
207-
* `Routines` (a common category for something existing as a method and a subroutine)
208-
* `Subroutines` (used for reference of Raku subroutines)
209-
* `Methods`(used for reference of Raku methods)
210-
* `Terms` (used for reference of Raku terms)
211-
* `Adverbs` (used for reference of Raku adverbs)
212-
* `Traits` (used for reference of Raku traits)
213-
* `Phasers` (used for reference of Raku phasers)
214-
* `Asynchronous Phasers` (used for reference of Raku asyncronous phasers)
215-
* `Pragmas` (used for reference of Raku pragmas)
216-
* `Variables` (used for reference of Raku special variables)
217-
* `Control flow` (used for terms related to control flow)
218-
* `Regexes` (used for terms related to regexes)
219-
* `Operators` (used for cases of operators not fitting for other operator categories, for example operators like `s///`, hyper, method call operators etc.)
220-
* `Listop operators` (used for listop ops)
221-
* `Infix operators` (used for infix ops)
222-
* `Metaoperators` (used for meta ops)
223-
* `Postfix operators` (used for postfix ops)
224-
* `Prefix operators` (used for prefix ops)
225-
* `Circumfix operators` (used for circumfix ops)
226-
* `Postcircumfix operators` (used for postcircumfix ops)
227-
* `Tutorial` (used for indexing explanation of some item in a tutorial-like manner rather than pure reference)
228-
* `Other languages` (used for terms from other languages and migration guides)
229-
* `Syntax` (used for indexing various language syntax constructs not fitting into other categories (syntax))
230-
* `Language` (used for indexing reference-like explanation of various language concepts (semantics), for example, `hash slice` or `Unquoting`)
231-
* `Programs` (legacy, program writing-related topics) # to be decided
232-
* `Reference` (used for indexing various names not directly coming from Raku or other languages, for example, `opcode` or `MoarVM`)
233-
234-
If you see an item mis-categorized, please give it some love or open a ticket if you are not sure where
235-
an item fits best.
236-
237-
Other than explicit creation, headers (`=head` elements of Pod) of certain format get an anchor automatically,
238-
say `=head routine sin` creates an index item categorized as `Subroutines` automatically.
239-
240184
### Broken links
241185

242186
To check for broken links use debug mode. Any spotted broken link will be

writing-docs/INDEXING.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Search indexing rules
2+
3+
### Synopsis
4+
5+
A term or a location in a Pod6 document can be indexed so that it is
6+
possible to create a named reference pointing to it. This can be used
7+
to generate a reference in the rendered version of the documentation or
8+
implement search function on the website hosting the rendered documentation.
9+
10+
### Format
11+
12+
An index item is created using the Pod formatting code `X` in these formats:
13+
14+
# the `text` is rendered, an item with text `item` under the category `category`
15+
# is added to the index
16+
X<text|category,item>
17+
# can index more than one item
18+
X<text|category1,item1;category2,item2;...>
19+
# can omit text, nothing is rendered, but an index item will be created
20+
X<|category,item>
21+
22+
Valid examples are:
23+
24+
X<|Syntax,does>
25+
X<|Language,\ (container binding)>
26+
X<Subroutines|Syntax,sub>
27+
X<|Variables,$*PID>
28+
X<Automatic signatures|Variables,@_;Variables,%_>
29+
X<Typing|Language,typed array;Syntax,[ ] (typed array)>
30+
X<Attributes|Language,Attribute;Other languages,Property;Other languages,Member;Other languages,Slot>
31+
32+
### Categories
33+
34+
To avoid cluttering of index item categories, only 28 categories can be specified,
35+
so when indexing new items be sure to use one of:
36+
37+
* `Types` (reference of Raku types)
38+
* `Modules` (built-in modules in Raku)
39+
* `Routines` (a common category for something existing as a method and a subroutine)
40+
* `Subroutines` (reference of Raku subroutines)
41+
* `Methods`(reference of Raku methods)
42+
* `Terms` (reference of Raku terms)
43+
* `Adverbs` (reference of Raku adverbs)
44+
* `Traits` (reference of Raku traits)
45+
* `Phasers` (reference of Raku phasers)
46+
* `Asynchronous Phasers` (reference of Raku asyncronous phasers)
47+
* `Pragmas` (reference of Raku pragmas)
48+
* `Variables` (reference of Raku special variables)
49+
* `Control flow` (terms related to control flow)
50+
* `Regexes` (terms related to regexes)
51+
* `Operators` (cases of operators not fitting for other operator categories, for example operators like `s///`, hyper, method call operators etc.)
52+
* `Listop operators` (listop ops)
53+
* `Infix operators` (infix ops)
54+
* `Metaoperators` (meta ops)
55+
* `Postfix operators` (postfix ops)
56+
* `Prefix operators` (prefix ops)
57+
* `Circumfix operators` (circumfix ops)
58+
* `Postcircumfix operators` (postcircumfix ops)
59+
* `Tutorial` (indexing explanation of some item in a tutorial-like manner rather than pure reference)
60+
* `Other languages` (terms from other languages and migration guides)
61+
* `Syntax` (indexing various language syntax constructs not fitting into other categories (syntax))
62+
* `Language` (indexing reference-like explanation of various language concepts (semantics), for example, `hash slice` or `Unquoting`)
63+
* `Programs` (legacy, program writing-related topics) # to be decided
64+
* `Reference` (indexing various concepts and names not directly coming from Raku or other languages, for example, `opcode` or `MoarVM`)
65+
66+
If you see an item mis-categorized, please give it some love or open a ticket if you are not sure where
67+
it fits best.
68+
69+
Other than explicit creation, headers (`=head` elements of Pod) of certain format get an anchor automatically,
70+
say `=head routine sin` creates an index item categorized as `Subroutines` automatically.
71+
72+
### Testing
73+
74+
There is a test checking basic syntax of the references in the documentation
75+
in author tests, so the suite passing means the references are at least well-formatted.

0 commit comments

Comments
 (0)