17 'odt' : {'mimetype': 'application/vnd.oasis.opendocument.text', 'extension':'odt'}, |
17 'odt' : {'mimetype': 'application/vnd.oasis.opendocument.text', 'extension':'odt'}, |
18 'doc' : {'mimetype': 'application/msword', 'extension':'doc'}, |
18 'doc' : {'mimetype': 'application/msword', 'extension':'doc'}, |
19 'docx' : {'mimetype': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'extension':'docx'}, |
19 'docx' : {'mimetype': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'extension':'docx'}, |
20 'latex' :{'mimetype': 'text/x-tex', 'extension':'tex'}, |
20 'latex' :{'mimetype': 'text/x-tex', 'extension':'tex'}, |
21 'html' :{'mimetype': 'text/html', 'extension':'html'}, |
21 'html' :{'mimetype': 'text/html', 'extension':'html'}, |
|
22 'epub' :{'mimetype': 'application/epub+zip', 'extension':'epub'}, |
22 # raw export |
23 # raw export |
23 'raw' : {'mimetype': 'text/plain', 'extension':'txt'} |
24 'raw' : {'mimetype': 'text/plain', 'extension':'txt'} |
24 } |
25 } |
25 def content_export2(request, content, title, content_format, format, use_pandoc, download_response): |
26 def content_export2(request, content, title, content_format, format, use_pandoc, download_response): |
26 # TODO : formats must be imported from converters |
27 # TODO : formats must be imported from converters |
159 'odt' : [True , 'application/vnd.oasis.opendocument.text', 'odt'], |
160 'odt' : [True , 'application/vnd.oasis.opendocument.text', 'odt'], |
160 'doc' : [True , 'application/msword', 'odt'], |
161 'doc' : [True , 'application/msword', 'odt'], |
161 'docx' : [True , 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docx'], |
162 'docx' : [True , 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docx'], |
162 'latex' :[True , 'text/x-tex', 'tex'], |
163 'latex' :[True , 'text/x-tex', 'tex'], |
163 'html' :[True , 'text/html', 'html'], |
164 'html' :[True , 'text/html', 'html'], |
|
165 'epub' :[True , 'application/epub+zip', 'epub'], |
164 # raw export |
166 # raw export |
165 'raw' : [True, 'text/plain', 'txt'] |
167 'raw' : [True, 'text/plain', 'txt'] |
166 } |
168 } |
167 HTML_HEADER = u""" |
169 HTML_HEADER = u""" |
168 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
170 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |