Skip to content

Commit

Permalink
defsubideogr
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyingwang committed Feb 13, 2025
1 parent 8629ca8 commit 593df4e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 30 deletions.
20 changes: 19 additions & 1 deletion scribble.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
;; defradical defcomponent defcharacter defhybrid
defradical defcomponent defsuffix defprefix definsert defhas
defzi defzis defzi/puauni defzi/sub defcompost
defideogr
defideogr defsubideogr
zi zi-ref zitools-ref
ziexamples rackets
short-for-code short-for-racket
Expand Down Expand Up @@ -189,6 +189,24 @@
])
)


(define-syntax (defsubideogr stx)
(syntax-case stx ()
[(_ zi meaning parent content ...)
(with-syntax ([str-zi (symbol->string (syntax-e #'zi))]
[str-parent (symbol->string (syntax-e #'parent))])
#`(elem #:style (style #f (list (alt-tag "blockquote") (attributes '([class . "leftindent SVInsetFlow"]))))
(elem #:style (style #f (list (alt-tag "div") (attributes '([class . "boxed RBoxed"] [style . "margin-top: 1em; margin-bottom: 1em; "]))))
(elemtag str-zi (elem (bold (racket (code:hilite zi))) (hspace 1)
(elem #:style (style #f (list (alt-tag "div") (attributes '([class . "RBackgroundLabel SIEHidden"]))))
#,(r-background-label "ideograph component"))
(linebreak) (hspace 2) (italic "connotation : ") meaning
(linebreak) (hspace 2) (italic "originates from : ") (zi-ref str-parent)
)))
(elem content ...)))]
)
)

(define-syntax (defideogr stx)
(syntax-case stx ()
[(_ (zis ...) meaning cnchar cnchar-meaning content ...)
Expand Down
3 changes: 1 addition & 2 deletions scribblings/ming-lib/string.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
@(require scribble-rainbow-delimiters)
@script/rainbow-delimiters*


@title[#:tag "ming-string"]{句}
@defmodule[ming/string]
Orignates from @secref["string"].
@defmodule[ming/string]

@deftogether[(
@defproc[(􏽀 [V any?] ...) 􏽀?]
Expand Down
45 changes: 18 additions & 27 deletions scribblings/racket-lib/string.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,26 @@
Originates from @secref["strings" #:doc '(lib "scribblings/reference/reference.scrbl")] and Extends to @secref["ming-string"].


@section[#:tag "nameing-rules-of-string"]{Naming Rules}
Overall @secref["naming-rules"]

@tabular[@;#:sep @hspace[0]
#:style 'boxed
#:column-properties '(center)
#:row-properties '(border)
(list (list @bold{Rules} @bold{Connotation} @bold{Elucidation} @bold{Examples})
(list
@elem{@bold{@litchar{句}} as component on the bottom}
@elem{indicate output type}
@elem{output type is @zi[句]}
@elem{@code{句 􏽀 􏼅 􏼄 􏼃 􏼂}})
(list
@elem{@bold{@litchar{句}} as compoment on the right}
@elem{indicate output type}
@elem{output type is @zi[句]}
@elem{@code{􏶒 􏿴化句}})
(list
@elem{@bold{@litchar{句}} as component on the left}
@elem{indicate input type}
@elem{input type is @zi[句]}
@elem{@code{􏺕 􏼭 􏶑 句化􏿴 􏶐 􏶊 􏶋 􏶉 􏶈 􏶇 􏶆}})
)]


@section{句 􏽀 􏽁, 句? 􏽀? 􏽁?, 􏼟?}
@eleph-note{@zi[􏷂] @zi[􏶿]}
@defzi[句]{@same-as-cnchar-but["" "sentences" "string"].}

@defideogr[句 "string" "" "sentences"]{
@ziexamples[句? 句化􏿴 􏿴化句]

@defsubideogr[句B "output type is string" 句]{
@ziexamples[􏽀 􏼅 􏼄 􏼃 􏼂]
}

@defsubideogr[句L "input type is string" 句]{
@ziexamples[􏺕 􏼭 􏶒 􏶐 􏶊 􏶋 邭 􏶉 􏶈 􏶇 􏶆]
}

@defsubideogr[句R "output type is string" 句]{
@ziexamples[􏶑]
}
}


@defzis[􏽁/􏽀]{@zi[山]/@zi[𭕄 ] + @zi[句]. resembles @zi[句], but is specified to be immutable or mutable.}
@examples[#:eval (the-eval)
(句 #\T #\h #\i #\s #\I #\s #\S #\t #\r #\i #\n #\g)
Expand Down

0 comments on commit 593df4e

Please sign in to comment.