Am 24.07.2018 um 23:27 schrieb Allin Cottrell:
OK, kinda lame question. Seems that getting a gfn file to display
nicely in a browser should just be a matter of writing an appropriate
xsl file that translates the elements of the gfn into suitable HTML,
and referencing the xsl file in the gfn (or maybe just applying it via
the web server?).
If anyone wants to have a go at that, please do. But I have some
experience writing xsl and could pick it up at some point if nobody
intervenes.
Good idea. Attached is a first attempt which seems to do the job on a
basic level. I tested with the following processor:
<python>
import lxml.html
from lxml import etree
xslt_doc = etree.parse("stylesheet4gfns.xlst")
xslt_transformer = etree.XSLT(xslt_doc)
source_doc = etree.parse("yahoo_get.gfn")
output_doc = xslt_transformer(source_doc)
print(str(output_doc))
output_doc.write("output-gfn.html")
</python>
The stylesheet is a bit of a hack, because the line breaks of the help
text are preserved by brute force using the <pre> tag in HTML. But I'd
say the result is better than nothing and good enough for now.
cheers,
sven