Skip to content

Commit

Permalink
Added documentation for anchor <a> tag
Browse files Browse the repository at this point in the history
  • Loading branch information
bharadwajyarlagadda committed Aug 21, 2016
1 parent 19742de commit 833ff9c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
42 changes: 42 additions & 0 deletions docs/guide.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
User's Guide
============

korona helps you to build html pages.

korona also helps you to build individual html tags.

<a>
---

korona supports some of the anchor tag attributes like:
# ``charset``
# ``coords``
# ``download``
# ``href``
# ``hreflang``
# ``name``
# ``rel``
# ``rev``
# ``shape``
# ``target``
# ``type``
# ``text`` (The text as in <a>{text}</a>)

korona can build an anchor tag.

.. code-block:: python
from korona.html.construct import A
attributes = {'charset': 'UTF-8', 'href': 'www.google.com', 'hreflang': 'en', 'text': 'google'}
# You can pass in the attributes in the form of a dictionary.
anchor1 = A(**attributes)
# You can also pass in the attributes as args.
anchor2 = A(charset='UTF-8', href='www.google.com', hreflang='en', text='google')
anchor_tag1 = anchor1.construct_tag()
anchor_tag2 = anchor2.construct_tag()
assert anchor_tag1 == '<a charset="UTF-8" href="www.google.com" hreflang="en" >google</a>'
assert anchor_tag1 == anchor_tag2
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Guide
.. toctree::
:maxdepth: 3

guide

Project Info
============

Expand Down
2 changes: 1 addition & 1 deletion docs/license.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.. include:: ../LICENSE.rst
.. include:: ../LICENSE

0 comments on commit 833ff9c

Please sign in to comment.