Thank you for you the quick and competent reply. xinclude is workable,
but it's very verbose (if one is not using XMLmind XML Editor).
It also would nice to be able to inject from the commandline things like
a version number. Similar to the current concept of injecting profiling
parameters using the -p switch.
Hussein Shafie wrote on 15/11/2019 7:53 PM:
On 11/15/2019 08:15 AM, [email protected] wrote:
I just came across ebookc and found it to be a fantastic tool. Very fast
and reasonably powerful.
I have been working with many documentation generators, namely the
AsciiDoc - DocBook - fop tool-chain and also recently Dita-OS. The
possibility to use plain HTML and markdown for authoring is why I like
to change to ebookc.
Does ebookc support in some form or shape the concept of placeholders or
variables?
Yes, because ebookc natively supports XInclude
(https://www.w3.org/TR/xinclude-11/).
Here's how this is done:
(A) Add all your variables to a separate (X)HTML5 file. For example,
let's call this file "my_vars.html":
---
<!DOCTYPE html>
<html class="role-ebook-page" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>My variables</title>
</head>
<body><ul>
<li><b id="prodname">ACME Widget Set</b>, the product name.</li>
<li><span id="prodversion">2.1.1</span>, the product version.</li>
</ul></body>
</html>
---
(B) In an actual (X)HTML5 page of your Ebook, "xinclude variables" as
follows:
---
<p>As of
<xi:include href="my_vars.html" xpointer="prodname"
xmlns:xi="http://www.w3.org/2001/XInclude" /> version
<xi:include href="my_vars.html" xpointer="prodversion"
xmlns:xi="http://www.w3.org/2001/XInclude" />, you can extend the widget
set using...</p>
---
<Shameless_Plug>
It is indeed tedious to type <xi:include/> elements by hand but using
the Include tool of XMLmind XML Editor, this task becomes quick, easy
and safe.
See tutorial
"Inserting boilerplate content",
https://www.xmlmind.com/xmleditor/_tutorial/insert_boilerplate/index.html
with screencast
https://www.xmlmind.com/xmleditor/_tutorial/insert_boilerplate/video/insert_boilerplate.html
XMLmind XML Editor Personal Edition is free to use by many persons and
organizations.
</Shameless_Plug>
Basically I like to inject to the compilations process things like
product names, version numbers etc.
--
XMLmind Ebook Compiler Support List
[email protected]
https://www.xmlmind.com/mailman/listinfo/ebookc-support