1:- use_package(pillow). 2:- use_module(library(streams)). 3 4main :- 5 icon_address(dot,Dot), 6 open_output('html_demo.html', IO), 7 output_html([ 8 start, 9 comment("This document was generated from Prolog"), 10 title('Sample HTML document generated from Prolog'), 11 h1('Sample HTML document'), 12 --, 13 h2('Miscellaneous'), 14 "This is a ",ref('#label',it(reference))," to ", 15 bf(["another ",it(point)])," in this document.",$, 16 'Let''s be ', 17 image('http://localhost/images/smile.happy.gif',[alt=':-)']), 18 '!', 19 preformatted(['These lines', 20 ['are ',b(preformatted),'.'], 21 'See?']), 22 'We have left here a ',strong(free),' variable:',X,$, 23 'This is in verbatim: ', 24 samp(verbatim('<NOTE> write "&" to insert an &')),\\, 25 'But this is not:', 26 samp('<NOTE> write "&" to insert an &'),$, 27 label(label,['This is the point referenced ',it('above.')]), 28 h2("Lists"), 29 h3(tt(itemize)), 30 itemize([one,two,['and ','3']]), 31 h3(tt(enumerate)), 32 enumerate([b(red),i(green),tt(blue)]), 33 h3(tt(description)), 34 description([ 35 (one,b(two),'Description of one and two'), 36 (three,'Idem of three'), 37 ['This ',b(also)]]), 38 h3('Nice itemize'), 39 nice_itemize(Dot,['Pretty',bf('Fancy'),'Nice']), 40 --, 41 ref('mailto:clip@dia.fi.upm.es',address('clip@dia.fi.upm.es')), 42 end 43 ]), 44 close_output(IO). 45 46