Marc Abramowitz
|
d14eee1161
|
Add docutils
Example: If you do this:
```js
languagePluginLoader.then(() => {
// pyodide is now ready to use...
pyodide.loadPackage('docutils').then(() => {
pyodide.runPython(`
import docutils.core
print(docutils.core.publish_string("\`Python <http://www.python.org/>\`_ is **cool**!", writer_name='html5', settings_overrides={'embed_stylesheet': False}).decode('utf-8'))
`);
});
});
```
then the output is:
```
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="utf-8"/>
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title><string></title>
<link rel="stylesheet" href="/lib/python3.7/site-packages/docutils/writers/html5_polyglot/minimal.css" type="text/css" />
<link rel="stylesheet" href="/lib/python3.7/site-packages/docutils/writers/html5_polyglot/plain.css" type="text/css" />
</head>
<body>
<div class="document">
<p><a class="reference external" href="http://www.python.org/">Python</a> is <strong>cool</strong>!</p>
</div>
</body>
</html>
```
|
2019-03-15 08:14:58 -07:00 |