Skip to content

Enclose scribble parts in an html section tag #520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions scribble-lib/scribble/html-render.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,17 @@
,(part-title-and-content-wrapper-attribs w)
,@l))]
[else l]))
(let ([number (collected-info-number (part-collected-info d ri))])
(let* ([number (collected-info-number (part-collected-info d ri))]
[depth (add1 (number-depth number))]
[formatted-number (format-number number "")]
[number-string
(if (null? formatted-number)
"0"
(car formatted-number))])
(add-title-and-content-wrapper
`(,@(let ([pres (extract-pretitle d)])
`((section ([class ,(format "SsectionLevel~a" depth)]
[id ,(format "section ~a" number-string)])
,@(let ([pres (extract-pretitle d)])
(append-map (lambda (pre)
(do-render-paragraph pre d ri #f #t))
pres))
Expand Down Expand Up @@ -1216,7 +1224,7 @@
(if (null? secs)
null
(append (render-part (car secs) ri)
(loop (add1 pos) (cdr secs))))))))))
(loop (add1 pos) (cdr secs)))))))))))

(define/private (render-flow* p part ri starting-item? special-last?)
;; Wrap each table with <p>, except for a trailing table
Expand Down