◊(Local Yarn Code "Check-in [d4c38fce]")

Overview
Comment:Fix for error when note contents are not a tagged X-expression (e.g. a single sentence)
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d4c38fce69efb9b89b28f3c2a4549d58cc375e234408f299389ddeb2669b4757
User & Date: joel on 2018-09-22 20:30:14
Other Links: manifest | tags
Context
2018-09-22
20:31
Revert unneeded changes to setup module check-in: 2af9d30b user: joel tags: trunk
20:30
Fix for error when note contents are not a tagged X-expression (e.g. a single sentence) check-in: d4c38fce user: joel tags: trunk
19:42
Add space between multiple notes in an article. Hide byline for notes by the site proprietor. check-in: 4fec6778 user: joel tags: trunk
Changes

Modified pollen.rkt from [3ae0eb3e] to [3efe7301].

35
36
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
         "template-html.rkt"
         "crystalize.rkt")

(provide (all-defined-out)
         (all-from-out "crystalize.rkt" "template-html.rkt"))

(module setup racket/base
  (require syntax/modresolve)
  (provide (all-defined-out))
  (define poly-targets '(html))

  (define cache-watchlist
    (map resolve-module-path '("tags-html.rkt"
                               "template-html.rkt"
                               "dust.rkt"
                               "crystalize.rkt"))))

;; Macro for defining tag functions that automatically branch based on the 







|


>







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
         "template-html.rkt"
         "crystalize.rkt")

(provide (all-defined-out)
         (all-from-out "crystalize.rkt" "template-html.rkt"))

(module setup racket/base
  (require syntax/modresolve pollen/setup)
  (provide (all-defined-out))
  (define poly-targets '(html))
  ;(define block-tags (cons 'note default-block-tags))
  (define cache-watchlist
    (map resolve-module-path '("tags-html.rkt"
                               "template-html.rkt"
                               "dust.rkt"
                               "crystalize.rkt"))))

;; Macro for defining tag functions that automatically branch based on the 
103
104
105
106
107
108
109


110
111
112
113
114
115
116
(poly-branch-tag blockcode)
(poly-branch-tag verse)          ; [#:title ""] [#:italic "no"]

(poly-branch-func link)
(poly-branch-func url)
(poly-branch-func fn)
(poly-branch-func fndef)



;; Not yet implemented
; (poly-branch-tag table)         ; #:columns ""
; (poly-branch-tag inline-math)
; (poly-branch-tag margin-note)
; (poly-branch-tag noun)
; (poly-branch-func index-entry entry)







>
>







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
(poly-branch-tag blockcode)
(poly-branch-tag verse)          ; [#:title ""] [#:italic "no"]

(poly-branch-func link)
(poly-branch-func url)
(poly-branch-func fn)
(poly-branch-func fndef)

(poly-branch-tag note)

;; Not yet implemented
; (poly-branch-tag table)         ; #:columns ""
; (poly-branch-tag inline-math)
; (poly-branch-tag margin-note)
; (poly-branch-tag noun)
; (poly-branch-func index-entry entry)

Modified tags-html.rkt from [f673367b] to [12093157].

75
76
77
78
79
80
81
82

83
84
85
86
87
88
89
         html-smallcaps
         html-center
         html-blockcode
         html-verse
         html-link
         html-url
         html-fn
         html-fndef)


(define html-item (default-tag-function 'li))
(define html-section (default-tag-function 'h2))
(define html-subsection (default-tag-function 'h3))
(define html-newthought (default-tag-function 'span #:class "newthought"))
(define html-smallcaps (default-tag-function 'span #:class "smallcaps"))
(define html-center (default-tag-function 'div #:style "text-align: center"))







|
>







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
         html-smallcaps
         html-center
         html-blockcode
         html-verse
         html-link
         html-url
         html-fn
         html-fndef
         html-note)

(define html-item (default-tag-function 'li))
(define html-section (default-tag-function 'h2))
(define html-subsection (default-tag-function 'h3))
(define html-newthought (default-tag-function 'span #:class "newthought"))
(define html-smallcaps (default-tag-function 'span #:class "smallcaps"))
(define html-center (default-tag-function 'div #:style "text-align: center"))
185
186
187
188
189
190
191



                     [backrefs (for/list ([fnref-num (in-range backref-count)])
                                         `(a [[href ,(string-append "#"
                                                                    (fn-id fn-name)
                                                                    (format "~a" (+ 1 fnref-num)))]] "↩"))])
                `(li [[id ,(fndef-id fn-name)]] ,@definition-text ,@backrefs))))
  (cond [(null? note-items) ""]
        [else `(section ((class "footnotes")) (hr) (ol ,@note-items))]))










>
>
>
186
187
188
189
190
191
192
193
194
195
                     [backrefs (for/list ([fnref-num (in-range backref-count)])
                                         `(a [[href ,(string-append "#"
                                                                    (fn-id fn-name)
                                                                    (format "~a" (+ 1 fnref-num)))]] "↩"))])
                `(li [[id ,(fndef-id fn-name)]] ,@definition-text ,@backrefs))))
  (cond [(null? note-items) ""]
        [else `(section ((class "footnotes")) (hr) (ol ,@note-items))]))

(define-tag-function (html-note attrs elems)
  (txexpr 'note attrs (decode-paragraphs elems #:force? #t)))