diff --git a/README.md b/README.md index bfd1a73..10bfd47 100644 --- a/README.md +++ b/README.md @@ -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)', }, }, diff --git a/example/src/index.sxml b/example/src/index.sxml index 576f853..310561e 100644 --- a/example/src/index.sxml +++ b/example/src/index.sxml @@ -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))))) diff --git a/example/webpack.config.js b/example/webpack.config.js index 85bfc3e..fd5a0e3 100644 --- a/example/webpack.config.js +++ b/example/webpack.config.js @@ -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)', + }, + */ + }, + ], }, ], },