[Checkins] SVN: hurry.yui/trunk/ Much improve documentation.
Martijn Faassen
faassen at infrae.com
Mon Oct 13 08:11:25 EDT 2008
Log message for revision 92098:
Much improve documentation.
Changed:
U hurry.yui/trunk/CHANGES.txt
U hurry.yui/trunk/README.txt
U hurry.yui/trunk/setup.py
D hurry.yui/trunk/src/hurry/yui/README.txt
A hurry.yui/trunk/src/hurry/yui/basic.txt
U hurry.yui/trunk/src/hurry/yui/tests.py
-=-
Modified: hurry.yui/trunk/CHANGES.txt
===================================================================
--- hurry.yui/trunk/CHANGES.txt 2008-10-13 11:46:39 UTC (rev 92097)
+++ hurry.yui/trunk/CHANGES.txt 2008-10-13 12:11:25 UTC (rev 92098)
@@ -1,10 +1,10 @@
CHANGES
*******
-2.6.0.1 (unreleased)
-====================
+2.6.0.1 (2008-10-13) (YUI version 2.6.0)
+========================================
-* ...
+* Much improved documentation.
2.6.0 (2008-10-11) (YUI version 2.6.0)
======================================
Modified: hurry.yui/trunk/README.txt
===================================================================
--- hurry.yui/trunk/README.txt 2008-10-13 11:46:39 UTC (rev 92097)
+++ hurry.yui/trunk/README.txt 2008-10-13 12:11:25 UTC (rev 92098)
@@ -1,8 +1,60 @@
+hurry.yui
+*********
+
+Introduction
+============
+
+This library packages YUI_ for `hurry.resource`_. It is aware of YUI's
+dependency structure and different modes (normal, minified and debug)
+and resource rollups.
+
+.. _`hurry.resource`: http://pypi.python.org/pypi/hurry.resource
+
+.. _YUI: http://developer.yahoo.com/yui/
+
+How to use?
+===========
+
+You can import various bits of YUI from ``hurry.yui`` and ``.need``
+them where you want these resources to be included on a page::
+
+ from hurry import yui
+
+ .. in your page or widget rendering code, somewhere ..
+
+ yui.datatable.need()
+
+All the module names as listed here_ are available in the
+``hurry.yui`` package. In addition rolled up modules are also
+available (such as ``reset_fonts_grids``), but rollup inclusion will
+be done automatically so these need not to be referred to
+explicitly. See the `hurry.resource`_ documentation for more
+information.
+
+.. _here: http://developer.yahoo.com/yui/yuiloader/#modulenames
+
+This requires integration between your web framework and
+``hurry.resource``, and making sure that the original resources
+(shipped in the ``yui-build`` directory in ``hurry.yui``) are
+published to some URL.
+
+The package has already been integrated for Grok_ and Zope 3. If you
+depend on the `hurry.zopeyui`_ package in your ``setup.py``, the above
+example should work out of the box.
+
+.. _`hurry.zopeyui`: http://pypi.python.org/pypi/hurry.zopeyui
+
+.. _Grok: http://grok.zope.org
+
Preparing hurry.yui before release
==================================
-Follow the regular package release instructions, but before egg
-generation (``python setup.py register sdist upload``) first execute
+This section is only relevant to release managers of ``hurry.yui``; if
+you don't know whether you are, you aren't.
+
+When releasing ``hurry.yui``, an extra step should be taken. Follow
+the regular package `release instructions`_, but before egg generation
+(``python setup.py register sdist upload``) first execute
``bin/yuiprepare <version number>``, where version number is the
version of the YUI release, such as ``2.6.0``. This will do two
things:
@@ -12,3 +64,4 @@
* download the YUI dependency structure of that YUI version and generate
a ``yui.py`` file in the package that reflects this.
+.. _`release instructions`: http://grok.zope.org/documentation/how-to/releasing-software
Modified: hurry.yui/trunk/setup.py
===================================================================
--- hurry.yui/trunk/setup.py 2008-10-13 11:46:39 UTC (rev 92097)
+++ hurry.yui/trunk/setup.py 2008-10-13 12:11:25 UTC (rev 92098)
@@ -8,7 +8,7 @@
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
long_description = (
- read('src', 'hurry', 'yui', 'README.txt')
+ read('README.txt')
+ '\n' +
read('CHANGES.txt')
+ '\n' +
Deleted: hurry.yui/trunk/src/hurry/yui/README.txt
===================================================================
--- hurry.yui/trunk/src/hurry/yui/README.txt 2008-10-13 11:46:39 UTC (rev 92097)
+++ hurry.yui/trunk/src/hurry/yui/README.txt 2008-10-13 12:11:25 UTC (rev 92098)
@@ -1,53 +0,0 @@
-hurry.yui
-*********
-
-This library packages YUI for ``hurry.resource``. It is aware of YUI's
-dependency structure and different modes (normal, minified and debug)
-and consolidations.
-
-Let's set up a way to render URLs; typically the framework has already
-done this::
-
- >>> def get_library_url(library):
- ... return 'http://localhost/static/%s' % (
- ... library.name)
- >>> from hurry.resource import Library
- >>> from hurry.resource.interfaces import ILibraryUrl
- >>> from zope import component
- >>> component.provideAdapter(
- ... factory=get_library_url,
- ... adapts=(Library,),
- ... provides=ILibraryUrl)
-
-
-Let's check the YUI structure by picking out a resource in it::
-
- >>> from hurry import yui
- >>> from hurry.resource import NeededInclusions
- >>> needed = NeededInclusions()
- >>> needed.need(yui.fonts)
- >>> print needed.render()
- <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/fonts/fonts.css" />
-
-Let's try a resource that has a dependency on fonts, namely
-``grids``::
-
- >>> needed = NeededInclusions()
- >>> needed.need(yui.grids)
- >>> print needed.render()
- <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/fonts/fonts.css" />
- <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/grids/grids.css" />
-
-Now let's try to see consolidation: we include grids and reset at the
-same time, and we expect a consolidation to ``reset-fonts-grids``::
-
- >>> needed = NeededInclusions()
- >>> needed.need(yui.grids)
- >>> needed.need(yui.reset)
- >>> print needed.render()
- <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/reset-fonts-grids/reset-fonts-grids.css" />
-
-Let's get the same, minified::
-
- >>> print needed.render(mode="minified")
- <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/reset-fonts-grids/reset-fonts-grids-min.css" />
Copied: hurry.yui/trunk/src/hurry/yui/basic.txt (from rev 92096, hurry.yui/trunk/src/hurry/yui/README.txt)
===================================================================
--- hurry.yui/trunk/src/hurry/yui/basic.txt (rev 0)
+++ hurry.yui/trunk/src/hurry/yui/basic.txt 2008-10-13 12:11:25 UTC (rev 92098)
@@ -0,0 +1,51 @@
+hurry.yui basic tests
+=====================
+
+Here are some basic tests for hurry.yui.
+
+Let's set up a way to render URLs; typically the framework has already
+done this::
+
+ >>> def get_library_url(library):
+ ... return 'http://localhost/static/%s' % (
+ ... library.name)
+ >>> from hurry.resource import Library
+ >>> from hurry.resource.interfaces import ILibraryUrl
+ >>> from zope import component
+ >>> component.provideAdapter(
+ ... factory=get_library_url,
+ ... adapts=(Library,),
+ ... provides=ILibraryUrl)
+
+
+Let's check the YUI structure by picking out a resource in it::
+
+ >>> from hurry import yui
+ >>> from hurry.resource import NeededInclusions
+ >>> needed = NeededInclusions()
+ >>> needed.need(yui.fonts)
+ >>> print needed.render()
+ <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/fonts/fonts.css" />
+
+Let's try a resource that has a dependency on fonts, namely
+``grids``::
+
+ >>> needed = NeededInclusions()
+ >>> needed.need(yui.grids)
+ >>> print needed.render()
+ <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/fonts/fonts.css" />
+ <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/grids/grids.css" />
+
+Now let's try to see consolidation: we include grids and reset at the
+same time, and we expect a consolidation to ``reset-fonts-grids``::
+
+ >>> needed = NeededInclusions()
+ >>> needed.need(yui.grids)
+ >>> needed.need(yui.reset)
+ >>> print needed.render()
+ <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/reset-fonts-grids/reset-fonts-grids.css" />
+
+Let's get the same, minified::
+
+ >>> print needed.render(mode="minified")
+ <link rel="stylesheet" type="text/css" href="http://localhost/static/yui/reset-fonts-grids/reset-fonts-grids-min.css" />
Modified: hurry.yui/trunk/src/hurry/yui/tests.py
===================================================================
--- hurry.yui/trunk/src/hurry/yui/tests.py 2008-10-13 11:46:39 UTC (rev 92097)
+++ hurry.yui/trunk/src/hurry/yui/tests.py 2008-10-13 12:11:25 UTC (rev 92098)
@@ -7,7 +7,7 @@
suite = unittest.TestSuite()
suite.addTest(doctest.DocFileSuite(
- 'README.txt',
+ 'basic.txt',
globs=globs,
optionflags=optionflags))
return suite
More information about the Checkins
mailing list