Skip to content

Commit

Permalink
Added an example for constructing <dialog></dialog> tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bharadwajyarlagadda committed Sep 2, 2016
1 parent 325eb79 commit 2c132cc
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 @@ -456,3 +456,25 @@ Korona supports ``open`` attribute for ``<details>`` tag. Korona can help you bu
assert details_tag1 == '<details open >abcd</details>
assert details_tag1 == details_tag2
<dialog>
--------

Korona supports ``open`` attribute for ``<dialog>`` tag. Korona can help you build ``<dialog>`` tag.

.. code-block:: python
from korona.html.construct import Dialog
attributes = {'open': True, 'text': 'abcd'}
# You can pass in the attributes in the form of a dictionary.
dialog1 = Dialog(**attributes)
# You can also pass in the attributes as args.
dialog2 = Dialog(open=True, text='abcd')
dialog_tag1 = dialog1.construct()
dialog_tag2 = dialog2.construct()
assert dialog_tag1 == '<dialog open >abcd</dialog>
assert dialog_tag1 == dialog_tag2

0 comments on commit 2c132cc

Please sign in to comment.