aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/html_paths.py13
-rw-r--r--mammoth/style_reader.py5
2 files changed, 18 insertions, 0 deletions
diff --git a/mammoth/html_paths.py b/mammoth/html_paths.py
new file mode 100644
index 0000000..bc4eba1
--- /dev/null
+++ b/mammoth/html_paths.py
@@ -0,0 +1,13 @@
+import collections
+
+
+def path(elements):
+ return HtmlPath(elements)
+
+
+def element(name):
+ return HtmlPathElement(name)
+
+
+HtmlPath = collections.namedtuple("HtmlPath", ["elements"])
+HtmlPathElement = collections.namedtuple("HtmlPathElement", ["name"])
diff --git a/mammoth/style_reader.py b/mammoth/style_reader.py
new file mode 100644
index 0000000..18c848d
--- /dev/null
+++ b/mammoth/style_reader.py
@@ -0,0 +1,5 @@
+from . import html_paths
+
+
+def read_html_path(string):
+ return html_paths.path([html_paths.element(string)])