Permalink
Browse files

Update for 0.14

  • Loading branch information...
SimonSapin committed Aug 3, 2012
1 parent 4384cb9 commit c6b23e743103fe2b5b9cef8a13453d24b8264349
Showing with 63 additions and 39 deletions.
  1. +4 −4 pages/features.rst
  2. +43 −35 pages/install.rst
  3. +12 −0 pages/using.rst
  4. +4 −0 static/css/style.css
View
@@ -6,7 +6,7 @@ Documentation
* `Hacking </hacking/>`_
* **Features**
-This page is for WeasyPrint 0.13. See the changelog_ for older versions.
+This page is for WeasyPrint 0.14. See the changelog_ for older versions.
.. _changelog: https://github.com/Kozea/WeasyPrint/blob/master/CHANGES
@@ -30,6 +30,7 @@ Many HTML elements are implemented in CSS through the HTML5
Some elements need special treatment:
+* The ``<base>`` element, if present, determines the base for relative URLs.
* CSS stylesheets can be embedded in ``<style>`` elements or linked by
``<link rel=stylesheet>`` elements.
* ``<img>``, ``<embed>`` or ``<object>`` elements accept images either
@@ -71,17 +72,15 @@ CSS 2.1
The `CSS 2.1`_ features listed here are **not** supported:
-* Outlines_
* On tables: `empty-cells`_ and `visibility: collapse`_.
* Minimum and maximum width_ and height_ on table-related boxes and
page-margin boxes.
* Conforming `font matching algorithm`_. Currently ``font-family``
is passed as-is to Pango.
* Right-to-left or `bi-directional text`_.
(May *kind of* work within uninterrupted text thanks to Pango)
-* `System colors`_. They are deprecated in CSS 3
+* `System colors`_ and `system fonts`_. The former are deprecated in CSS 3
-.. _Outlines: http://www.w3.org/TR/CSS21/ui.html#dynamic-outlines
.. _CSS 2.1: http://www.w3.org/TR/CSS21/
.. _empty-cells: http://www.w3.org/TR/CSS21/tables.html#empty-cells
.. _visibility\: collapse: http://www.w3.org/TR/CSS21/tables.html#dynamic-effects
@@ -90,6 +89,7 @@ The `CSS 2.1`_ features listed here are **not** supported:
.. _font matching algorithm: http://www.w3.org/TR/CSS21/fonts.html#algorithm
.. _Bi-directional text: http://www.w3.org/TR/CSS21/visuren.html#direction
.. _System colors: http://www.w3.org/TR/CSS21/ui.html#system-colors
+.. _system fonts: http://www.w3.org/TR/CSS21/fonts.html#propdef-font
To the best of our knowledge, everything else that applies to the
print media **is** supported. Please `report a bug`_ if you find this list
View
@@ -32,16 +32,16 @@ WeasyPrint has been packaged for some Linux distributions:
For other distributions or if you want to install it yourself,
-WeasyPrint 0.13 depends on:
+WeasyPrint 0.14 depends on:
* CPython_ 2.6, 2.7 or 3.2
* Either:
- PyGTK_ and its dependencies.
This is available in more distributions but only works on Python 2.x
and requires the whole GTK+ stack.
- - Pango_ >= 1.29.3, pycairo_ and PyGObject_ 3.x with introspection data
- for Pango and cairo.
+ - Pango_ >= 1.29.3, pycairo_ and GdkPixbuf_ >= 2.25\ [#]_
+ with introspection data for each, as well as PyGObject_ 3.x.
This works on all supported Python version and is lighter on dependencies,
but requires fairly recent versions.
@@ -56,6 +56,7 @@ cairo >= 1.12 is best but older versions should work too.\ [#]_
.. _CPython: http://www.python.org/
.. _Pango: http://www.pango.org/
.. _pycairo: http://cairographics.org/pycairo/
+.. _GdkPixbuf: https://live.gnome.org/GdkPixbuf
.. _PyGObject: https://live.gnome.org/PyGObject
.. _PyGTK: http://www.pygtk.org/
.. _lxml: http://lxml.de/
@@ -65,9 +66,9 @@ cairo >= 1.12 is best but older versions should work too.\ [#]_
.. _CairoSVG: http://cairosvg.org/
-We recommend that you install ImageMagick (used by Pystacia), lxml\ [#]_,
-pycairo, Pango and PyGObject/PyGTK with your distribution’s packages
-(see below) and everything else in a virtualenv_ with pip_.
+We recommend that you install PyGTK (or Pango, GdkPixbuf, pycairo and
+PyGObject) and lxml\ [#]_ with your distribution’s packages (see below)
+and everything else in a virtualenv_ with pip_.
.. _virtualenv: http://www.virtualenv.org/
.. _pip: http://pip-installer.org/
@@ -96,7 +97,10 @@ If everything goes well, you’re ready to `start using </using/>`_ WeasyPrint!
Otherwise, please copy the full error message and `report the problem
</community/>`_.
-.. [#] The test suite passes on 1.8 and 1.10 with some tests marked as
+.. [#] GdkPixbuf is actually optional. Without it, PNG is the only
+ supported raster image format: JPEG, GIF and others are not available.
+
+.. [#] The test suite passes on cairo 1.8 and 1.10 with some tests marked as
“expected failures” due to bugs or behavior changes in cairo.
.. [#] Alternatively, install lxml with pip but make sure you have libxml2
@@ -106,62 +110,66 @@ Otherwise, please copy the full error message and `report the problem
.. [#] Symbolic links to the system packages in the virtualenv’s
``site-packages`` directory should work.
-Debian Wheezy, Ubuntu 12.04 Precise or more recent
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. code-block:: sh
+Debian / Ubuntu
+~~~~~~~~~~~~~~~
- sudo apt-get install imagemagick python-lxml python-cairo gir1.2-pango-1.0 python-gi python-gi-cairo
+With PyGTK (Python 2 only):
+.. code-block:: sh
-Ubuntu 11.10 Oneiric
-~~~~~~~~~~~~~~~~~~~~
+ sudo apt-get install python-gtk2 python-lxml
-``python-gi`` is named ``python-gobject`` instead:
+… or with PyGObject (Debian Wheezy, Ubuntu 12.04 Precise or more recent)
+on Python 2:
.. code-block:: sh
- sudo apt-get install imagemagick python-lxml python-cairo gir1.2-pango-1.0 python-gobject python-gobject-cairo
-
-Debian 6 Squeeze, Ubuntu 11.04 Natty or older
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ sudo apt-get install gir1.2-pango-1.0 gir1.2-gdkpixbuf-2.0 python-gi-cairo python-lxml
-PyGObject 3 is not available or Pango not recent enough for introspection,
-use PyGTK instead:
+On Python 3:
.. code-block:: sh
- sudo apt-get install imagemagick python-lxml python-gtk2
+ sudo apt-get install gir1.2-pango-1.0 gir1.2-gdkpixbuf-2.0 python3-gi-cairo python3-lxml
+
Mac OS X
~~~~~~~~
-With Macports:
+With Macports (adjust the ``py27`` part for other Python versions),
+with PyGTK:
+
+.. code-block:: sh
+
+ sudo port install py27-gtk py27-lxml
+
+… or with PyGObject:
+
+.. code-block:: sh
+
+ sudo port install pango gdk-pixbuf2 py27-gobject3 py27-cairo py27-lxml
+
+With Homebrew:
.. code-block:: sh
- sudo port install ImageMagick pango py27-gobject3 py27-cairo py27-lxml
+ brew install pygtk libxml2 libxslt
As of this writing Homebrew has no package
`for PyGObject 3 <https://github.com/mxcl/homebrew/issues/12901>`_ or
`for lxml <https://github.com/mxcl/homebrew/wiki/Acceptable-Formula>`_.
Use PyGTK and install lxml’s own dependencies:
-.. code-block:: sh
-
- brew install imagemagick pygtk libxml2 libxslt
Windows
~~~~~~~
Assuming you already have `Python <http://www.python.org/download/>`_
-2.6 or 2.7, the easiest is to use the `PyGTK all-in-one
-installer <http://www.pygtk.org/downloads.html>`_\ [#]_ and Christoph Gohlke’s
-`lxml unofficial binaries <http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml>`_.
-
-Note however that WeasyPrint 0.13 is buggy and won’t work on Windows. Until
-0.14 is out, use the `git version <https://github.com/Kozea/WeasyPrint/>`_.
+2.6 or 2.7, the easiest is to use Christoph Gohlke’s
+`lxml unofficial binaries <http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml>`_
+and the `PyGTK all-in-one installer <http://www.pygtk.org/downloads.html>`_.
-.. [#] Be careful and see the `README
- <http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/pygtk-all-in-one.README>`_
- if you had anything GTK-related already installed.
+Be careful and see the `README
+<http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/pygtk-all-in-one.README>`_
+if you had anything GTK-related already installed.
View
@@ -36,6 +36,17 @@ More options are available:
Add a user CSS stylesheet to the document. (eg. ``-s print.css``).
Multiple stylesheets are allowed.
+``-m`` or ``--media-type``
+ Set the media type to use for ``@media``. Defaults to ``print``.
+
+``-r`` or ``--resolution``
+ For PNG output only. Set the resolution in PNG pixel per CSS inch.
+ Defaults to 96, which means that PNG pixels match CSS pixels.
+
+``--base-url``
+ Set the base for relative URLs in the HTML input. Defaults to the input’s
+ own URL or the current directory for stdin.
+
``--version``
Show the version number.
@@ -105,6 +116,7 @@ You can also pass optional named arguments:
If not passed explicitly, try to use the input filename, URL, or
``name`` attribute of file objects.
* ``url_fetcher``: override the URL fetcher. (See `below <#url-fetchers>`_.)
+* ``media_type``: the media type to use for ``@media``. Defaults to ``print``.
**Note:** In some cases like ``HTML(string=foo)`` you need to pass ``base_url``
explicitly, or relative URLs will be invalid.
View
@@ -372,3 +372,7 @@ body > footer li a:focus{
background-color: #E70;
box-shadow: 0 0 5px #D60;
}
+
+.ref {
+ font-size: .7em;
+}

0 comments on commit c6b23e7

Please sign in to comment.