-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfendo.addon.tag_list.fs
68 lines (50 loc) · 2.12 KB
/
fendo.addon.tag_list.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
.( fendo.addon.tag_list.fs) cr
\ This file is part of Fendo
\ (http://programandala.net/en.program.fendo.html).
\ This file provides tag lists.
\ Last modified 20220123T1353+0100.
\ See change log at the end of the file.
\ Copyright (C) 2014,2017,2018 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).
\ ==============================================================
\ Requirements {{{1
require ./fendo.addon.tags.fs
\ ==============================================================
\ Code {{{1
: tag_list { pid -- }
tags_do_count pid tags evaluate_tags
tags_do_list_link #tag off pid tags evaluate_tags ;
\ Create a tag list of links for the given page ID.
\ First, update the `#tags` variable.
\ Then build the list (`#tag` must be reset, because it will be
\ compared with `#tags` during the process).
: tag_ul ( pid -- )
[<ul>] tag_list [</ul>] ;
: tag_ol ( pid -- )
[<ol>] tag_list [</ol>] ;
.( fendo.addon.tag_list.fs compiled) cr
\ ==============================================================
\ Change log {{{1
\ 2014-03-04: Start.
\
\ 2014-11-05: Improvement: `tag_list` is modified after the
\ improvements in <fendo.addon.tags.fs> that let the last element of a
\ tag link list to be marked with a class.
\
\ 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.
\ vim: filetype=gforth