How to integrate Bootstrap with Eliom?

221 views Asked by At

I am trying to use Bootstrap within the Eliom framework but I cannot figure out how to use some of the html attributes correctly. Take for example the following code from the bootstrap website (http://getbootstrap.com/components/#btn-groups):

<div class="btn-group" role="group" aria-label="...">
<button type="button" class="btn btn-default">Left</button>
<button type="button" class="btn btn-default">Middle</button>
<button type="button" class="btn btn-default">Right</button>
</div>

I cannot figure out how to replicate the attributes role and aria-label in Eliom. They are not listed under type base_attributes, type button_attrib or type common (http://ocsigen.org/tyxml/3.4/api/Html5_types#TYPEcommon). Can the above code be replicated in Eliom?

2

There are 2 answers

0
ckuijjer On BEST ANSWER

The role and aria-... attributes are used to give hints to enhance accessibility for people with disabilities (see this ARIA article at MDN). Depending on the accessibility requirements you must decide if you need them, Bootstrap's styling and JavaScript components aren't dependent on them.

Looking at the Ocsigen FAQ (look for "Some HTML5 element or attribute is missing. What can I do?") it seems that if you use the TyXML library you can use the low unsafe interface Html5_sigs.​T.​Unsafe. But frankly I don't know anything about Eliom.

0
Drup On

A binding was started here.

As ckuijjer said, the Unsafe module is the right way to add non-existent attributes/elements. The one that are missing should be contributed to tyxml, of course. :)