IntroductionInstallationLimitations of the "file" protocolFrequently asked questionsSyntax, keywords and built-in functionsStandard distributionimport implementationBrython packagesBrowser interface
Introduction - DOM API
Creating a document Accessing elements Attributes, properties and methods Events Mouse events Keyboard events Focus events Drag events Query string Interactions with Javascript Brython-specific built-in modules
browser
browser.aio browser.ajax browser.html browser.local_storage browser.markdown browser.object_storage browser.session_storage browser.svg browser.template browser.timer browser.webcomponent browser.websocket browser.worker Widgets browser.widgets.dialog browser.widgets.menu interpreter javascript Working with BrythonCookbook |
module browser.markdownmarkdown is a mode of text formatting adapted to publication on Internet, more simple to edit than HTML. A complete description is available on the markdown site. The module markdown is a slightly adapted version to enrich the rendering options:
<PRE> element with the text as class name (<PRE class="python"> )
The module exposes a single function :
mark( src)
src is a string holding text formatted with the markdown syntax. The function returns a 2-element tuple :The example below shows how to get the content of a markdown file at address url, fill a zone in the document with the matching HTML code, and run all the scripts in the page. This technique is used in these documentation pages. from browser import document, markdown mk, scripts = markdown.mark(open(url).read()) document['zone'].html = mk for script in scripts: exec(script, globals()) </blockquote> |