Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/lxml/html/builder.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
| author | shellac |
|---|---|
| date | Mon, 22 Mar 2021 18:12:50 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4f3585e2f14b |
|---|---|
| 1 # -------------------------------------------------------------------- | |
| 2 # The ElementTree toolkit is | |
| 3 # Copyright (c) 1999-2004 by Fredrik Lundh | |
| 4 # -------------------------------------------------------------------- | |
| 5 | |
| 6 """ | |
| 7 A set of HTML generator tags for building HTML documents. | |
| 8 | |
| 9 Usage:: | |
| 10 | |
| 11 >>> from lxml.html.builder import * | |
| 12 >>> html = HTML( | |
| 13 ... HEAD( TITLE("Hello World") ), | |
| 14 ... BODY( CLASS("main"), | |
| 15 ... H1("Hello World !") | |
| 16 ... ) | |
| 17 ... ) | |
| 18 | |
| 19 >>> import lxml.etree | |
| 20 >>> print lxml.etree.tostring(html, pretty_print=True) | |
| 21 <html> | |
| 22 <head> | |
| 23 <title>Hello World</title> | |
| 24 </head> | |
| 25 <body class="main"> | |
| 26 <h1>Hello World !</h1> | |
| 27 </body> | |
| 28 </html> | |
| 29 | |
| 30 """ | |
| 31 | |
| 32 from lxml.builder import ElementMaker | |
| 33 from lxml.html import html_parser | |
| 34 | |
| 35 E = ElementMaker(makeelement=html_parser.makeelement) | |
| 36 | |
| 37 # elements | |
| 38 A = E.a #: anchor | |
| 39 ABBR = E.abbr #: abbreviated form (e.g., WWW, HTTP, etc.) | |
| 40 ACRONYM = E.acronym #: | |
| 41 ADDRESS = E.address #: information on author | |
| 42 APPLET = E.applet #: Java applet (DEPRECATED) | |
| 43 AREA = E.area #: client-side image map area | |
| 44 B = E.b #: bold text style | |
| 45 BASE = E.base #: document base URI | |
| 46 BASEFONT = E.basefont #: base font size (DEPRECATED) | |
| 47 BDO = E.bdo #: I18N BiDi over-ride | |
| 48 BIG = E.big #: large text style | |
| 49 BLOCKQUOTE = E.blockquote #: long quotation | |
| 50 BODY = E.body #: document body | |
| 51 BR = E.br #: forced line break | |
| 52 BUTTON = E.button #: push button | |
| 53 CAPTION = E.caption #: table caption | |
| 54 CENTER = E.center #: shorthand for DIV align=center (DEPRECATED) | |
| 55 CITE = E.cite #: citation | |
| 56 CODE = E.code #: computer code fragment | |
| 57 COL = E.col #: table column | |
| 58 COLGROUP = E.colgroup #: table column group | |
| 59 DD = E.dd #: definition description | |
| 60 DEL = getattr(E, 'del') #: deleted text | |
| 61 DFN = E.dfn #: instance definition | |
| 62 DIR = E.dir #: directory list (DEPRECATED) | |
| 63 DIV = E.div #: generic language/style container | |
| 64 DL = E.dl #: definition list | |
| 65 DT = E.dt #: definition term | |
| 66 EM = E.em #: emphasis | |
| 67 FIELDSET = E.fieldset #: form control group | |
| 68 FONT = E.font #: local change to font (DEPRECATED) | |
| 69 FORM = E.form #: interactive form | |
| 70 FRAME = E.frame #: subwindow | |
| 71 FRAMESET = E.frameset #: window subdivision | |
| 72 H1 = E.h1 #: heading | |
| 73 H2 = E.h2 #: heading | |
| 74 H3 = E.h3 #: heading | |
| 75 H4 = E.h4 #: heading | |
| 76 H5 = E.h5 #: heading | |
| 77 H6 = E.h6 #: heading | |
| 78 HEAD = E.head #: document head | |
| 79 HR = E.hr #: horizontal rule | |
| 80 HTML = E.html #: document root element | |
| 81 I = E.i #: italic text style | |
| 82 IFRAME = E.iframe #: inline subwindow | |
| 83 IMG = E.img #: Embedded image | |
| 84 INPUT = E.input #: form control | |
| 85 INS = E.ins #: inserted text | |
| 86 ISINDEX = E.isindex #: single line prompt (DEPRECATED) | |
| 87 KBD = E.kbd #: text to be entered by the user | |
| 88 LABEL = E.label #: form field label text | |
| 89 LEGEND = E.legend #: fieldset legend | |
| 90 LI = E.li #: list item | |
| 91 LINK = E.link #: a media-independent link | |
| 92 MAP = E.map #: client-side image map | |
| 93 MENU = E.menu #: menu list (DEPRECATED) | |
| 94 META = E.meta #: generic metainformation | |
| 95 NOFRAMES = E.noframes #: alternate content container for non frame-based rendering | |
| 96 NOSCRIPT = E.noscript #: alternate content container for non script-based rendering | |
| 97 OBJECT = E.object #: generic embedded object | |
| 98 OL = E.ol #: ordered list | |
| 99 OPTGROUP = E.optgroup #: option group | |
| 100 OPTION = E.option #: selectable choice | |
| 101 P = E.p #: paragraph | |
| 102 PARAM = E.param #: named property value | |
| 103 PRE = E.pre #: preformatted text | |
| 104 Q = E.q #: short inline quotation | |
| 105 S = E.s #: strike-through text style (DEPRECATED) | |
| 106 SAMP = E.samp #: sample program output, scripts, etc. | |
| 107 SCRIPT = E.script #: script statements | |
| 108 SELECT = E.select #: option selector | |
| 109 SMALL = E.small #: small text style | |
| 110 SPAN = E.span #: generic language/style container | |
| 111 STRIKE = E.strike #: strike-through text (DEPRECATED) | |
| 112 STRONG = E.strong #: strong emphasis | |
| 113 STYLE = E.style #: style info | |
| 114 SUB = E.sub #: subscript | |
| 115 SUP = E.sup #: superscript | |
| 116 TABLE = E.table #: | |
| 117 TBODY = E.tbody #: table body | |
| 118 TD = E.td #: table data cell | |
| 119 TEXTAREA = E.textarea #: multi-line text field | |
| 120 TFOOT = E.tfoot #: table footer | |
| 121 TH = E.th #: table header cell | |
| 122 THEAD = E.thead #: table header | |
| 123 TITLE = E.title #: document title | |
| 124 TR = E.tr #: table row | |
| 125 TT = E.tt #: teletype or monospaced text style | |
| 126 U = E.u #: underlined text style (DEPRECATED) | |
| 127 UL = E.ul #: unordered list | |
| 128 VAR = E.var #: instance of a variable or program argument | |
| 129 | |
| 130 # attributes (only reserved words are included here) | |
| 131 ATTR = dict | |
| 132 def CLASS(v): return {'class': v} | |
| 133 def FOR(v): return {'for': v} |
