From da65108ace5d0a7f64e3d6ea205f502127da5213 Mon Sep 17 00:00:00 2001 From: bharadwajyarlagadda Date: Thu, 1 Sep 2016 23:48:54 -0400 Subject: [PATCH] Added an example for constructing
tag --- docs/guide.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/guide.rst b/docs/guide.rst index 75c2194..9da6ac5 100644 --- a/docs/guide.rst +++ b/docs/guide.rst @@ -500,3 +500,25 @@ Korona supports ``align`` attribute for ``
`` tag. Korona can help you build assert div_tag1 == '
abcd
assert div_tag1 == dialog_tag2 +
+---- + +Korona can build
tag. + +.. code-block:: python + + from korona.html.construct import DL + + attributes = {'text': 'abc'} + + # You can pass in the attributes in the form of a dictionary. + dl1 = DL(**attributes) + # You can also pass in the attributes as args. + dl2 = DL(text='abc') + + dl_tag1 = dl1.construct() + dl_tag2 = dl2.construct() + + assert dl_tag1 == '
abc
' + assert dl_tag1 == dl_tag2 +