From: Lady Date: Sat, 6 Jan 2024 03:59:15 +0000 (-0500) Subject: Add <书社:apply-attributes> transformation X-Git-Tag: 0.2.3~3 X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/023ca463e9644ebe5ceac3c15d73607583da00e5?ds=inline Add <书社:apply-attributes> transformation The behaviour of `transforms/asset.xslt` is useful, but limited in that the H·T·M·L elements it creates don’t have any attributes beyond `@src`. `<书社:apply-attributes>` fixes this by allowing attributes to be declared in a parent element which wraps the `<书社:link>`. --- diff --git a/README.markdown b/README.markdown index 13cb1d6..cafda3a 100644 --- a/README.markdown +++ b/README.markdown @@ -283,6 +283,14 @@ Transforms are used to convert X·M·L files into their final output, after all necessary parsing and embedding has taken place. ⛩️📰 书社 comes with some transforms; namely :⁠— +- **`transforms/attributes.xslt`:** + Applies transforms to the children of any `<书社:apply-attributes>` + elements, and then applies the attributes of the + `<书社:apply-attributes>` to each result child, replacing the + element with the result. + This is useful in combination with image embeds to apply alt‐text to + the resulting ``. + - **`transforms/asset.xslt`:** Converts `` elements which correspond to recognized media types into the appropriate H·T·M·L elements, and deletes diff --git a/transforms/attributes.xslt b/transforms/attributes.xslt new file mode 100644 index 0000000..e91e7cb --- /dev/null +++ b/transforms/attributes.xslt @@ -0,0 +1,41 @@ + + + + <书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:attributes.xslt + +