# --------------------------------------------------------------------# The ElementTree toolkit is# Copyright (c) 1999-2004 by Fredrik Lundh# --------------------------------------------------------------------"""A set of HTML generator tags for building HTML documents.Usage:: >>> from lxml.html.builder import * >>> html = HTML( ... HEAD( TITLE("Hello World") ), ... BODY( CLASS("main"), ... H1("Hello World !") ... ) ... ) >>> import lxml.etree >>> print lxml.etree.tostring(html, pretty_print=True) <html> <head> <title>Hello World</title> </head> <body class="main"> <h1>Hello World !</h1> </body> </html>"""fromlxml.builderimportElementMakerfromlxml.htmlimporthtml_parserE=ElementMaker(makeelement=html_parser.makeelement)# elementsA=E.a#: anchorABBR=E.abbr#: abbreviated form (e.g., WWW, HTTP, etc.)ACRONYM=E.acronym#: ADDRESS=E.address#: information on authorAPPLET=E.applet#: Java applet (DEPRECATED)AREA=E.area#: client-side image map areaARTICLE=E.article#: self-contained articleASIDE=E.aside#: indirectly-related contentAUDIO=E.audio#: embedded audio fileB=E.b#: bold text styleBASE=E.base#: document base URIBASEFONT=E.basefont#: base font size (DEPRECATED)BDI=E.bdi#: isolate bidirectional textBDO=E.bdo#: I18N BiDi over-rideBIG=E.big#: large text styleBLOCKQUOTE=E.blockquote#: long quotationBODY=E.body#: document bodyBR=E.br#: forced line breakBUTTON=E.button#: push buttonCANVAS=E.canvas#: scriptable graphics containerCAPTION=E.caption#: table captionCENTER=E.center#: shorthand for DIV align=center (DEPRECATED)CITE=E.cite#: citationCODE=E.code#: computer code fragmentCOL=E.col#: table columnCOLGROUP=E.colgroup#: table column groupDATA=E.data#: machine-readable translationDATALIST=E.datalist#: list of options for an inputDD=E.dd#: definition descriptionDEL=getattr(E,'del')#: deleted textDETAILS=E.details#: expandable sectionDFN=E.dfn#: instance definitionDIALOG=E.dialog#: dialog boxDIR=E.dir#: directory list (DEPRECATED)DIV=E.div#: generic language/style containerDL=E.dl#: definition listDT=E.dt#: definition termEM=E.em#: emphasisEMBED=E.embed#: embedded external contentFIELDSET=E.fieldset#: form control groupFIGCAPTION=E.figcaption#: figure captionFIGURE=E.figure#: self-contained, possibly-captioned contentFONT=E.font#: local change to font (DEPRECATED)FOOTER=E.footer#: footer for nearest ancestorFORM=E.form#: interactive formFRAME=E.frame#: subwindowFRAMESET=E.frameset#: window subdivisionH1=E.h1#: headingH2=E.h2#: headingH3=E.h3#: headingH4=E.h4#: headingH5=E.h5#: headingH6=E.h6#: headingHEAD=E.head#: document headHEADER=E.header#: heading contentHGROUP=E.hgroup#: heading groupHR=E.hr#: horizontal ruleHTML=E.html#: document root elementI=E.i#: italic text styleIFRAME=E.iframe#: inline subwindowIMG=E.img#: Embedded imageINPUT=E.input#: form controlINS=E.ins#: inserted textISINDEX=E.isindex#: single line prompt (DEPRECATED)KBD=E.kbd#: text to be entered by the userLABEL=E.label#: form field label textLEGEND=E.legend#: fieldset legendLI=E.li#: list itemLINK=E.link#: a media-independent linkMAIN=E.main#: main contentMAP=E.map#: client-side image mapMARK=E.mark#: marked/highlighted textMARQUEE=E.marquee#: scrolling textMENU=E.menu#: menu list (DEPRECATED)META=E.meta#: generic metainformationMETER=E.meter#: numerical value displayNAV=E.nav#: navigation sectionNOBR=E.nobr#: prevent wrappingNOFRAMES=E.noframes#: alternate content container for non frame-based renderingNOSCRIPT=E.noscript#: alternate content container for non script-based renderingOBJECT=E.object#: generic embedded objectOL=E.ol#: ordered listOPTGROUP=E.optgroup#: option groupOPTION=E.option#: selectable choiceOUTPUT=E.output#: result of a calculationP=E.p#: paragraphPARAM=E.param#: named property valuePICTURE=E.picture#: picture with multiple sourcesPORTAL=E.portal#: embedded previewPRE=E.pre#: preformatted textPROGRESS=E.progress#: progress barQ=E.q#: short inline quotationRB=E.rb#: ruby base textRP=E.rp#: ruby parenthesesRT=E.rt#: ruby text componentRTC=E.rtc#: ruby semantic annotationRUBY=E.ruby#: ruby annotationsS=E.s#: strike-through text style (DEPRECATED)SAMP=E.samp#: sample program output, scripts, etc.SCRIPT=E.script#: script statementsSEARCH=E.search#: set of form controls for a searchSECTION=E.section#: generic standalone sectionSELECT=E.select#: option selectorSLOT=E.slot#: placeholder for JS useSMALL=E.small#: small text styleSOURCE=E.source#: source for picture/audio/video elementSPAN=E.span#: generic language/style containerSTRIKE=E.strike#: strike-through text (DEPRECATED)STRONG=E.strong#: strong emphasisSTYLE=E.style#: style infoSUB=E.sub#: subscriptSUMMARY=E.summary#: summary for <details>SUP=E.sup#: superscriptTABLE=E.table#: TBODY=E.tbody#: table bodyTD=E.td#: table data cellTEMPLATE=E.template#: fragment for JS useTEXTAREA=E.textarea#: multi-line text fieldTFOOT=E.tfoot#: table footerTH=E.th#: table header cellTHEAD=E.thead#: table headerTIME=E.time#: date/timeTITLE=E.title#: document titleTR=E.tr#: table rowTRACK=E.track#: audio/video trackTT=E.tt#: teletype or monospaced text styleU=E.u#: underlined text style (DEPRECATED)UL=E.ul#: unordered listVAR=E.var#: instance of a variable or program argumentVIDEO=E.video#: embedded video fileWBR=E.wbr#: word break# attributes (only reserved words are included here)ATTR=dict