summaryrefslogtreecommitdiff
path: root/docutils/transforms
diff options
context:
space:
mode:
authorgoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-06-28 13:49:10 +0000
committergoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2005-06-28 13:49:10 +0000
commitfb247a2c98d8fffdca2a6ede5235f1b9e28a27ae (patch)
tree0c18b880cd8a8dbf7e08303b2b3a4c253d590261 /docutils/transforms
parent3266e3acfa404e8967106e13c0b48168f3ab2fe4 (diff)
downloaddocutils-fb247a2c98d8fffdca2a6ede5235f1b9e28a27ae.tar.gz
Added ``_stylesheet_required`` internal setting, docutils.transforms.html.StylesheetCheck transform, docs, tests, and support.
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@3617 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/transforms')
-rw-r--r--docutils/transforms/html.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/docutils/transforms/html.py b/docutils/transforms/html.py
new file mode 100644
index 000000000..202fab37d
--- /dev/null
+++ b/docutils/transforms/html.py
@@ -0,0 +1,30 @@
+# Author: David Goodger
+# Contact: goodger@python.org
+# Revision: $Revision$
+# Date: $Date$
+# Copyright: This module has been placed in the public domain.
+
+"""
+Transforms specific to the HTML writer.
+"""
+
+__docformat__ = 'reStructuredText'
+
+from docutils import nodes, utils
+from docutils.transforms import Transform, TransformError
+
+
+class StylesheetCheck(Transform):
+
+ """Check for a proper stylesheet setting."""
+
+ default_priority = 420
+
+ def apply(self):
+ if ( self.document.settings._stylesheet_required
+ and not utils.get_stylesheet_reference(self.document.settings)):
+ self.document.reporter.warning(
+ 'No stylesheet path or URI given. Use the --stylesheet '
+ 'or --stylesheet-path option to specify the location of '
+ 'default.css (in the tools/stylesheets/ directory of the '
+ 'Docutils distribution).')