Moving xml.interpolate to xml.literals
parent
84a2ad091e
commit
de49f6fc74
|
@ -2,7 +2,7 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays combinators html.elements io
|
||||
io.streams.string kernel math namespaces peg peg.ebnf
|
||||
sequences sequences.deep strings xml.entities xml.interpolate
|
||||
sequences sequences.deep strings xml.entities xml.literals
|
||||
vectors splitting xmode.code2html urls.encoding xml.data
|
||||
xml.writer ;
|
||||
IN: farkup
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
Slava Pestov
|
||||
Daniel Ehrenberg
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
! Copyright (C) 2008 Slava Pestov
|
||||
! Copyright (C) 2008, 2009 Slava Pestov, Daniel Ehrenberg
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors kernel namespaces io math.parser assocs classes
|
||||
classes.tuple words arrays sequences splitting mirrors
|
||||
hashtables combinators continuations math strings inspector
|
||||
fry locals calendar calendar.format xml.entities xml.data
|
||||
validators urls present xml.writer xml.interpolate xml
|
||||
validators urls present xml.writer xml.literals xml
|
||||
xmode.code2html lcs.diff2html farkup io.streams.string
|
||||
html.elements html.streams html.forms ;
|
||||
IN: html.components
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: io io.styles kernel namespaces prettyprint quotations
|
||||
sequences strings words xml.entities compiler.units effects
|
||||
xml.data xml.interpolate urls math math.parser combinators
|
||||
xml.data xml.literals urls math math.parser combinators
|
||||
present fry io.streams.string xml.writer ;
|
||||
|
||||
IN: html.elements
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008 Slava Pestov
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: lcs xml.interpolate xml.writer kernel strings ;
|
||||
USING: lcs xml.literals xml.writer kernel strings ;
|
||||
FROM: accessors => item>> ;
|
||||
FROM: io => write ;
|
||||
FROM: sequences => each if-empty when-empty map ;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
USING: xml.utilities kernel assocs math.order
|
||||
strings sequences xml.data xml.writer
|
||||
io.streams.string combinators xml xml.entities.html io.files io
|
||||
http.client namespaces make xml.interpolate hashtables
|
||||
http.client namespaces make xml.literals hashtables
|
||||
calendar.format accessors continuations urls present ;
|
||||
IN: syndication
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
! Copyright (C) 2005, 2006 Daniel Ehrenberg
|
||||
! Copyright (C) 2005, 2009 Daniel Ehrenberg
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors kernel xml arrays math generic http.client
|
||||
combinators hashtables namespaces io base64 sequences strings
|
||||
calendar xml.data xml.writer xml.utilities assocs math.parser
|
||||
debugger calendar.format math.order xml.interpolate xml.dispatch ;
|
||||
debugger calendar.format math.order xml.literals xml.dispatch ;
|
||||
IN: xml-rpc
|
||||
|
||||
! * Sending RPC requests
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
USING: help.markup help.syntax present multiline ;
|
||||
IN: xml.interpolate
|
||||
USING: help.markup help.syntax present multiline xml.data ;
|
||||
IN: xml.literals
|
||||
|
||||
ABOUT: "xml.interpolate"
|
||||
ABOUT: "xml.literals"
|
||||
|
||||
ARTICLE: "xml.interpolate" "XML literal interpolation"
|
||||
"The " { $vocab-link "xml.interpolate" } " vocabulary provides a convenient syntax for generating XML documents and chunks. It defines the following parsing words:"
|
||||
ARTICLE: "xml.literals" "XML literals"
|
||||
"The " { $vocab-link "xml.literals" } " vocabulary provides a convenient syntax for generating XML documents and chunks. It defines the following parsing words:"
|
||||
{ $subsection POSTPONE: <XML }
|
||||
{ $subsection POSTPONE: [XML }
|
||||
"For a description of the common syntax of these two, see"
|
||||
{ $subsection { "xml.interpolate" "in-depth" } } ;
|
||||
"These can be used for creating an XML literal, which can be used with variables or a fry-like syntax to interpolate data into XML."
|
||||
{ $subsection { "xml.literals" "interpolation" } } ;
|
||||
|
||||
HELP: <XML
|
||||
{ $syntax "<XML <?xml version=\"1.0\"?><document>...</document> XML>" }
|
||||
{ $description "This syntax allows the interpolation of XML documents. When evaluated, there is an XML document on the stack. For more information about XML interpolation, see " { $link { "xml.interpolate" "in-depth" } } "." } ;
|
||||
{ $description "This gives syntax for literal XML documents. When evaluated, there is an XML document (" { $link xml } ") on the stack. It can be used for interpolation as well, if interpolation slots are used. For more information about XML interpolation, see " { $link { "xml.literals" "interpolation" } } "." } ;
|
||||
|
||||
HELP: [XML
|
||||
{ $syntax "[XML foo <x>...</x> bar <y>...</y> baz XML]" }
|
||||
{ $description "This syntax allows the interpolation of XML chunks. When evaluated, there is a sequence of XML elements (tags, strings, comments, etc) on the stack. For more information about XML interpolation, see " { $link { "xml.interpolate" "in-depth" } } "." } ;
|
||||
{ $description "This gives syntax for literal XML documents. When evaluated, there is an XML chunk (" { $link xml-chunk } ") on the stack. For more information about XML interpolation, see " { $link { "xml.literals" "interpolation" } } "." } ;
|
||||
|
||||
ARTICLE: { "xml.interpolate" "in-depth" } "XML interpolation syntax"
|
||||
ARTICLE: { "xml.literals" "interpolation" } "XML interpolation syntax"
|
||||
"XML interpolation has two forms for each of the words " { $link POSTPONE: <XML } " and " { $link POSTPONE: [XML } ": a fry-like form and a locals form. To splice locals in, use the syntax " { $snippet "<-variable->" } ". To splice something in from the stack, in the style of " { $vocab-link "fry" } ", use the syntax " { $snippet "<->" } ". An XML interpolation form may only use one of these styles."
|
||||
$nl
|
||||
"These forms can be used where a tag might go, as in " { $snippet "[XML <foo><-></foo> XML]" } " or where an attribute might go, as in " { $snippet "[XML <foo bar=<->/> XML]" } ". When an attribute is spliced in, it is not included if the value is " { $snippet "f" } " and if the value is not a string, the value is put through " { $link present } ". Here is an example of the fry style of XML interpolation:"
|
||||
{ $example
|
||||
{" USING: splitting sequences xml.writer xml.interpolate ;
|
||||
{" USING: splitting sequences xml.writer xml.literals ;
|
||||
"one two three" " " split
|
||||
[ [XML <item><-></item> XML] ] map
|
||||
<XML <doc><-></doc> XML> pprint-xml"}
|
||||
|
@ -41,7 +41,7 @@ $nl
|
|||
</doc>"} }
|
||||
"Here is an example of the locals version:"
|
||||
{ $example
|
||||
{" USING: locals urls xml.interpolate xml.writer ;
|
||||
{" USING: locals urls xml.literals xml.writer ;
|
||||
[let |
|
||||
number [ 3 ]
|
||||
false [ f ]
|
|
@ -1,9 +1,9 @@
|
|||
! Copyright (C) 2009 Daniel Ehrenberg.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: tools.test xml.interpolate multiline kernel assocs
|
||||
sequences accessors xml.writer xml.interpolate.private
|
||||
USING: tools.test xml.literals multiline kernel assocs
|
||||
sequences accessors xml.writer xml.literals.private
|
||||
locals splitting urls xml.data classes ;
|
||||
IN: xml.interpolate.tests
|
||||
IN: xml.literals.tests
|
||||
|
||||
[ "a" "c" { "a" "c" f } ] [
|
||||
"<?xml version='1.0'?><x><-a-><b val=<-c->/><-></x>"
|
|
@ -4,7 +4,7 @@ USING: xml xml.state kernel sequences fry assocs xml.data
|
|||
accessors strings make multiline parser namespaces macros
|
||||
sequences.deep generalizations words combinators
|
||||
math present arrays unicode.categories ;
|
||||
IN: xml.interpolate
|
||||
IN: xml.literals
|
||||
|
||||
<PRIVATE
|
||||
|
|
@ -41,7 +41,7 @@ HELP: pprint-xml
|
|||
|
||||
HELP: indenter
|
||||
{ $var-description "Contains the string which is used for indenting in the XML prettyprinter. For example, to print an XML document using " { $snippet "%%%%" } " for indentation, you can use the following:" }
|
||||
{ $example {" USING: xml.interpolate xml.writer namespaces ;
|
||||
{ $example {" USING: xml.literals xml.writer namespaces ;
|
||||
[XML <foo>bar</foo> XML] "%%%%" indenter [ pprint-xml ] with-variable "} {"
|
||||
<foo>
|
||||
%%%%bar
|
||||
|
@ -49,7 +49,7 @@ HELP: indenter
|
|||
|
||||
HELP: sensitive-tags
|
||||
{ $var-description "Contains a sequence of " { $link name } "s where whitespace should be considered significant for prettyprinting purposes. The sequence can contain " { $link string } "s in place of names. For example, to preserve whitespace inside a " { $snippet "pre" } " tag:" }
|
||||
{ $example {" USING: xml.interpolate xml.writer namespaces ;
|
||||
{ $example {" USING: xml.literals xml.writer namespaces ;
|
||||
[XML <html> <head> <title> something</title></head><body><pre>bing
|
||||
bang
|
||||
bong</pre></body></html> XML] { "pre" } sensitive-tags [ pprint-xml ] with-variable "} {"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
USING: xmode.tokens xmode.marker xmode.catalog kernel locals
|
||||
html.elements io io.files sequences words io.encodings.utf8
|
||||
namespaces xml.entities accessors xml.interpolate locals xml.writer ;
|
||||
namespaces xml.entities accessors xml.literals locals xml.writer ;
|
||||
IN: xmode.code2html
|
||||
|
||||
: htmlize-tokens ( tokens -- xml )
|
||||
|
|
Loading…
Reference in New Issue