-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfendo.markup.fendo.heading.fs
119 lines (88 loc) · 2.94 KB
/
fendo.markup.fendo.heading.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
.( fendo.markup.fendo.heading.fs ) cr
\ This file is part of Fendo
\ (http://programandala.net/en.program.fendo.html).
\ This file defines the Fendo markup for headings.
\ Last modified 202011160218.
\ See change log at the end of the file.
\ Copyright (C) 2013,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>.
\ ==============================================================
\ Tools {{{1
fendo_definitions
markup>order
: close_heading ( xt a -- )
dup @ if off execute else 2drop parsed$ $@ echo then ;
: (=) ( -- )
first_on_the_line? if
['] <h1> ['] </h1> opened_[=]? markups
else ['] </h1> opened_[=]? close_heading then ;
\ Open or close a <h1> heading.
: (==) ( -- )
first_on_the_line? if
['] <h2> ['] </h2> opened_[==]? markups
else ['] </h2> opened_[==]? close_heading then ;
\ Open or close a <h2> heading.
: (===) ( -- )
first_on_the_line? if
['] <h3> ['] </h3> opened_[===]? markups
else ['] </h3> opened_[===]? close_heading then ;
\ Open or close a <h3> heading.
: (====) ( -- )
first_on_the_line? if
['] <h4> ['] </h4> opened_[====]? markups
else ['] </h4> opened_[====]? close_heading then ;
\ Open or close a <h4> heading.
: (=====) ( -- )
first_on_the_line? if
['] <h5> ['] </h5> opened_[=====]? markups
else ['] </h5> opened_[=====]? close_heading then ;
\ Open or close a <h5> heading.
: (======) ( -- )
first_on_the_line? if
['] <h6> ['] </h6> opened_[======]? markups
else ['] </h6> opened_[======]? close_heading then ;
\ Open or close a <h6> heading.
markup<order
\ ==============================================================
\ Markup {{{1
markup_definitions
: = ( -- )
(=) ;
\ Open or close a <h1> heading.
: == ( -- )
(==) ;
\ Open or close a <h2> heading.
: === ( -- )
(===) ;
\ Open or close a <h3> heading.
: ==== ( -- )
(====) ;
\ Open or close a <h4> heading.
: ===== ( -- )
(=====) ;
\ Open or close a <h5> heading.
: ====== ( -- )
(======) ;
\ Open or close a <h6> heading.
fendo_definitions
.( fendo.markup.fendo.heading.fs compiled ) cr
\ ==============================================================
\ Change log {{{1
\ 2014-04-21: Code moved from <fendo.markup.fendo.fs>.
\
\ 2017-06-22: Update source style, layout and header.
\
\ 2018-12-08: Update notation of page IDs in comments and strings.
\ vim: filetype=gforth