Skip to content
This repository
Browse code

nice hack to have README.rst from README.txt for GitHub

  • Loading branch information...
commit cad84eef3f446d3c9b340e6716081e9df3b0dc74 1 parent 0665dcf
Héctor Velarde authored May 04, 2012
90  README.rst
Source Rendered
... ...
@@ -1,90 +0,0 @@
1  
-*********************
2  
-collective.prettydate
3  
-*********************
4  
-
5  
-.. contents:: Table of Contents
6  
-
7  
-Overview
8  
---------
9  
-
10  
-This simple package formats dates in a pretty, human readable format.
11  
-
12  
-Requirements
13  
-------------
14  
-
15  
-* Plone_ >= 4.x
16  
-* `five.grok`_ >= 1.2
17  
-
18  
-collective.prettydate is fully compatible with `DateTime 3.0`_ which provides
19  
-a significantly smaller memory footprint.
20  
-
21  
-Introduction
22  
-------------
23  
-
24  
-collective.prettydate is a package that helps developers to solve some
25  
-usability issues associated with the utilization of absolute date formating on
26  
-sites used among different timezones.
27  
-
28  
-When a date is printed as "01/02/2012" it could represent February 1 or
29  
-January 2, depending on the format used. Also, if the site is located on a
30  
-different timezone, it could take you to situations when today's date is
31  
-printed as yesterday, or tomorrow's date.
32  
-
33  
-collective.prettydate represents dates on a relative format so it would be
34  
-printed as "last month" or "2 months ago", which is easier to read and
35  
-understand for most people.
36  
-
37  
-collective.prettydate is specially well suited for sites that produce a lot of
38  
-content, like breaking news.
39  
-
40  
-Usage
41  
------
42  
-
43  
-This product provides a utility which will convert a DateTime object into a
44  
-human readable text.
45  
-
46  
-::
47  
-
48  
-    from zope.component import getUtility
49  
-    from collective.prettydate.interfaces import IPrettyDate
50  
-    date_utility = getUtility(IPrettyDate)
51  
-
52  
-At this point, you can use the 'date' method to convert the DateTime object
53  
-
54  
-::
55  
-
56  
-    from DateTime import DateTime
57  
-    today = DateTime()
58  
-    str_date = date_utility.date(today)
59  
-
60  
-in previous example, 'str_date' will be "now"
61  
-
62  
-'date' method also allows 2 additional parameters: 'short' and 'asdays' which
63  
-will modify the output to be in short format ('h' instead of 'hours', 'd'
64  
-instead of 'days', etc) and whole days (it will use 'today' instead of any
65  
-amount of seconds, minutes or hours for current day). They both default to
66  
-"False".
67  
-
68  
-Timezones
69  
-^^^^^^^^^
70  
-
71  
-If your server timezone is configured correctly, and the DateTime object
72  
-contains valid timezone info, then the text output will reflect the correct
73  
-time. You do not need to convert date and time between different timezones.
74  
-
75  
-Output examples
76  
-^^^^^^^^^^^^^^^
77  
-
78  
-* '4 hours ago'
79  
-* '4h ago' (short format)
80  
-* 'in 28 minutes'
81  
-* 'in 6 months'
82  
-* 'today'
83  
-* 'last week'
84  
-* 'yesterday'
85  
-* 'last year'
86  
-
87  
-.. _`five.grok`: http://pypi.python.org/pypi/five.grok
88  
-.. _`DateTime 3.0`: http://pypi.python.org/pypi/DateTime
89  
-.. _Plone: http://pypi.python.org/pypi/Plone
90  
-
1  README.rst
Source Rendered
82  README.txt
... ...
@@ -0,0 +1,82 @@
  1
+*********************
  2
+collective.prettydate
  3
+*********************
  4
+
  5
+.. contents:: Table of Contents
  6
+
  7
+Overview
  8
+--------
  9
+
  10
+This simple package formats dates in a pretty, human readable format.
  11
+
  12
+Introduction
  13
+------------
  14
+
  15
+collective.prettydate is a package that helps developers to solve some
  16
+usability issues associated with the utilization of absolute date formating on
  17
+sites used among different timezones.
  18
+
  19
+When a date is printed as "01/02/2012" it could represent February 1 or
  20
+January 2, depending on the format used. Also, if the site is located on a
  21
+different timezone, it could take you to situations when today's date is
  22
+printed as yesterday, or tomorrow's date.
  23
+
  24
+collective.prettydate represents dates on a relative format so it would be
  25
+printed as "last month" or "2 months ago", which is easier to read and
  26
+understand for most people.
  27
+
  28
+collective.prettydate is specially well suited for sites that produce a lot of
  29
+content, like breaking news.
  30
+
  31
+The package is fully compatible with `DateTime 3.0`_ which provides a
  32
+significantly smaller memory footprint.
  33
+
  34
+Usage
  35
+-----
  36
+
  37
+This product provides a utility which will convert a DateTime object into a
  38
+human readable text.
  39
+
  40
+::
  41
+
  42
+    from zope.component import getUtility
  43
+    from collective.prettydate.interfaces import IPrettyDate
  44
+    date_utility = getUtility(IPrettyDate)
  45
+
  46
+At this point, you can use the 'date' method to convert the DateTime object
  47
+
  48
+::
  49
+
  50
+    from DateTime import DateTime
  51
+    today = DateTime()
  52
+    str_date = date_utility.date(today)
  53
+
  54
+in previous example, 'str_date' will be "now"
  55
+
  56
+'date' method also allows 2 additional parameters: 'short' and 'asdays' which
  57
+will modify the output to be in short format ('h' instead of 'hours', 'd'
  58
+instead of 'days', etc) and whole days (it will use 'today' instead of any
  59
+amount of seconds, minutes or hours for current day). They both default to
  60
+"False".
  61
+
  62
+Timezones
  63
+^^^^^^^^^
  64
+
  65
+If your server timezone is configured correctly, and the DateTime object
  66
+contains valid timezone info, then the text output will reflect the correct
  67
+time. You do not need to convert date and time between different timezones.
  68
+
  69
+Output examples
  70
+^^^^^^^^^^^^^^^
  71
+
  72
+* '4 hours ago'
  73
+* '4h ago' (short format)
  74
+* 'in 28 minutes'
  75
+* 'in 6 months'
  76
+* 'today'
  77
+* 'last week'
  78
+* 'yesterday'
  79
+* 'last year'
  80
+
  81
+.. _`DateTime 3.0`: http://pypi.python.org/pypi/DateTime
  82
+
2  setup.py
@@ -8,7 +8,7 @@
8 8
 setup(name='collective.prettydate',
9 9
       version=version,
10 10
       description="Formats dates, numbers, etc. in a pretty, human readable format.",
11  
-      long_description=open("README.rst").read() + "\n" +
  11
+      long_description=open("README.txt").read() + "\n" +
12 12
                        open(os.path.join("docs", "INSTALL.txt")).read() + "\n" +
13 13
                        open(os.path.join("docs", "CREDITS.txt")).read() + "\n" +
14 14
                        open(os.path.join("docs", "HISTORY.txt")).read(),

0 notes on commit cad84ee

Please sign in to comment.
Something went wrong with that request. Please try again.