Browse Source

scheme list processing in example

pull/2/head
Ivan Polyakov 2 years ago
parent
commit
9facf0ad6e
  1. 6
      README.md
  2. 12
      example/src/index.sxml
  3. 14
      example/webpack.config.js

6
README.md

@ -45,9 +45,11 @@ use: [ @@ -45,9 +45,11 @@ use: [
loader: 'sxml-loader',
options: {
interpreter: 'guile',
flags: ['-c'], // "eval" flag (in Guile case "-c") should be last.
// SXML_LOADER_CONTENT will be replaced with processing SXML markup.
// The "eval" flag (in the case of Guile "-c") must come last.
flags: ['-c'],
// SXML_LOADER_CONTENT will be replaced with SXML markup.
expr: '(use-modules (sxml simple))(sxml->xml SXML_LOADER_CONTENT)',
},
},

12
example/src/index.sxml

@ -1,5 +1,11 @@ @@ -1,5 +1,11 @@
'((html
`((html (@ (lang en))
(head
(title "Hello"))
(meta (@ (charset utf-8)))
(title "sxml-loader example"))
(body
(h1 "Hello World!"))))
(h1 "sxml-loader example")
(h2 "List rendering")
,(map
(lambda (num) `(article "Article " ,num))
'(1 2 3)))))

14
example/webpack.config.js

@ -6,7 +6,19 @@ module.exports = { @@ -6,7 +6,19 @@ module.exports = {
rules: [
{
test: /\.sxml$/,
use: ['html-loader', 'sxml-loader'],
use: [
'html-loader',
{
loader: 'sxml-loader',
/*
options: {
interpreter: 'guile',
flags: ['-c'],
expr: '(use-modules (sxml simple))(sxml->xml SXML_LOADER_CONTENT)',
},
*/
},
],
},
],
},

Loading…
Cancel
Save