Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gfldex/perl6-xhtml-writer
Generate XHTML1.1 with subs (many, many subs)
https://github.com/gfldex/perl6-xhtml-writer
Last synced: 13 days ago
JSON representation
Generate XHTML1.1 with subs (many, many subs)
- Host: GitHub
- URL: https://github.com/gfldex/perl6-xhtml-writer
- Owner: gfldex
- License: artistic-2.0
- Created: 2016-01-08T14:46:40.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-09-26T11:15:02.000Z (over 4 years ago)
- Last Synced: 2024-11-06T05:44:07.695Z (2 months ago)
- Language: Raku
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XHTML::Writer
[![Build Status](https://travis-ci.org/gfldex/perl6-xhtml-writer.svg?branch=master)](https://travis-ci.org/gfldex/perl6-xhtml-writer)Write xhtml elements utilising named arguments to guard against typos. Colons in
names of XHTML attributes are replaced with a hyphen (e.g. `xml:lang`). Use the the html element names
as an import tag or `:ALL` to get them all. Please note that there is a `dd`-tag what will
overwrite `dd` from the settings.The actual module is generated form the official XHTML 1.1 Schema. There is no offical
XML Schema for HTML5 (because it isn't XML), if you happen to come a cross one that works
please let me know.## Usage:
```
use v6;
use XHTML::Writer :ALL;put html( xml-lang=>'de',
body(
div( id=>"uniq",
p( class=>"abc", 'your text here'),
p( 'more text' )
)
));
```With skeleton:
```
use v6;
use XHTML::Writer :p, :title;
use XHTML::Skeleton;put xhtml-skeleton(p('Hello Camelia!'), header=>title('Hello Camelia'));
```## Enable indentation
```
use Typesafe::XHTML::Writer :writer-shall-indent; # :ALL will work too
writer-shall-indent True;
```## License
(c) Wenzel P. P. Peppmeyer, Released under Artistic License 2.0.