| |
|
| \ alignment |
\ alignment |
| |
|
| |
Variable table-format |
| |
Variable table# |
| |
Variable table-start |
| |
|
| : >align ( c -- ) |
: >align ( c -- ) |
| CASE |
CASE |
| 'l OF s" left" align= ENDOF |
'l OF s" left" align= ENDOF |
| '< OF s" left" align= ENDOF |
'< OF s" left" align= ENDOF |
| '> OF s" right" align= ENDOF |
'> OF s" right" align= ENDOF |
| '= OF s" center" align= ENDOF |
'= OF s" center" align= ENDOF |
| |
digit? IF 0 <# #S #> s" rowspan" opt |
| |
table# @ 1+ table-start ! THEN 0 |
| ENDCASE ; |
ENDCASE ; |
| |
|
| : >border ( c -- ) |
: >border ( c -- ) |
| :noname bl sword postpone SLiteral r@ postpone Literal |
:noname bl sword postpone SLiteral r@ postpone Literal |
| postpone parse-tag postpone ; r> cells do-words + ! ; |
postpone parse-tag postpone ; r> cells do-words + ! ; |
| |
|
| |
: >tag '\ parse type '\ parse tag ; |
| |
|
| char>tag * b |
char>tag * b |
| char>tag _ em |
char>tag _ em |
| char>tag # code |
char>tag # code |
| |
|
| ' >link bind-char [ |
' >link bind-char [ |
| ' >img bind-char { |
' >img bind-char { |
| |
' >tag bind-char \ |
| |
|
| : do-word ( char -- ) cells do-words + perform ; |
: do-word ( char -- ) cells do-words + perform ; |
| |
|
| : top-toc align here toc-link >last , 1 toc, ; |
: top-toc align here toc-link >last , 1 toc, ; |
| : this-toc align here toc-link >last , 2 toc, ; |
: this-toc align here toc-link >last , 2 toc, ; |
| : sub-toc align here toc-link >last , 3 toc, ; |
: sub-toc align here toc-link >last , 3 toc, ; |
| |
: new-toc toc-link off ; |
| |
|
| Variable toc-name |
Variable toc-name |
| |
|
| : ** 1 indent s" h2" line +indent ; |
: ** 1 indent s" h2" line +indent ; |
| : *** 2 indent s" h3" line +indent ; |
: *** 2 indent s" h3" line +indent ; |
| : -- 0 indent cr print-toc ; |
: -- 0 indent cr print-toc ; |
| |
: && 0 parse name= s" " s" a" tagged ; |
| : - s" ul" env s" li" par ; |
: - s" ul" env s" li" par ; |
| : + s" ol" env s" li" par ; |
: + s" ol" env s" li" par ; |
| : << +env ; |
: << +env ; |
| |
|
| \ Table |
\ Table |
| |
|
| Variable table-format |
|
| Variable table# |
|
| |
|
| : |tag table-format $@ table# @ /string drop c@ >align |
: |tag table-format $@ table# @ /string drop c@ >align |
| >env 1 table# +! ; |
>env 1 table# +! ; |
| : |d table# @ IF -env THEN s" td" |tag ; |
: |d table# @ table-start @ > IF -env THEN s" td" |tag ; |
| : |h table# @ IF -env THEN s" th" |tag ; |
: |h table# @ table-start @ > IF -env THEN s" th" |tag ; |
| : |line s" tr" >env table# off ; |
: |line s" tr" >env table-start @ table# ! ; |
| : line| -env -env cr ; |
: line| -env -env cr ; |
| |
|
| : next-char ( -- char ) source drop >in @ + c@ ; |
: next-char ( -- char ) source drop >in @ + c@ ; |
| |
|
| longtags set-current |
longtags set-current |
| |
|
| : <| s" table" >env bl sword table-format $! ; |
: <| bl sword table-format $! table-start off bl sword |
| : |> -env ; |
dup IF s" border" opt ELSE 2drop THEN s" table" >env ; |
| |
: |> -env -env cr cr ; |
| : +| |line |
: +| |line |
| BEGIN |
BEGIN |
| |h '| parse-to next-char '+ = UNTIL line| ; |
|h '| parse-to next-char '+ = UNTIL line| ; |
| |
|
| Variable mail |
Variable mail |
| Variable mail-name |
Variable mail-name |
| |
Variable orig-date |
| |
|
| : .trailer |
: .trailer |
| s" address" >env s" center" >env |
s" address" >env s" center" >env |
| |
orig-date @ IF ." Created " orig-date $@ type ." . " THEN |
| ." Last modified: " time&date rot 0 u.r swap 1- |
." Last modified: " time&date rot 0 u.r swap 1- |
| s" janfebmaraprmayjunjulaugsepoctnovdec" rot 3 * /string 3 min type |
s" janfebmaraprmayjunjulaugsepoctnovdec" rot 3 * /string 3 min type |
| 0 u.r ." by " |
0 u.r ." by " |
| |
|
| : parse" ( -- addr u ) '" parse 2drop '" parse ; |
: parse" ( -- addr u ) '" parse 2drop '" parse ; |
| |
|
| : maintainer |
: maintainer ( -- ) |
| bl sword mail $! parse" mail-name $! ; |
bl sword mail $! parse" mail-name $! ; |
| |
: created ( -- ) |
| |
bl sword orig-date $! ; |
| |
|
| Variable style$ |
Variable style$ |
| : style> style$ @ 0= IF s" " style$ $! THEN style$ $@ tag-option $! ; |
: style> style$ @ 0= IF s" " style$ $! THEN style$ $@ tag-option $! ; |