Commits

Anonymous committed 40f52f4

Docs for webhelpers.html.tags

Comments (0)

Files changed (3)

docs/modules/html/secure_form.rst

-:mod:`webhelpers.html.secure_form`
-================================================
-
-.. automodule:: webhelpers.html.secure_form
-
-.. currentmodule:: webhelpers.html.secure_form

docs/modules/html/tags.rst

 .. automodule:: webhelpers.html.tags
 
 .. currentmodule:: webhelpers.html.tags
+
+Form tags
+---------
+
+.. autofunction:: form
+
+.. autofunction:: end_form
+
+.. autofunction:: text
+
+.. autofunction:: textarea
+
+.. autofunction:: hidden
+
+.. autofunction:: file
+
+.. autofunction:: password
+
+.. autofunction:: checkbox
+
+.. autofunction:: radio
+
+.. autofunction:: submit
+
+.. autofunction:: select
+
+.. autoclass:: Options
+   :members:
+
+.. autoclass:: Option
+   :members:
+
+.. autoclass:: OptGroup
+   :members:
+
+.. autofunction:: title
+
+.. autofunction:: required_legend
+
+
+:class:`ModelTags` class
+--------------------------
+
+.. autoclass:: ModelTags
+   :members:
+
+
+Hyperlinks
+----------
+
+.. autofunction:: link_to
+
+.. autofunction:: link_to_if
+
+.. autofunction:: link_to_unless
+
+
+Table tags
+----------
+
+.. autofunction:: th_sortable
+
+
+Other non-form tags
+-------------------
+
+.. autofunction:: ol
+
+.. autofunction:: ul
+
+.. autofunction:: image
+
+.. attribute:: BR
+
+    A break tag ("<br />") followed by a newline. This is a literal 
+    constant, not a function.
+
+
+Head tags and document type
+---------------------------
+
+.. autofunction:: stylesheet_link
+
+.. autofunction:: javascript_link
+
+.. autofunction:: auto_discovery_link
+
+.. autoclass:: Doctype
+   :members:
+
+.. autofunction:: xml_declaration
+
+
+Utility functions
+-----------------
+
+.. autofunction:: css_classes
+
+.. autofunction:: convert_boolean_attrs

webhelpers/html/tags.py

 """Helpers producing simple HTML tags
 
-Most helpers have an ``\*\*attrs`` argument to specify additional HTML
+Most helpers have an ``**attrs`` argument to specify additional HTML
 attributes.  A trailing underscore in the name will be deleted; this is 
-especially important for attributes that match Python keywords; e.g.,
-``class_``.  Some helpers handle certain keywords specially; these are noted in
-the helpers' docstrings.
+especially important for attributes that are identical to Python keywords;
+e.g., ``class_``.  Some helpers handle certain keywords specially; these are
+noted in the helpers' docstrings.
 """
 
 import datetime
     ``_make_safe_id_component()``.  Pass the empty string ("") to suppress the
     ID attribute entirely.
 
-d
     The following HTML attributes may be set by keyword argument:
 
     * ``disabled`` - If true, checkbox will be grayed out.
     convenient.
 
     This class has multiple jobs:
+
     - Canonicalize the options given to ``select()`` into a consistent format.
     - Avoid canonicalizing the same data multiple times.  It subclasses tuple
       rather than a list to guarantee that nonconformant elements won't be 
 
     ``title`` -- the name of the field; e.g., "First Name".
 
-    ``required `` -- if true, append a "*" to the title and use the
+    ``required`` -- if true, append a \*" to the title and use the
     'required' HTML format (see example); otherwise use the 'not
     required' format.
 
     def html5(self):
         """Create a <!DOCTYPE> for HTML 5.
         
-           Usage:
-           >>> Doctype().html5()
-           literal(u'<!doctype html>')
+        Usage::
+
+            >>> Doctype().html5()
+            literal(u'<!doctype html>')
         """
         return literal("<!doctype html>")
 
     def xhtml1(self, subtype="transitional", version="1.0"):
         """Create a <!DOCTYPE> for XHTML 1.
 
-           Usage:
-           >>> Doctype().xhtml1()
-           literal(u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">')
-           >>> Doctype().xhtml1("strict")
-           literal(u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">')
-           >>> Doctype().xhtml1("frameset")
-           literal(u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">')
+           Usage::
+
+               >>> Doctype().xhtml1()
+               literal(u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">')
+               >>> Doctype().xhtml1("strict")
+               literal(u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">')
+               >>> Doctype().xhtml1("frameset")
+               literal(u'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">')
         """
         if subtype in ["transitional", "loose"]:
             name = "Transitional"
         """Create a <!DOCTYPE> for HTML 4.
 
            Usage:
-           >>> Doctype().html4()
-           literal(u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">')
-           >>> Doctype().html4("strict")
-           literal(u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">')
-           >>> Doctype().html4("frameset")
-           literal(u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">')
+
+               >>> Doctype().html4()
+               literal(u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">')
+               >>> Doctype().html4("strict")
+               literal(u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">')
+               >>> Doctype().html4("frameset")
+               literal(u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">')
         """
         if subtype in ["transitional", "loose"]:
             name = "Transitional"
 def xml_declaration(version="1.0", encoding="utf-8"):
     """Create an XML declaration.
 
-       Usage:
-       >>> xml_declaration()
-       literal(u'<?xml version="1.0" encoding="utf-8" ?>')
+       Usage::
+
+           >>> xml_declaration()
+           literal(u'<?xml version="1.0" encoding="utf-8" ?>')
     """
     return literal('<?xml version="%s" encoding="%s" ?>') % (version, encoding)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.