Commits

mitsuhiko  committed 31ddf15

finished docs

  • Participants
  • Parent commits 53cd730
  • Branches mitsuhiko

Comments (0)

Files changed (3)

File clevercss.py

                 else:
                     raise ParserError(lineno, 'Syntax error')
 
+        s = s.rstrip(';')
         return self.expr(TokenStream(lineno, parse()))
 
     def expr(self, stream, ignore_comma=False):

File clevercss/builddocs.py

     <style type="text/css">{{ css }}</style>
   </head>
   <body>
-    <div id="header">
-      <h1>CleverCSS</h1>
-      <h2>the pythonic way of webdesign</h2>
-    </div>
-    <div id="page">
-      {{ body }}
+    <div id="wrapper">
+      <div id="header">
+        <h1>CleverCSS</h1>
+        <h2>the pythonic way of webdesign</h2>
+      </div>
+      <div id="page">
+        {{ body }}
+      </div>
     </div>
   </body>
 </html>
 '''
 
 STYLE = u'''\
-highlight_color = #B51F1F
+background_color = #5EDFDF
+highlight_color = #78AD1C
 header_color = white
-header_background = #B51F1F
+header_background = #A7E229
+border_color = #348B8B
+text_color = black
 
 body:
   margin: 0
-  padding: 1.5em 2.4em 2em 2.4em
-  background-color: white
-  color: black
+  padding: 2em 1em 2em 1em
+  background-color: $background_color
+  color: $text_color
   font->
     family: 'Georgia', serif
 
 a:
   color: $highlight_color
+  &:hover:
+    color: $highlight_color.brighten(25)
 
 p:
   text-align: justify
-  line-height: 1.6em
+  line-height: 1.5em
   padding: 0.4em 0 0.4em 0
   margin: 0
 
 li:
   line-height: 1.4em
+  text-align: justify
 
 h1, h2, h3:
   padding: 0
   margin: 0.8em 0 0 0
-  a:
-    color: black
+  a, a:hover:
+    color: $text_color
 
 h2:
   font-size: 1.8em
 pre:
   margin: 0
   padding: 0.8em 1.4em 0.8em 1.4em
+
+tt, pre:
   font->
     family: 'Bitstream Vera Sans Mono', 'Consolas', 'Monaco', monospace
     size: 0.85em
 
+#wrapper:
+  width: 38em
+  margin: 0 auto 0 auto
+  border: 4px solid $border_color
 
 #header:
   padding: 0.5em
 
 #page:
   padding: 0.8em 1.2em
-  max-width: 38em
-  border-left: 2em solid $highlight_color
+  background: white
 '''
 
 

File documentation.rst

 Using The Library
 -----------------
 
-XXX: write me
+Using CleverCSS is straightforward.  If you want to use it from within python
+you can just import `clevercss` and call the `convert()` function with the
+clevercss source code.  If you want to provide defaults for variables you can
+pass it a dict of strings with valid CleverCSS expressions.
+
+Here a small example::
+
+    import clevercss
+    print clevercss.convert('''
+    body:
+      background-color: $background_color
+    ''', {'background_color: 'red.darken(10)'})
+
+If you want to use it from the shell you can use the `clevercss.py` script.
+For usage help use this command::
+
+    clevercss.py --help
 
 
 .. _easy_install: http://peak.telecommunity.com/dist/ez_setup.py