docbook.org/xsl (#3418)

* new file:   projects/docbook.org/xsl/package.yml
new file:   projects/docbook.org/xsl/test.xml

* both need unzip

---------

Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
Andrew 2023-09-25 16:13:00 +03:00 committed by GitHub
parent cd3cb5879b
commit 49ce9ce319
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,38 @@
distributable:
url: https://github.com/docbook/xslt10-stylesheets/releases/download/release/{{version}}/docbook-xsl-{{version}}.zip
strip-components: 1
display-name: docbook-xsl
versions:
url: https://cdn.docbook.org/release/xsl/
match: /\d+\.\d+\.\d+/
entrypoint: tea $DOCBOOK_XSL_ROOT="{{prefix}}" ./entrypoint.sh
dependencies:
docbook.org: ^5
gnome.org/libxml2: '*'
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
gnu.org/wget: '*'
info-zip.org/unzip: '*'
script:
- run: mkdir -p libexec share/doc
working-directory: "{{prefix}}"
- cp -r docbook-xsl-{{version}} {{prefix}}/libexec/docbook-xsl
- wget $RES_NS && unzip docbook-xsl-nons-{{version}}.zip
- cp -r docbook-xsl-nons-{{version}} {{prefix}}/libexec/docbook-xsl-ns
- wget $RES_DOC && unzip docbook-xsl-doc-{{version}}.zip
- cp -r docbook-xsl-{{version}}/doc {{prefix}}/share/doc/reference
- run: ln -s ../libexec/docbook-xsl/epub/bin/dbtoepub dbtoepub
working-directory: "{{prefix}}/bin"
env:
RES_NS: https://github.com/docbook/xslt10-stylesheets/releases/download/release/{{version}}/docbook-xsl-nons-{{version}}.zip
RES_DOC: https://github.com/docbook/xslt10-stylesheets/releases/download/release/{{version}}/docbook-xsl-doc-{{version}}.zip
provides:
- bin/dbtoepub
test:
dependencies:
gnome.org/libxslt: '*'
script:
- xsltproc {{prefix}}/libexec/docbook-xsl/html/docbook.xsl test.xml > test.html
- cat test.html | grep "text/html"

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<article>
<title>Test Article</title>
<section>
<title>TEA</title>
<para>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</para>
</section>
<section>
<title>XYZ</title>
<para>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</para>
</section>
</article>