Handbook Glossary
factorcode.org
cache-images ( body -- body' )


Vocabulary
help.html

Inputs
bodyan object


Outputs
body'an object


Definition
USING: accessors io.pathnames kernel sequences sequences.deep
xml.data xml.traversal ;

IN: help.html

: cache-images ( body -- body' )
dup [
dup xml-chunk? [
seq>> [
T{ name { main "img" } } over tag-named? [
dup "src" attr retina-image dup file-name
[ ?copy-file ] keep "src" set-attr
] [ drop ] if
] deep-each
] [ drop ] if
] each ;