help.html: support style/class replacement in more tags.

master
John Benediktsson 2020-02-15 10:27:22 -08:00
parent dbb83b7100
commit 8976014697
1 changed files with 7 additions and 8 deletions

View File

@ -5,8 +5,8 @@ debugger fry help help.home help.topics help.vocabs html
html.streams io.directories io.encodings.binary html.streams io.directories io.encodings.binary
io.encodings.utf8 io.files io.files.temp io.pathnames kernel io.encodings.utf8 io.files io.files.temp io.pathnames kernel
locals make math math.parser memoize namespaces sequences locals make math math.parser memoize namespaces sequences
serialize sorting splitting tools.completion vocabs sequences.deep serialize sorting splitting tools.completion
vocabs.hierarchy words xml.data xml.syntax xml.traversal vocabs vocabs.hierarchy words xml.data xml.syntax xml.traversal
xml.writer ; xml.writer ;
FROM: io.encodings.ascii => ascii ; FROM: io.encodings.ascii => ascii ;
FROM: ascii => ascii? ; FROM: ascii => ascii? ;
@ -75,8 +75,8 @@ M: pathname url-of
"conventions" >link topic>filename "conventions" >link topic>filename
[XML [XML
<div class="navbar"> <div class="navbar">
<a href="http://factorcode.org">Factor</a> <a href="http://factorcode.org">factorcode.org</a>
<a href="/">Documentation</a> <a href="/">Handbook</a>
<a href=<->>Glossary</a> <a href=<->>Glossary</a>
<form method="get" action="/search" style="display:inline;"> <form method="get" action="/search" style="display:inline;">
<input placeholder="Search" name="search" type="text"/> <input placeholder="Search" name="search" type="text"/>
@ -100,10 +100,9 @@ M: pathname url-of
H{ } clone :> classes H{ } clone :> classes
body [ body [
dup xml-chunk? [ dup xml-chunk? [
seq>> [ tag? ] filter seq>> [
"span" "div" [ deep-tags-named ] bi-curry@ bi append
[
dup { dup {
[ tag? ]
[ "style" attr ] [ "style" attr ]
[ "class" attr not ] [ "class" attr not ]
} 1&& [ } 1&& [
@ -111,7 +110,7 @@ M: pathname url-of
"style" over delete-at* drop classes css-class "style" over delete-at* drop classes css-class
"class" rot set-at "class" rot set-at
] [ drop ] if ] [ drop ] if
] each ] deep-each
] [ drop ] if ] [ drop ] if
] each classes sort-values css-classes body ; ] each classes sort-values css-classes body ;