package tyxml-syntax
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Common layer for the JSX and PPX syntaxes for Tyxml
Install
dune-project
Dependency
Authors
Maintainers
Sources
tyxml-5.0.0.tbz
sha256=c725bb8918ff1b601e7926b7b6b4799f8f4ab70f5fba9f0970da657cb82c07f2
sha512=61881aa7101b5072b887802e78897920516c9c2b484d51ac281509e83c79969c7654caa31b125ad843b45740dfe143ed5218fd7e4d98dfba8e0b24b272308ed6
doc/CHANGES.html
5.0.0
TyXML now follows the current specifications: the WHATWG living standard for HTML, and SVG 2 with the Filter Effects module for SVG, whose support had not moved since SVG 1.1.
Breaking changes
- The
hiddenattribute takes an enumerated argument ([`Hidden | `Until_found]) instead of no argument, andcontenteditabletakes an enumerated argument ([`True | `False | `Plaintext_only]) instead of a boolean, so that the until-found and plaintext-only states can be expressed a_itemtypeanda_pingtake anXml.uri listinstead of astring listand go throughXml.uris_attrib, like every other URL-valued attribute.Tyxml.Htmlis unaffected, itsXml.uriisstring- The SVG attributes whose value is a URL follow the same rule:
a_href,a_xlink_href,a_xml_base,a_xlink_role,a_xlink_arcroleand thea_pingthis release adds to the SVGaelement take anXml.uri, where they used to take theiritype, which isstring. The presentation attributes that accept a funciri such asurl(#id)or a keyword such asnone, that isclip-path,maskand themarker-*ones, keepiri - SVG documents are printed without a doctype.
Svg.Infodeclared SVG 1.1 and every printed document carried the SVG 1.1 DTD, which forbids the SVG 2 elements and attributes TyXML now emits, and SVG 2 defines no DTD.Info.versionandInfo.standardname SVG 2 - Unlike their HTML counterparts, the
Svg_types.*_contenttypes are widened along with the content models they describe: the SVG element functions use them directly, there is no_content_funon that side. Code that names one of them and constrains it with=has to be updated - Misspelled names are corrected:
a_baseFrenquencybecomesa_baseFrequency,a_externalRessourcesRequiredbecomesa_externalResourcesRequired, thestroke-linejoinvalue`Beverbecomes`Bevel, and the typesHtml_types.subressource_integrityandSvg_types.paint_whitout_iccbecomesubresource_integrityandpaint_without_icc - The newly deprecated elements and attributes are an error, and not a warning, for the users of the PPX and the JSX syntax who build in dune's dev profile, where alerts are fatal. The alert is reported on the markup literal, so it has to be silenced on the enclosing definition
- The
Wrapped_functionsmodule type has four new functions, which the implementations of the functorial interface must provide:string_of_blockingandstring_of_ol_typefor HTML,unoption_stringandstring_of_semicolonstringsfor SVG - The build now requires OCaml 4.08, dune 3.18 and ppxlib 0.36 (Sora Morimoto, and #340 by Patrick Ferris for the OCaml 5.2 AST)
- The test matrix covers OCaml 4.14 and the 5.x series. The lower bound stays at 4.08, but the versions from 4.08 to 4.13 are no longer tested
HTML
- New elements:
s,bdi,search,data,slot, andtrackwith itskind,srclang(asa_track_srclang) anddefaultattributes,audioandvideotaking an optional?tracksargument.meta_itempropis the form ofmetacarrying anitempropattribute, which the specification allows wherever phrasing content is expected and not only in the head (#343 by toastal) - New global attributes:
popover,inert,enterkeyhint,autocapitalize,autocorrect,writingsuggestions,nonce,slotandis, the microdata attributesitemscope,itemtype,itemid,itempropanditemref, the CSS shadow parts attributespartandexportparts, and the`Autovalue ofdir(#341 by @SylvainBoilard for popover, #343 by toastal for microdata) - New attributes on elements:
popovertargetandpopovertargetactionon buttons and inputs,commandandcommandfor(invoker commands) on buttons,loading,decodingandfetchpriorityon images,srcdoc,allowandloadingon iframes,as,imagesrcsetandimagesizeson links (a_as),nomoduleon scripts,blockingon links, scripts and styles,pingonaandarea,dirnameon inputs and textareas,capture(W3C HTML Media Capture) on inputs,a_ol_typeon ordered lists,abbron th cells,closedbyon dialogs,mediaon meta,nameondetails,playsinlineanddisablepictureinpictureon videos,disableremoteplaybackon audios and videos, and the declarative shadow DOM attributes on templates (shadowrootmode,shadowrootdelegatesfocus,shadowrootclonableandshadowrootserializable). Also allowcrossorigin,usemapandreferrerpolicyon images,referrerpolicyonaandarea, andautocompleteon selects and textareas (#341 by @SylvainBoilard fornameondetails, fixes #268) - New event handler attributes: the pointer events (
a_onpointerdownand its siblings),a_onwheel,a_onauxclick, and the global handlers that were missing (a_onbeforeinput,a_onbeforematch,a_onbeforetoggle,a_oncancel,a_oncontextlost,a_oncontextrestored,a_oncopy,a_oncut,a_onpaste,a_oncuechange,a_onscrollend,a_onsecuritypolicyviolation,a_onslotchangeanda_ontoggle), plusa_onlanguagechange,a_onrejectionhandledanda_onunhandledrejectionon body - New attribute values:
dialogformethodandformmethod, and the newersandboxtokens (allow-downloads,allow-modals,allow-orientation-lock,allow-popups-to-escape-sandbox,allow-presentation,allow-top-navigation-by-user-activationandallow-top-navigation-to-custom-protocols) - Content models brought in line with the specification:
divgroupsdtandddinsidedl, the script-supporting elements (script,template) are accepted indl,ol,ul,menu,tableand its row groups,tr,selectandoptgroup,hgroupacceptsp, andselectacceptshr. The_contenttypes keep their previous value, only the types the element functions use are widened (#344 by toastal, fixes #342 and #321) - Undeprecate the
scopeattribute, which is valid on table header cells in the living standard - Deprecate
a_version,a_xml_spaceanda_scrolling, which produce a type tag that is in no attribute category, so no element ever accepted them
SVG
- New elements:
mask,feMergeNodeandfeDropShadow.maskwas declared inSvg_typesbut the element itself was missing, andfeMergecould be given no child at all sincefeMergeNodedid not exist - Presentation attributes: add the ones whose type tags were already declared but had no function (
baseline-shift,clip-rule,color,color-interpolation,color-interpolation-filters,color-rendering,cursor,direction,display,fill-opacity,filter,flood-color,flood-opacity,font-size-adjust,image-rendering,letter-spacing,lighting-color,marker-end,marker-mid,marker-start,mask,opacity,overflow,pointer-events,shape-rendering,unicode-bidi,visibility,word-spacingandwriting-mode) and the ones new in SVG 2 (paint-order,text-overflow,transform-origin,vector-effectandwhite-space). The ones SVG 2 removed are added as deprecated:clip,color-profile,enable-background,glyph-orientation-horizontal,glyph-orientation-verticalandkerning(#333 by Martin @MBodin Bodin forclip-path) - Other new attributes: the
tabindexandautofocusglobal attributes,langbecomes global, ARIA support (a_roleanda_aria), the SVG 2 link attributes on theaelement (download,hreflang,ping,referrerpolicy,relandtype),crossorigin,decodingandfetchpriority,fron radial gradients,sideandpathontextPath, and the SVG 2 geometry attributes onsymbol(x,y,width,height,refX,refY) - Attribute functions missing for type tags that were already declared:
a_end(SMIL timing),a_z(light sources),a_filterUnits,a_title(onstyle),a_origin,a_panose_1,a_descent, and the deprecateda_xlink_type,a_xlink_roleanda_xlink_arcrole - New values of existing attributes:
miter-clipandarcsforstroke-linejoin, all the CSS blend modes for themodeattribute offeBlend, andtext-topandtext-bottomforalignment-baselineanddominant-baseline - The HTML event handler attributes, which SVG 2 reuses on every element (focus, keyboard, pointer, wheel, clipboard, drag and media events), and the window event handler attributes on the
svgelement - Content models widened to SVG 2: shapes accept paint servers,
clipPath,marker,mask,scriptandstyle;useandimageacceptclipPath,mask,scriptandstyle; text elements accept paint servers,scriptandstyle; filter primitives accept descriptive elements,animate,scriptandset; gradients,stopandclipPathacceptscript - Separate the values of the
values,keyTimesandkeySplinesanimation attributes with semicolons, as SMIL requires, instead of commas (#308 by @rand00) - Deprecate what SVG 2 removed and was not deprecated yet:
externalResourcesRequired,filterRes,zoomAndPan, theonzoom,onactivate,onfocusinandonfocusoutevent handlers, and thecursorandanimateColorelements. Conversely, undeprecatea_onload: the load event is still fired on SVG elements
Fixes
- The
areaelement could not be used at all: it had nohrefattribute, and its type tag was in no content model, so amapcontaining areas fitted nowhere. It is now phrasing content, and its signature usesarea_attribinstead of repeating a shorter list that left outdownload,pingandreferrerpolicy(fixes part of #184) - The
lichildren ofmenucould not be built: the`Lisbranch required anliwhose attributes were a subset of the common ones, excluding thevalueattribute thatlialways allows - Several attribute names were emitted misspelled:
reversed(emittedreserved), theallow-scriptssandbox token (allow-script) and, in SVG,zoomAndPan,requiredExtensions,externalResourcesRequired,edgeMode(emittedtargetY),filterRes,target(emittedxlink:target),glyph-nameand thefont-face-formatelement (emittedfont-face-uri). Several SVG attribute values were too: the hyphens missing from therendering-intentanddominant-baselinevalues, the case of theinandin2keywords (SourceGraphicand the other built-in inputs), and`Align, emitted as the empty string (Hugo @hhugo Heuzard) - Several type tags did not match their attribute, making
a_edgeMode,a_preserveAlpha,a_filterRes,a_target,a_glyph_name,a_arabic_form,a_requiredExtensions,a_xlink_titleanda_lowunusable, and some element type tags were misspelled or duplicated (feFuncR,feFuncGandfeFuncBwere all defined as`FeFuncA) (Hugo @hhugo Heuzard) - The
symbolelement accepted neither the core attributes, so noid, which made it impossible to reference, nor the presentation and event attributes, nor shape children - The
xml:base,xml:langandxml:spaceattributes and the touch event handler attributes of SVG had type tags listed in no attribute category, which made them unusable on every element Xml_print.compose_declemitted a literal\ninstead of a newline, which made the XML declaration invalid (#348 by Martin @MBodin Bodin)- In the JSX syntax,
Htmlused as an element name was mistaken for a user-defined component: the test lowercased the name and then compared it with a capitalised string, so it never matched - Fix the development-profile build with recent compilers by anonymizing the unused functor parameters of the printer and functor signatures (warning 67)
- Fix the typo
whitoutin a type definition (#324 by Martin @MBodin Bodin) - Fix the typo
subresourceand various English orthographic mistakes (#345 by toastal) Unsafegainsuris_attrib, the escape hatch that was missing for an attribute holding a space-separated list of URLs, next touri_attrib
PPX and JSX syntax
- No camel case SVG attribute was recognised, so
viewBox,maskUnits,stdDeviation,gradientTransform,preserveAspectRatio,refX,markerWidthand many others were rejected - Whitespace between SVG tags is ignored for the elements whose content model does not accept text. Indented SVG, as the specification itself writes it, was rejected:
[%svg "<g> </g>"]failed to typecheck. Whitespace is still significant intext,tspan,textPath,desc,title,styleandscript(#331 by Martin @MBodin Bodin, fixes #330) - A
transformattribute whose arguments were comma separated, such astranslate(1,1), was rejected. Any whitespace, and not only the space character, is now accepted around the separators of list-valued attributes (#328 by Martin @MBodin Bodin, fixes #326) - Two transforms must now be separated by whitespace or a comma, as the grammar of the attribute requires.
transform="translate(1,2)rotate(45)"used to be accepted and silently turned into valid output - The
values,keyTimesandkeySplinesanimation attributes are split on semicolons, where they used to be split on spaces (#308 by @rand00) - An empty
optionis accepted, as forscriptandtextarea: an option carrying alabeland avalueattribute has no content, which is the usual form inside adatalist(fixes #228)
Documentation
- The manual is converted from wikicreole to odoc, and the API references in the interfaces are native odoc references. The themed site published on ocsigen.org is built by wodoc (#352 by Hugo @hhugo Heuzard for the rendering)
4.6.0
- Update for OCaml 5.0 and drop support for OCaml 4.2.0 (#312 by @rr0gi)
- Add additional variants to
linktypefor therelattribute (Leon @LogicalOverflow Vack) - Expand options for
autocompleteattribute on<input>elements (#302 by Aron @aronerben Erben) - Fix the SVG element
<animate>(by the way, deprecateanimationet al. in favor ofanimateet al.) (#306 by Idir @ilankri Lankri) - Add support for
dialogelement andoncloseattribute (#301 by Julien Sagot) - Add an escape hatch for emitting attributes with non-standard names in jsx or ppx code (a leading
_character on attribute name) (#295 Chas @cemerick Emerick) - Add support for
typeattribute on<script>elements (#293 by Ulrik @ulrikstrid Strid and Chas @cemerick Emerick) - Add svg
fill-ruleattribute (#294 by Eric @dedbox Griffis)
4.5.0
- Move all the PPXs to ppxlib (#271, Initial code by Sonja @pitag-ha Heinze)
- Add the
translateattribute (#281 by Javier @jchavarri Chávarri) - Update allowed
inputmodes (#279 by Joel @joelburget Burget) - Add the
pictureelement (#263 by Stéphane @slegrand45 Legrand)
4.4.0
- Add support for Reason's JSX syntax with a new
tyxml-jsxpackage (#254 by Joris Giovannangeli and Gabriel Radanne with help from Ulrik Strid and Louis Roché) - Modernize the handling of toplevel printers for utop. (Gabriel Radanne)
Elements and attributes
- Add
allowfullscreen,allowpaymentrequest,referrerpolicyattributes (#242 by Thibault Suzanne) - Allow
crossoriginattribute for script element (#243 by Thibault Suzanne) - Greatly improved support of whitespaces in the PPX (#225 by Jules Aguillon)
- Add preliminary support for ARIA attributes (#253 by Stéphane Legrand and Gabriel Radanne)
- Add
templateelement (#239 Stéphane Legrand) - Several bug fixes for types and PPX
4.3.0
- Dunify This also removes all the deprecated libraries (
tyxml.syntax,tyxml.parser) and removes the ocamlfind librarytyxml.ppxin favor oftyxml-ppx. (#197 by Drup, Rudi Grinberg and Anton Bachin) - Add simplistic indentation for the Format-based printer (#187 by Drup)
- Allow the ppx to be used for more exotic tyxml instances, such as reactive elements (#200 by Drup)
- Add
Html.of_seqandSvg.of_seq, which allow to easily import HTML parsed with markup in TyXML (#221 by Drup)
Elements and attributes
- Add Html.txt and Svg.txt as an alias for
pcdata(#222 by Drup) - Add noopener link types (#198 by Jérôme Vouillon)
- Slightly relax dt content type (#193 by Anton Bachin)
- Add touch events (#211 by Malthe Borch)
- Fix handling of figcaption in the PPX (#219 by Drup)
4.2.0
- Compatibility with OCaml 4.6.0.
- The ppx should now be compatible with driver-based workflows. In particular, jbuilder.
- Future breakage:
- The two camlp4-based packages (tyxml.syntax and tyxml.parser) are now deprecated and will be removed in the next major version.
- Introduction of the tyxml-ppx ocamlfind package. Usage of the tyxml.ppx package is discouraged, and it will be removed in the next major version.
- Various fixes in the Html_sigs.T module (contribution by Fabian Pijcke):
- Fixed the map element function signature.
- The elements functions now (almost) all make use of the types defined in Html_types, rather than redefining them.
- Html_sigs.T.fieldset now takes [< legend] elt wrap as optional argument rather than legend elt wrap.
- Add basic support for
aria-*attributes (contribution by Armaël Guéneau) (see https://www.w3.org/TR/wai-aria-1.1/#states_and_properties) - Add support for the
roleattribute (contribution by Armaël Guéneau) (see https://www.w3.org/TR/role-attribute/) - Add support for the
minlengthform attribute (contribution by Armaël Guéneau) (See https://www.w3.org/TR/html5/forms.html#attr-input-minlength)
4.1.0
- Uses uutf 1.0 (contribution by Daniel Bunzli)
4.0.1
- Fix handling of comments in the ppx.
- Fix printing of utf8 in attributes.
- Properly flush ppx errors. This bug was causing some blank error messages.
- Fix handling of whitespaces in
<select>in the ppx.
4.0.0
Features
- A new PPX has been added that allows to use tyxml with the HTML/SVG syntax, using the markup library (contribution by Anton 'aantron' Bachin).
- New Format-based printers are available, both as functors and has
ppfunctions in the various implementations. Old printers are deprecated. - Toplevel printers are now available for the
tyxmllibrary. - The
strlibrary has been replaced byre. - Various attributes arguments have been simplified. In particular:
- Constants arguments have been removed
`On|`Offarguments are now replaced by booleans.- Some arguments now use an option type.
- XML comments are now properly serialized (without escaping but with sanitization).
Elements and attributes
- Add srcset and sizes attributes (contribution by Stéphane 'slegrand45' Legrand).
- The arguments of the
sandboxattributes are now more consistent (contributino by Anton 'aantron' Bachin). - Various SVG attributes and elements are now properly named (contributino by Anton 'aantron' Bachin).
- Add inputmode attribute.
Documentation
- Both the API documentation and the manual have been completely rewritten! Do not hesitate to read them and provide feedback.
- Various examples have been added in the
example/directory. (basic_website contributed by Edgar 'fxfactorial' Aroutiounian).
Renaming and deprecations
- Files in the
tyxmllibrary are now packed in aTyxmlmodule. If you were using one ofHtml5,SvgandXmlmodule, simply openTyxml. - All Html5 modules are now named Html
- Various attributes and elements have been renamed. The original versions have been kept and marked deprecated.
- Various elements that were both deprecated in the HTML specification and not usable due to typing constraints have been removed.
3.6.0
- Improves and simplify the wrapping interface. Breaking change.
- Add the possibility to specify converters, for constants functions. See also eliom's shared react.
- Fix printing of floating numbers.
- Add the main element.
- Fix the accept attribute.
3.5.0
- Add Tyxml_name, which allows to derive tyxml identifiers from HTML elements and attributes.
- Internally build the tool
autoname, which applies the aftermentionned transformation for the given elements/attributes. - Fix typo in
datetime-local. - Add download attributes for area and tags.
- Add various svg
textattributes. - Fix namespaces issues related to svg elements inside html.
3.4.0
- Add
a_langfor HTML. Deprecatea_srclangin favor ofa_xml_lang. - Fix a performance issue with `Xml_print.Utf8.{normalize, normalize_html}.
- Remove
Xml_print.Utf8.normalize_from. The function was not useful and not optimizable easily. - Add missing parameters for the attributes xlink:actuate and xml:space.
- Svg elements use the xlink namespace (contribution by Florent Becker).
- Do not use the
url(...)form when inappropriate (contribution by Florent Becker). - Fix a typo in the
spellcheckattribute (contribution by Kevin Brubeck Unhammer). - Fix the
sizesattributes and add missing attributes for thesandboxtag (contributions by Eyyüb Sari). - Fix the
imgtag in the syntax extension. - Fix compilation of the opam package under freeBSD.
- Fix typing for the various
font_svg attributes.
3.3.0
- Add
Xml_print.Utf8to encode html elements to utf8 properly.
3.2.1
- Add signature functors to ease export of module created with the functorial interface. See the manual for more details.
- Fix variance for Svg.attrib.
- Fix export of Xml.list_wrap for Html5.M and Svg.M. Should fix syntax extension with those.
3.2.0
- Remove Xhtml.
- Remove plus elements. For example, table doesn't enforce non-emptyness anymore.
- Add various types that were not exported (img, dl, figure, rp, rt and ruby types).
- Expose
string_of_number, the better stringifier introduced in 3.1.0. - Functorial interface breaking changes:
- Modify the functorized interface to export typed events. You can now specify different handlers for keyboard and mouse events. There are two new types and functions (keyboard and mous events) in the Xml signature.
- Add a wrapping type for lists of nodes. See reactiveData and new eliom wrapping.
3.1.0
- Replace fake booleans (
\True | `False`) by actual booleans. Breaking change. - Camlp4 is now an optional dependency. The syntax extension is build only when the syntax flag is enabled (true by default).
- Use a better stringifier for float values (copied from js_of_ocaml).
- Add attributes
muted,crossoriginandmediagroupfor<audio>and<video>. - Various misc fixes
- Fix in the svg syntax extension
- Typo "proress" -> "progress"
3.0.0
- In the functorial interface, allow to wrap xml nodes inside a monad by providing an additional wrapping module. Used by reactive nodes in eliom.
- Use oasis as build systems
- Various bug fixes, mostly related to the svg module.
2.3.0
- Adding module Unsafe for inserting missing nodes or attributes
2.2.0
- Adding tag
2.1.0
- Rename all module names lower-case
- Explicit choice of implementation for syntax extension
2.0.2
- Add a simple printer: XML.print
- API change: ** Rename XML.event into XML.event_handler ** The functorized interface now export the concrete representation of XML.nodes ** Open types in SVG_sigs (closes #269).
2.0.1
- Allow compilation on win32/msvc
- Truly allow to abstract the XMl.uri representation
- Always print XHTML in a format that is "Html compatible": ** Add missing namespace in .
2.0
- Allow the namespace attribute in HTML5 elements.
- Always print polyglot XML. ( document correct as HTML5 and as XML )
- Add new polymorphic types to HTML5 ( between_phrasing_and_phrasing_without_interactive, ... )
2.0-rc1
- Some fixes to match the latest HTML5 working draft (05/08/2011).
- Simplification of the functorial interface (use module substitution)
- Fix IFrame usage.
1.91
- First independent release (was released with ocsigen)
- Add a functorial interface for concrete XML representation
- Add a functorial interface for stream printer
- Rename XHTML5 into HTML5
- Change the default syntax to HTML5 instead of XHTML 1.1
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page