@@ -193,7 +193,57 @@ package bindable {
193193
194194 }
195195
196- /** A dependent type class that witnesses a type that can be converted to a `BindingSeq[Value]`. */
196+ /** A dependent type class that witnesses a type that can be converted to a `BindingSeq[Value]`.
197+ *
198+ * @example This type class is internally used in the [[org.lrng.binding.html ]] annotation, automatically converting
199+ * any compatible values into [[com.thoughtworks.binding.Binding.BindingSeq ]], injecting into a HTML template.
200+ * {{{
201+ * import org.lrng.binding.html
202+ * import org.scalajs.dom._
203+ * @html
204+ * def myBinding = <span>Single Element</span>
205+ *
206+ * @html
207+ * def myBindingSeq = <span>Element 1</span><span>Element 2</span>
208+ *
209+ * @html
210+ * def myBindingOrBindingSeq(singleElement: Boolean) = {
211+ * if (singleElement) {
212+ * <span>Single Element</span>
213+ * } else {
214+ * <span>Element 1</span><span>Element 2</span>
215+ * }
216+ * }
217+ *
218+ * @html
219+ * def mySection = <section>
220+ * {myBinding.bind}
221+ * {myBinding}
222+ * {myBindingSeq}
223+ * {Binding{myBindingSeq.all.bind.toSeq}}
224+ * {myBindingSeq.all.bind.toSeq}
225+ * {myBindingOrBindingSeq(true)}
226+ * {myBindingOrBindingSeq(false)}
227+ * </section>
228+ *
229+ * val root = document.createElement("span")
230+ * html.render(root, mySection)
231+ *
232+ * root.innerHTML should be(
233+ * """<section>
234+ * <span>Single Element</span>
235+ * <span>Single Element</span>
236+ * <span>Element 1</span><span>Element 2</span>
237+ * <span>Element 1</span><span>Element 2</span>
238+ * <span>Element 1</span><span>Element 2</span>
239+ * <span>Single Element</span>
240+ * <span>Element 1</span><span>Element 2</span>
241+ * </section>"""
242+ * )
243+ * }}}
244+ *
245+ *
246+ */
197247 @ typeclass
198248 trait BindableSeq [- From ] {
199249 type Value
0 commit comments