Skip to content

Commit

Permalink
🚡 Toil the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 11, 2023
1 parent 33d461d commit 8dcdb3b
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion docs/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ The default logger is available as ``cssutils.log``. It has the following method
Additional method: ``cssutils.log.setLog(newlog)``: To replace the default log which sends output to ``stderr``.


See also :meth:`cssutils.css.Property.validate` for details on how properties log.
See also :meth:`cssutils.css.Property.validate` for details on how properties log.
2 changes: 1 addition & 1 deletion docs/parse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The parser is reusable.
.. autoclass:: cssutils.CSSParser
:members:
:inherited-members:


The URL Fetcher
---------------
Expand Down
82 changes: 41 additions & 41 deletions docs/scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,46 +114,46 @@ programmatic use
----------------
example::

>>> from cssutils.script import csscombine
>>> proxypath = 'sheets/import.css'
>>> print csscombine(path=proxypath, sourceencoding=None, targetencoding='utf-8', minify=False)
INFO Combining files from None
INFO Processing @import u'import/import2.css'
INFO Processing @import u'../import3.css'
INFO @import: Adjusting paths for u'../import3.css'
INFO Processing @import u'import-impossible.css'
INFO @import: Adjusting paths for u'import-impossible.css'
WARNING Cannot combine imported sheet with given media as other rules then comments or stylerules found cssutils.css.CSSNamespaceRule(namespaceURI=u'y', prefix=u''), keeping u'@import "import-impossible.css" print;'
INFO @import: Adjusting paths for u'import/import2.css'
INFO Using target encoding: 'utf-8'
@charset "utf-8";
/* START @import "import/import2.css" */
@import "import-impossible.css" print;
/* START @import "../import3.css" */
/* import3 */
.import3 {
/* from ./import/../import3.css */
background: url(images/example3.gif);
background: url(images/example3.gif);
background: url(import/images2/example2.gif);
background: url(import/images2/example2.gif);
background: url(images/example3.gif)
}
/* START @import "import-impossible.css" */
.import2 {
/* sheets/import2.css */
background: url(http://example.com/images/example.gif);
background: url(//example.com/images/example.gif);
background: url(/images/example.gif);
background: url(import/images2/example.gif);
background: url(import/images2/example.gif);
background: url(images/example.gif);
background: url(images/example.gif)
}
.import {
/* ./import.css */
background-image: url(images/example.gif)
}
>>> from cssutils.script import csscombine
>>> proxypath = 'sheets/import.css'
>>> print csscombine(path=proxypath, sourceencoding=None, targetencoding='utf-8', minify=False)
INFO Combining files from None
INFO Processing @import u'import/import2.css'
INFO Processing @import u'../import3.css'
INFO @import: Adjusting paths for u'../import3.css'
INFO Processing @import u'import-impossible.css'
INFO @import: Adjusting paths for u'import-impossible.css'
WARNING Cannot combine imported sheet with given media as other rules then comments or stylerules found cssutils.css.CSSNamespaceRule(namespaceURI=u'y', prefix=u''), keeping u'@import "import-impossible.css" print;'
INFO @import: Adjusting paths for u'import/import2.css'
INFO Using target encoding: 'utf-8'
@charset "utf-8";
/* START @import "import/import2.css" */
@import "import-impossible.css" print;
/* START @import "../import3.css" */
/* import3 */
.import3 {
/* from ./import/../import3.css */
background: url(images/example3.gif);
background: url(images/example3.gif);
background: url(import/images2/example2.gif);
background: url(import/images2/example2.gif);
background: url(images/example3.gif)
}
/* START @import "import-impossible.css" */
.import2 {
/* sheets/import2.css */
background: url(http://example.com/images/example.gif);
background: url(//example.com/images/example.gif);
background: url(/images/example.gif);
background: url(import/images2/example.gif);
background: url(import/images2/example.gif);
background: url(images/example.gif);
background: url(images/example.gif)
}
.import {
/* ./import.css */
background-image: url(images/example.gif)
}


script use
Expand All @@ -170,4 +170,4 @@ Options:
-t TARGETENCODING, --targetencoding=TARGETENCODING
encoding of output, defaulting to "UTF-8"
-m, --minify saves minified version of combined files, defaults to
False
False
22 changes: 11 additions & 11 deletions docs/serialize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ serializing CSS
===============
To serialize any stylesheet use::

print sheet.cssText
print sheet.cssText

Also most other objects have a similar property which contains the *text* content of each object. Some use a slightly different name (e.g. ``selectorText``) but all use the global serializer::

>>> sheet = cssutils.parseString('a, b { color: green }')
>>> print sheet.cssRules[0].cssText
a, b {
color: green
}
>>> print sheet.cssRules[0].selectorText
a, b
>>> print sheet.cssRules[0].selectorList[1].selectorText
b
>>> sheet = cssutils.parseString('a, b { color: green }')
>>> print sheet.cssRules[0].cssText
a, b {
color: green
}
>>> print sheet.cssRules[0].selectorText
a, b
>>> print sheet.cssRules[0].selectorList[1].selectorText
b


.. _Preferences:
Expand Down
2 changes: 1 addition & 1 deletion docs/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A single and **experimental** setting currently only:

It is possible to at least parse sheets with Microsoft only property values for
``filter`` which start with ``progid:DXImageTransform.Microsoft.[...](``.

To enable these you need to set::

>>> from cssutils import settings
Expand Down

0 comments on commit 8dcdb3b

Please sign in to comment.