Skip to content

Commit

Permalink
Added an example for constructing <dt></dt> tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bharadwajyarlagadda committed Sep 2, 2016
1 parent b4e9d32 commit 8509d49
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -522,3 +522,25 @@ Korona can build <dl> tag.
assert dl_tag1 == '<dl>abc</dl>'
assert dl_tag1 == dl_tag2
<dt>
----

Korona can build <dt> tag.

.. code-block:: python
from korona.html.construct import DT
attributes = {'text': 'abc'}
# You can pass in the attributes in the form of a dictionary.
dt1 = DT(**attributes)
# You can also pass in the attributes as args.
dt2 = DT(text='abc')
dt_tag1 = dt1.construct()
dt_tag2 = dt2.construct()
assert dt_tag1 == '<dt>abc</dt>'
assert dt_tag1 == dt_tag2

0 comments on commit 8509d49

Please sign in to comment.