€cdocutils.nodes
document
q)q}q(U nametypesq}q(X describing html snippetsqNX
html-snippetsqKuUsubstitution_defsq}q Uparse_messagesq
]qUcurrent_sourceqNU
decorationq
NUautofootnote_startqKUnameidsq}q(hUdescribing-html-snippetsqhU
html-snippetsquUchildrenq]q(cdocutils.nodes
target
q)q}q(U rawsourceqX .. _html-snippets:qUparentqhUsourceqcdocutils.nodes
reprunicode
qXW /Data/Code/JavaScript/MathJax/Code/SourceForge/trunk/mathjax/docs/rst/HTML-snippets.rstq…q}qbUtagnameq Utargetq!U
attributesq"}q#(Uidsq$]q%Ubackrefsq&]q'Udupnamesq(]q)Uclassesq*]q+Unamesq,]q-Urefidq.huUlineq/KUdocumentq0hh]q1ubcdocutils.nodes
section
q2)q3}q4(hU hhhhUexpect_referenced_by_nameq5}q6hhsh Usectionq7h"}q8(h(]q9h*]q:h&]q;h$]q<(hheh,]q=(hheuh/Kh0hUexpect_referenced_by_idq>}q?hhsh]q@(cdocutils.nodes
title
qA)qB}qC(hX Describing HTML snippetsqDhh3hhh UtitleqEh"}qF(h(]qGh*]qHh&]qIh$]qJh,]qKuh/Kh0hh]qLcdocutils.nodes
Text
qMX Describing HTML snippetsqN…qO}qP(hhDhhBubaubcdocutils.nodes
paragraph
qQ)qR}qS(hX/ A number of MathJax configuration options allow you to specify an HTML
snippet using a JavaScript object. This lets you include HTML in your
configutation files even though they are not HTML files themselves.
The format is fairly simple, but flexible enough to let you represent
complicated HTML trees.qThh3hhh U paragraphqUh"}qV(h(]qWh*]qXh&]qYh$]qZh,]q[uh/Kh0hh]q\hMX/ A number of MathJax configuration options allow you to specify an HTML
snippet using a JavaScript object. This lets you include HTML in your
configutation files even though they are not HTML files themselves.
The format is fairly simple, but flexible enough to let you represent
complicated HTML trees.q]…q^}q_(hhThhRubaubhQ)q`}qa(hXò An HTML snippet is an array consisting of a series elements that formt
he HTML tree. Those elements are one of two things: either a string,
which represents text to be included in the snippet, or an array,
which represents an HTML tag to be included. In the latter case, the
array consists of three items: a string that is the tag name (e.g.,
"img"), an optional object that gives attributes for the tag (as
described below), and an optional HTML snippet array that gives the
contents of the tag.qbhh3hhh hUh"}qc(h(]qdh*]qeh&]qfh$]qgh,]qhuh/K
h0hh]qihMXò An HTML snippet is an array consisting of a series elements that formt
he HTML tree. Those elements are one of two things: either a string,
which represents text to be included in the snippet, or an array,
which represents an HTML tag to be included. In the latter case, the
array consists of three items: a string that is the tag name (e.g.,
"img"), an optional object that gives attributes for the tag (as
described below), and an optional HTML snippet array that gives the
contents of the tag.qj…qk}ql(hhbhh`ubaubhQ)qm}qn(hX™ When attributes are provided, they are given as `name:value` pairs,
with the `name` giving the attribute name, and `value` giving its
value. For exampleqohh3hhh hUh"}qp(h(]qqh*]qrh&]qsh$]qth,]quuh/Kh0hh]qv(hMX0 When attributes are provided, they are given as qw…qx}qy(hX0 When attributes are provided, they are given as qzhhmubcdocutils.nodes
title_reference
q{)q|}q}(hX `name:value`q~h"}q(h(]q€h*]qh&]q‚h$]qƒh,]q„uhhmh]q…hMX
name:valueq†…q‡}qˆ(hU hh|ubah Utitle_referenceq‰ubhMX pairs,
with the qŠ…q‹}qŒ(hX pairs,
with the qhhmubh{)qŽ}q(hX `name`qh"}q‘(h(]q’h*]q“h&]q”h$]q•h,]q–uhhmh]q—hMX nameq˜…q™}qš(hU hhŽubah h‰ubhMX giving the attribute name, and q›…qœ}q(hX giving the attribute name, and qžhhmubh{)qŸ}q (hX `value`q¡h"}q¢(h(]q£h*]q¤h&]q¥h$]q¦h,]q§uhhmh]q¨hMX valueq©…qª}q«(hU hhŸubah h‰ubhMX giving its
value. For exampleq¬…q}q®(hX giving its
value. For exampleq¯hhmubeubcdocutils.nodes
literal_block
q°)q±}q²(hX# [["img",{src:"/images/mypic.jpg"}]]q³hh3hhh U
literal_blockq´h"}qµ(Ulinenosq¶‰Ulanguageq·X
javascriptq¸U xml:spaceq¹Upreserveqºh$]q»h&]q¼h(]q½h*]q¾h,]q¿uh/Kh0hh]qÀhMX# [["img",{src:"/images/mypic.jpg"}]]qÁ…qÂ}qÃ(hU hh±ubaubhQ)qÄ}qÅ(hX‘ represents an HTML snippet that includes one element: an ``
`` tag
with ``src`` set to ``/images/mypic.jpg``. That is, this is
equivalent toqÆhh3hhh hUh"}qÇ(h(]qÈh*]qÉh&]qÊh$]qËh,]qÌuh/Kh0hh]qÍ(hMX9 represents an HTML snippet that includes one element: an qÎ…qÏ}qÐ(hX9 represents an HTML snippet that includes one element: an qÑhhÄubcdocutils.nodes
literal
qÒ)qÓ}qÔ(hX ``
``qÕh"}qÖ(h(]q×h*]qØh&]qÙh$]qÚh,]qÛuhhÄh]qÜhMX
qÝ…qÞ}qß(hU hhÓubah UliteralqàubhMX
tag
with qá…qâ}qã(hX
tag
with qähhÄubhÒ)qå}qæ(hX ``src``qçh"}qè(h(]qéh*]qêh&]qëh$]qìh,]qíuhhÄh]qîhMX srcqï…qð}qñ(hU hhåubah hàubhMX set to qò…qó}qô(hX set to qõhhÄubhÒ)qö}q÷(hX ``/images/mypic.jpg``qøh"}qù(h(]qúh*]qûh&]qüh$]qýh,]qþuhhÄh]qÿhMX /images/mypic.jpgr …r }r (hU hhöubah hàubhMX! . That is, this is
equivalent tor …r }r (hX! . That is, this is
equivalent tor hhÄubeubh°)r }r (hX
r hh3hhh h´h"}r
(h¶‰h·X htmlr h¹hºh$]r h&]r
h(]r h*]r h,]r uh/K%h0hh]r hMX
r …r }r (hU hj ubaubhQ)r }r (hX Note that the snippet has two sets of square brackets. The outermost
one is for the array that holds the snippet, and the innermost set is
because the first (and only) element in the snippet is a tag, not
text. Note that the code ``["img",{src:"/images/mypic.jpg"}]``
is invalid as an HTML snippet. It would represent a snippet that
starts with "img" as text in the snippet (not a tag), but the second
item is neither a string nor an array, and so is illegal. This is a
common mistake that should be avoided.r hh3hhh hUh"}r (h(]r h*]r h&]r h$]r h,]r uh/K&h0hh]r (hMXè Note that the snippet has two sets of square brackets. The outermost
one is for the array that holds the snippet, and the innermost set is
because the first (and only) element in the snippet is a tag, not
text. Note that the code r …r }r! (hXè Note that the snippet has two sets of square brackets. The outermost
one is for the array that holds the snippet, and the innermost set is
because the first (and only) element in the snippet is a tag, not
text. Note that the code r" hj ubhÒ)r# }r$ (hX% ``["img",{src:"/images/mypic.jpg"}]``r% h"}r& (h(]r' h*]r( h&]r) h$]r* h,]r+ uhj h]r, hMX! ["img",{src:"/images/mypic.jpg"}]r- …r. }r/ (hU hj# ubah hàubhMXó
is invalid as an HTML snippet. It would represent a snippet that
starts with "img" as text in the snippet (not a tag), but the second
item is neither a string nor an array, and so is illegal. This is a
common mistake that should be avoided.r0 …r1 }r2 (hXó
is invalid as an HTML snippet. It would represent a snippet that
starts with "img" as text in the snippet (not a tag), but the second
item is neither a string nor an array, and so is illegal. This is a
common mistake that should be avoided.r3 hj ubeubhQ)r4 }r5 (hX( A more complex example is the following:r6 hh3hhh hUh"}r7 (h(]r8 h*]r9 h&]r: h$]r; h,]r< uh/K/h0hh]r= hMX( A more complex example is the following:r> …r? }r@ (hj6 hj4 ubaubh°)rA }rB (hXo [
"Please read the ",
["a",{href:"instructions.html"},["instructions"]],
" carefully before proceeding"
]rC hh3hhh h´h"}rD (h¶‰h·X
javascriptrE h¹hºh$]rF h&]rG h(]rH h*]rI h,]rJ uh/K8h0hh]rK hMXo [
"Please read the ",
["a",{href:"instructions.html"},["instructions"]],
" carefully before proceeding"
]rL …rM }rN (hU hjA ubaubhQ)rO }rP (hX which is equivalent torQ hh3hhh hUh"}rR (h(]rS h*]rT h&]rU h$]rV h,]rW uh/K9h0hh]rX hMX which is equivalent torY …rZ }r[ (hjQ hjO ubaubh°)r\ }r] (hXY please read the instructions carefully
before proceeding.r^ hh3hhh h´h"}r_ (h¶‰h·X htmlr` h¹hºh$]ra h&]rb h(]rc h*]rd h,]re uh/K?h0hh]rf hMXY please read the instructions carefully
before proceeding.rg …rh }ri (hU hj\ ubaubhQ)rj }rk (hX? A final example shows how to set style attributes on an object:rl hh3hhh hUh"}rm (h(]rn h*]ro h&]rp h$]rq h,]rr uh/K@h0hh]rs hMX? A final example shows how to set style attributes on an object:rt …ru }rv (hjl hjj ubaubh°)rw }rx (hX| [["span",
{
id:"mySpan",
style: {color:"red", "font-weight":"bold"}
},
[" This is bold text shown in red "]
]]ry hh3hhh h´h"}rz (h¶‰h·X
javascriptr{ h¹hºh$]r| h&]r} h(]r~ h*]r h,]r€ uh/KKh0hh]r hMX| [["span",
{
id:"mySpan",
style: {color:"red", "font-weight":"bold"}
},
[" This is bold text shown in red "]
]]r‚ …rƒ }r„ (hU hjw ubaubhQ)r… }r† (hX which is equivalent tor‡ hh3hhh hUh"}rˆ (h(]r‰ h*]rŠ h&]r‹ h$]rŒ h,]r uh/KLh0hh]rŽ hMX which is equivalent tor …r }r‘ (hj‡ hj… ubaubh°)r’ }r“ (hX`
This is bold text shown in red
r” hh3hhh h´h"}r• (h¶‰h·X htmlr– h¹hºh$]r— h&]r˜ h(]r™ h*]rš h,]r› uh/KSh0hh]rœ hMX`
This is bold text shown in red
r …rž }rŸ (hU hj’ ubaubeubehU Utransformerr NU
footnote_refsr¡ }r¢ Urefnamesr£ }r¤ Usymbol_footnotesr¥ ]r¦ Uautofootnote_refsr§ ]r¨ Usymbol_footnote_refsr© ]rª U citationsr« ]r¬ h0hUcurrent_liner NUtransform_messagesr® ]r¯ cdocutils.nodes
system_message
r° )r± }r² (hU h"}r³ (h(]r´ Ulevelrµ Kh$]r¶ h&]r· Usourcer¸ hh*]r¹ h,]rº Uliner» KUtyper¼ UINFOr½ uh]r¾ hQ)r¿ }rÀ (hU h"}rÁ (h(]r h*]rà h&]rÄ h$]rÅ h,]rÆ uhj± h]rÇ hMX3 Hyperlink target "html-snippets" is not referenced.rÈ …rÉ }rÊ (hU hj¿ ubah hUubah Usystem_messagerË ubaUreporterrÌ NUid_startrÍ KU
autofootnotesrÎ ]rÏ U
citation_refsrÐ }rÑ Uindirect_targetsrÒ ]rÓ UsettingsrÔ (cdocutils.frontend
Values
rÕ orÖ }r× (Ufootnote_backlinksrØ KUrecord_dependenciesrÙ NUrfc_base_urlrÚ Uhttp://tools.ietf.org/html/rÛ U tracebackrÜ KUpep_referencesrÝ NUstrip_commentsrÞ NU
toc_backlinksrß Uentryrà U
language_coderá Uenrâ U datestamprã NUreport_levelrä KU_destinationrå NU
halt_levelræ KU
strip_classesrç NhENUerror_encoding_error_handlerrè Ubackslashreplaceré Udebugrê NUembed_stylesheetrë ‰Uoutput_encoding_error_handlerrì Ustrictrí U
sectnum_xformrî KUdump_transformsrï NU
docinfo_xformrð KUwarning_streamrñ NUpep_file_url_templaterò Upep-%04dró Uexit_status_levelrô KUconfigrõ NUstrict_visitorrö NUcloak_email_addressesr÷ ˆUtrim_footnote_reference_spacerø ‰Uenvrù NUdump_pseudo_xmlrú NUexpose_internalsrû NUsectsubtitle_xformrü ‰Usource_linkrý NUrfc_referencesrþ NUoutput_encodingrÿ Uutf-8r U
source_urlr NUinput_encodingr U utf-8-sigr U_disable_configr NU id_prefixr U U tab_widthr KUerror_encodingr UUTF-8r U_sourcer UW/Data/Code/JavaScript/MathJax/Code/SourceForge/trunk/mathjax/docs/rst/HTML-snippets.rstr
U generatorr NUdump_internalsr NUpep_base_urlr
Uhttp://www.python.org/dev/peps/r Uinput_encoding_error_handlerr jí Uauto_id_prefixr Uidr Udoctitle_xformr ‰Ustrip_elements_with_classesr NU
_config_filesr ]r Ufile_insertion_enabledr KUraw_enabledr KU
dump_settingsr NubUsymbol_footnote_startr K Uidsr }r (hh3hh3uUsubstitution_namesr }r h h0h"}r (h(]r h$]r h&]r! Usourcer" hh*]r# h,]r$ uU footnotesr% ]r& Urefidsr' }r( h]r) hasub.