-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added documentation for anchor <a> tag
- Loading branch information
1 parent
19742de
commit 833ff9c
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ Guide | |
.. toctree:: | ||
:maxdepth: 3 | ||
|
||
guide | ||
|
||
Project Info | ||
============ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.. include:: ../LICENSE.rst | ||
.. include:: ../LICENSE |