Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# -*- coding: utf-8 -*-
2"""
3@file
4@brief Some functions about HTML
5"""
6import base64
9def html_in_frame(htext, style="width:100%;height:100%;"):
10 """
11 Inserts :epkg:`HTML` text into a frame in binary format.
13 @param htext string to clean
14 @param style HTML style
15 @return HTML string
16 """
17 html = "data:text/html;base64," + base64.b64encode(htext.encode('utf8')).decode('utf8') # noqa
18 return '<iframe src="{html}" style="{style}"></iframe>'.format(html=html, style=style)