I m p r o v i n g t h e X H T M L e x p o r t f i l t e r A n d m e n t o r i n g s t u d e n t s t h r o u g h p a t c h e s a n d l i c e n s e s Andrea Pescetti pescetti@apache.org
An Obscure Little Feature An Obscure Little Feature An Obscure Little Feature An Obscure Little Feature Paolo Morelli:
A n I n t e r e s t i n g S t o r y • A little feature • Students • Forks • Licenses
T h e X H T M L E x p o r t • One of many export filters • File Export XHTML → → • Not the HTML export!
E x p o r t i n g t o X H T M L • Available in all modules, but focusing on Impress here. • Produces one .html file, not a slide-by-slide gallery. • Code: main/filter/source/xslt
H a b i b ' s W o r k • Improvements by Habib Louafi, a PhD student in Canada. • Extends the XHTML filter with features that make it mature. • Published in May 2013 (Louafi-Coulombe).
H a b i b ' s C o d e • Full diff: 6666 lines. • Based on versions 2.4 (2008) and 3.1 (2009). • Contributed under Apache License v2 in June 2013: #i122494#
New Features New Features New Features New Features Paolo Morelli:
I m p r o v i n g F o n t s • Fonts used to be replaced by the browser's default font. • style_collector.xsl collects styles, style_mapping_css.xsl converts them to CSS. • Now fixed: font is preserved.
I m p r o v i n g L a y o u t • Text boxes in a slide used to be exported sequentially in XHTML. • All layout lost (body.xsl) • Now properly placed with coordinates and CSS.
I m p r o v i n g I m a g e s • Images used to be converted to base64 and rendered as data streams embedded in XHTML. • Problems with some browsers. • Now solved: the “Link” option is used to preserve image.
I m p r o v i n g S h a p e s • Shapes used to be ignored. • Now converted using the JavaScript Vector Graphics Library by Walter Zorn. • Support for rectangles, circles, ellipses, lines.
I m p r o v i n g S c a l i n g • The export did not support scaling. • Scaling parameter added to resize the output (for mobile). • Done by calling ImageMagick from a Java-based application.
B e f o r e a n d A f t e r ( b y H a b i b ) • Fonts • Layout • Images • Shapes • Scaling
O r i g i n a l F i l e
B e f o r e
A f t e r
Integration and difficulties Integration and difficulties Integration and difficulties Integration and difficulties Paolo Morelli:
F o u r Y e a r s A r e L o n g • Habib's code cannot be used immediately. • Code in both OpenOffice and LibreOffice has evolved, entire directories were reorganized. • Need to refactor the patch.
W h e r e ' s t h e X H T M L E x p o r t ? • On Windows, XHTML export is not installed by default. • Decision taken (undocumented) before 3.3.0: #i119663# • Need to enable it with a custom installation.
D e p e n d e n c y I s s u e s • Habib's approach includes in full the late (to the best of our knowledge) Walter Zorn's JavaScript library. • LGPL 2.1+, Apache Category B. • Good case for Apache Legal.
C u r r e n t S t a t u s • Vadim Yedzinovich, a new contributor, is being mentored to work on this. • Patch aligned and being sliced in several components. • First fixes to appear in 4.1.
F u t u r e D e v e l o p m e n t s • Repurpose the XHTML export to an HTML5 export. • Scaling: CSS3's transform. • Shapes: HTML5's <canvas> and no JavaScript. • Volunteers welcome!
T h a n k s f o r a t t e n t i o n Andrea Pescetti pescetti@apache.org www.openoffice.org Image credits: Flickr, PLIO Archives.
Recommend
More recommend