On Tue, 09 Jul 2013 08:42:13 -0400 Richard Heck <[email protected]> wrote:
> On 07/08/2013 09:52 PM, Steve Litt wrote: > > Hi all, > > > > I'm making a postprocessor to make the output of LyX's LyXHTML > > xhtml export more compatible with ePub. Before I code my > > postprocessor, I'd like to know the design intent of the LyXHTML > > exporter, so I don't accidentally throw away a good thing. > > > > First, I notice every container start tag is followed by an anchor > > with an id like "magicparlabel-1140", like this: > > > > <div class="standard"><a id='magicparlabel-1140' /> > > > > 1) What was the reason you gave an <a> to every container? > > This is so things like links to references are guaranteed to work. Cool. I'll let my filter leave them as-is. > > > 2) Why did you use an <a> instead of > > <div class="standard" id='magicparlabel-1140'> > > At the time this was written, there were too many browsers still > active that did not fully support links to id tags on other elements. > Now that they do, this has been changed for 2.1.x. The id is on the > main element. Cool. I'll make a subroutine or other modular thing that takes the <a> element following the <h?>, slightly modifies its id, and places that id in the <h?> element itself. I'll make this module happen or not happen based on whether the LyX native XHTML export gives id properties to the <h?> elements themselves, so it should work with either version. > > > 3) Why did you use doublequotes in the class, but singlequotes in > > the <a> id? > > No idea. Just one of those things. For all I know, it is different in > 2.1. Probably no harm, so I'll just pass it through as is. > > > I have some questions about your mapping in xhtml exports of > > sectional type environments to <h1>-<h6>. On the conversion of my > > book, Part and Chapter both map to <h1>, with Section mapping to > > <h2>, Subsection to <h3>, and so on. Did you do that so you > > wouldn't run past <h6>? If not, what was the reason? > > Part is not that commonly used. It seemed wrong to make chapters > h2 by default. As we've discussed previously, this can be changed > using layouts. I was unable to do the changes in layouts, but my filter contains a LyX environment to <h?> mapping, so it's all good. > > > Thank you, thank you, THANK YOU for, in your xhtml conversion, > > passing through every single environment and character style I used > > in my book, and making CSS styles for them. That's a class act, and > > the single most important thing in converting to ePub. > > In a way, the idea behind the XHTML output (again, this is not eLyXer) > is (a) to respect what is in the layout files, so you don't have to > write a lot of duplicate code and (b) to mimic what is on the screen, > generally speaking. So if you define a character style, then, by > default, we create CSS to mimic how it looks on screen. If you want > to output something else, then that can easily be done in the layout > file, as well. It's good to know your design intent on that. Thanks, SteveT Steve Litt * http://www.troubleshooters.com/ Troubleshooting Training * Human Performance
