-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfendo.addon.lioc.fs
87 lines (69 loc) · 2.51 KB
/
fendo.addon.lioc.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.( fendo.addon.lioc.fs) cr
\ This file is part of Fendo
\ (http://programandala.net/en.program.fendo.html).
\ This file provides a word that is needed by other addons.
\ Last modified 20211023T1637+0200.
\ See change log at the end of the file.
\ Copyright (C) 2014,2017,2018,2019,2021 Marcos Cruz (programandala.net)
\ Fendo is free software; you can redistribute it and/or modify it
\ under the terms of the GNU General Public License as published by
\ the Free Software Foundation; either version 2 of the License, or
\ (at your option) any later version.
\ Fendo is distributed in the hope that it will be useful, but WITHOUT
\ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
\ License for more details.
\ You should have received a copy of the GNU General Public License
\ along with this program; if not, see <http://gnu.org/licenses>.
\ Fendo is written in Forth (http://forth-standard.org)
\ with Gforth (http://gnu.org/software/gforth).
\ ==============================================================
: (lioc) ( ca len -- )
[<li>] link<pid$ [</li>] ;
\ doc{
\
\ (lioc) ( ca len -- )
\
\ Create an element of a list of content for the page identified by
\ page ID _ca len_. ``(lioc)`` is a factor of `(lioc)`.
\
\ }doc
: lioc ( ca len -- )
2dup pid$>pid# unlistable? if 2drop else (lioc) then ;
\ doc{
\
\ lioc ( ca len -- )
\
\ If page identified by page ID _ca len_ can be listed, i.e. its
\ `properties` field does not contain "unlistable", create its
\ corresponding element of a list of content.
\
\ See also: `unlistable?`, `(lioc)`.
\
\ }doc
: ?lioc ( ca len f -- )
if lioc else 2drop then ;
\ Create an element of a list of content, if needed.
\ ca len = page ID
\
\ XXX OLD Not used
.( fendo.addon.lioc.fs compiled) cr
\ ==============================================================
\ Change log {{{1
\ 2014-03-02: Factored out from <fendo.addon.lioc_by_regex.fs> and
\ <fendo.addon.lioc_by_prefix.fs>.
\
\ 2014-03-03: Change: `title_link` now is `link<pid$`, after the
\ changes in <fendo.tools.fs>.
\
\ 2017-06-22: Update source style, layout and header.
\
\ 2018-12-08: Update notation of Forth words in comments and strings.
\
\ 2018-12-08: Update notation of page IDs in comments and strings.
\
\ 2019-02-07: Improve `lioc`: check `unlistable?` and factor to
\ `(lioc)`. Improve documentation.
\
\ 2021-10-23: Replace "See:" with "See also:" in the documentation.
\ vim: filetype=gforth