Skip to content
Merged

Fix #25

Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion srfi-tools/html.sld
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
(write-string-about-srfi srfi-text num))

(define (srfi-abstract-sxml num)
(call-with-input-file (srfi-abstract-html-file num) html->sxml))
(define skip-top cdr)
(skip-top
(call-with-input-file (srfi-abstract-html-file num) html->sxml)))

(define (srfi-abstract-html num)
(file-contents-as-string (srfi-abstract-html-file num)))
Expand Down
2 changes: 1 addition & 1 deletion srfi-tools/rss.scm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
" is now in "
(em ,(srfi-status srfi))
" status."
(blockquote ,(srfi-abstract-sxml n))))))
(blockquote ,@(srfi-abstract-sxml n))))))

(define (srfi-rss-sxml)
(define (srfi-time srfi)
Expand Down
5 changes: 3 additions & 2 deletions srfi-tools/srfi-tools.egg
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@
(extension srfi-tools.private.hash-table (source "private/hash-table.sld")
(csc-options "-R" "r7rs" "-X" "r7rs"))
(extension srfi-tools.private.html-parser (source "private/html-parser.sld")
(source-dependencies "chibi-html-parser.scm")
(source-dependencies "private/chibi-html-parser.scm")
(csc-options "-R" "r7rs" "-X" "r7rs"))
(extension srfi-tools.private.html-writer (source "private/html-writer.sld")
(source-dependencies "chibi-sxml.scm")
(source-dependencies "private/chibi-sxml.scm")
(csc-options "-R" "r7rs" "-X" "r7rs"))
(extension srfi-tools.private.list (source "private/list.sld")
(csc-options "-R" "r7rs" "-X" "r7rs"))
Expand Down Expand Up @@ -227,6 +227,7 @@
(component-dependencies srfi-tools.private.list)
(csc-options "-R" "r7rs" "-X" "r7rs"))
(extension srfi-tools.private.sysdep (source "private/sysdep.sld")
(source-dependencies "private/sysdep.chicken.scm")
(csc-options "-R" "r7rs" "-X" "r7rs"))
(extension srfi-tools.private.tar (source "private/tar.sld")
(csc-options "-R" "r7rs" "-X" "r7rs"))
Expand Down
6 changes: 5 additions & 1 deletion srfi-tools/toc.sld
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
(list (cons level (sxml-body-as-string elem)))
(append-map headings (sxml-body elem))))))

(define (headings->tree hs)
(define (headings->tree/values hs)
(let deeper ((level #f) (hs hs))
(let same-level ((acc '()) (hs hs))
(if (null? hs) (values acc '())
Expand All @@ -49,6 +49,10 @@
subtree)))
hs)))))))))

(define (headings->tree hs)
(let-values (((subtree hs) (headings->tree/values hs)))
subtree))

(define (string->slug string)
(let ((chars
(string-fold
Expand Down