aboutsummaryrefslogtreecommitdiffstats
path: root/screenplain/export/html.py
diff options
context:
space:
mode:
Diffstat (limited to 'screenplain/export/html.py')
-rw-r--r--screenplain/export/html.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/screenplain/export/html.py b/screenplain/export/html.py
index 1f88e64..81c0f8b 100644
--- a/screenplain/export/html.py
+++ b/screenplain/export/html.py
@@ -18,19 +18,22 @@ class tag(object):
>>> import sys
>>> from __future__ import with_statement
>>> with tag(sys.stdout, 'div'):
- ... sys.stdout.write('hello')
+ ... print('hello')
...
- <div>hello</div>
+ <div>hello
+ </div>
Adding classes to the element is possible:
>>> with tag(sys.stdout, 'div', classes=['action']):
- ... sys.stdout.write('hello')
- <div class="action">hello</div>
+ ... print('hello')
+ <div class="action">hello
+ </div>
>>> with tag(sys.stdout, 'div', classes=['action', 'centered']):
- ... sys.stdout.write('hello')
- <div class="action centered">hello</div>
+ ... print('hello')
+ <div class="action centered">hello
+ </div>
"""
def __init__(self, out, tag, classes=None):