|
Revision 601:5e4fbe9504cd, 458 bytes
(checked in by Stefan Schwarzer <sschwarzer@…>, 4 weeks ago)
|
|
Added/extended module docstrings to simplify life for developers.
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | """ |
|---|
| 5 | Converter for image data. (See `converter.py` for more.) |
|---|
| 6 | """ |
|---|
| 7 | |
|---|
| 8 | import coding |
|---|
| 9 | import config |
|---|
| 10 | import urlpath |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | def html(doc): |
|---|
| 14 | """Return HTML code to embed an image.""" |
|---|
| 15 | image_path = doc.path |
|---|
| 16 | image_url = coding.encode_uri(urlpath.to_url(image_path, config.root)) |
|---|
| 17 | url = "/image%s" % image_url |
|---|
| 18 | doc.html = u'<img src="%s" />' % url |
|---|
| 19 | doc.mime_type = u"text/html" |
|---|
| 20 | return doc |
|---|