1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 00:21:15 +03:00

Update for 0.14

This commit is contained in:
Simon Sapin 2012-08-03 18:03:44 +02:00
parent 4384cb9e83
commit c6b23e7431
4 changed files with 64 additions and 40 deletions

View File

@ -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,7 +72,6 @@ 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.
@ -79,9 +79,8 @@ The `CSS 2.1`_ features listed here are **not** supported:
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 File

@ -32,7 +32,7 @@ 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:
@ -40,8 +40,8 @@ WeasyPrint 0.13 depends on:
- 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 distributions 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 distributions 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, youre 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 virtualenvs
``site-packages`` directory should work.
Debian Wheezy, Ubuntu 12.04 Precise or more recent
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Debian / Ubuntu
~~~~~~~~~~~~~~~
With PyGTK (Python 2 only):
.. code-block:: sh
sudo apt-get install imagemagick python-lxml python-cairo gir1.2-pango-1.0 python-gi python-gi-cairo
sudo apt-get install python-gtk2 python-lxml
Ubuntu 11.10 Oneiric
~~~~~~~~~~~~~~~~~~~~
``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
sudo apt-get install gir1.2-pango-1.0 gir1.2-gdkpixbuf-2.0 python-gi-cairo python-lxml
Debian 6 Squeeze, Ubuntu 11.04 Natty or older
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 ImageMagick pango py27-gobject3 py27-cairo py27-lxml
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
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 lxmls 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 Gohlkes
`lxml unofficial binaries <http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml>`_.
2.6 or 2.7, the easiest is to use Christoph Gohlkes
`lxml unofficial binaries <http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml>`_
and the `PyGTK all-in-one installer <http://www.pygtk.org/downloads.html>`_.
Note however that WeasyPrint 0.13 is buggy and wont work on Windows. Until
0.14 is out, use the `git version <https://github.com/Kozea/WeasyPrint/>`_.
.. [#] 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 File

@ -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 inputs
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 File

@ -372,3 +372,7 @@ body > footer li a:focus{
background-color: #E70;
box-shadow: 0 0 5px #D60;
}
.ref {
font-size: .7em;
}