01:09
<TabAtkins>
MikeSmith: Yo, random https fail. When I link to https://dev.w3.org/csswg/default.css, it spins for 20s or so and then just fails.
12:02
<MikeSmith>
TabAtkins: Yeah some problem there but I don't know what
12:03
<MikeSmith>
will investigate
15:53
<SteveF>
Hixie: FYI have started work on Differences between the W3C HTML 5.1 specification and the WHATWG LS www.w3.org/wiki/HTML/W3C-WHATWG-Differences - style based on your differences documentation
18:23
<aleray>
Hi, I'm looking for advices to write a Writer using html5lib python
18:23
<aleray>
I want to transform my tree into some context code (latex-lile macro package for TeX)
18:29
<gsnedders>
aleray: I don't follow. A "Writer"? And you want to convert the tree from HTML to TeX?
18:29
<aleray>
yes
18:29
<aleray>
gsnedders,
18:29
<aleray>
I want to convert my html tree to TeX
18:30
<aleray>
specifically to context. The only tool I know to do this is written in haskell, and it is very slow to call it 100 of times using subprocess
18:30
<gsnedders>
Right, okay, then html5lib will do pretty much nothing for you. You just need to take the tree it gives you — with whatever tree builder you're using — a convert that to TeX.
18:30
<gsnedders>
If that makes sense.
18:31
<aleray>
gsnedders, ok. Any other general documentation I could look at to write such a tool?
18:32
<gsnedders>
aleray: I don't know enough about context to help, really. :)
18:32
<aleray>
gsnedders, or an example that converts html to plain text for instance?
18:34
<gsnedders>
aleray: I guess the other important thing is I presume you're planning on just putting in line breaks for p elements, for example, and not trying to do anything fancy with CSS and obeying display: none and the like?
18:36
<aleray>
gsnedders, nothing fancy my set of authorized tags is pretty limited
18:38
<gsnedders>
aleray: The only thing in html5lib that might help is the treewalkers, which provides a normalized view of the tree as a sequence of StartTag, Text nodes, EndTag, etc.
18:38
<gsnedders>
aleray: And then on a p endtag output whitespace, and stuff like that.
18:39
<aleray>
gsnedders, that sound useful thanks
18:40
<gsnedders>
aleray: Note that in browsers p elements have whitespace before *and* after, and rely on CSS margin collapsing to avoid doubling whitespace.
18:40
<gsnedders>
aleray: Given in TeX 4 lines of whitespace is the same as 2, you may as well follow that.
18:40
<gsnedders>
(And let it collapse, unless you care about the format of the file)
18:40
<gsnedders>
(in which case you can add in extra logic to not output whitespace if it already ends in whitespace, or something)