On 16/02/12 01:46, Dag Wieers wrote:
On Wed, 15 Feb 2012, Stuart Rackham wrote:

8<--------
$ diff -u odt.conf.ORIG odt.conf
--- odt.conf.ORIG 2012-02-15 14:07:04.653207662 +1300
+++ odt.conf 2012-02-15 14:30:17.041753779 +1300
@@ -740,8 +740,7 @@
</office:event-listeners>
</office:scripts>

-include1::{theme%}{backenddir={asciidoc-confdir}/backends/{backend}}/asciidoc.odt.styles[]

-include1::{themedir}/{theme}.odt.styles[]
+include1::./{theme=asciidoc}.odt.styles[]
endif::not_flat_odf[]

<!-- body -->

8<--------

So now you can bundle any built-in .styles files with the backend plugin. The
only problem is that if you use the asciidoc --theme option you get a harmless
warning e.g.

$ asciidoc -b odt --theme cv t.txt
asciidoc: WARNING: missing theme: cv

Maybe asciidoc should suppress the warning for external backends.

Now that I have tested it, I understand that it actually requires all themes to
be in the backend directory, which is undesirable (unless we would reorganize
how themes work).

So for the time being I modified that line to say:

include1::{theme?{themedir}/}{theme=asciidoc}.odt.styles[]

which is still much better than it was initially (if only because it supports
backends in both home-directories as well as /etc/asciidoc).

Before you would reorganize how themes work, I would like to have a more
structured discussion, because I am not convinced of the merits.


As I understand it (and I'm not 100% sure I do), ODF outputs can be styled using a .styles file (for generating .fodt files using asciidoc) or an .odt/.ott file (for generating .odt files using a2x).

1. The default asciidoc.odt.styles file is in the from the odt plugin directory.

2. *.styles "theme" files are installed from theme plugin directories.

3. An odt/ott template document which is specified explicitly with the a2x-backend.py --base_doc=path command option.

@Lex: would --template be more descriptive option name than --base_doc ?

My guess is that very few users will want to deal with .fodt files directly, preferring .odt files instead i.e. a2x will be used in preference to asciidoc.

Taking up Lex's point, I think the vast majority of users would want to style with ott templates and not .styles files. The ability to style using interactively generated ott files was the raison d'ĂȘtre for an ODF backend in the first place.

So why complicate things with .styles themes plugins? Instead ship any built-in .styles files with the odt plugin and make an asciidoc '-a odf-styles=path' attribute available for those users who want to use their own .styles files.


Cheers, Stuart

--
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to