My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/python
# $Id:$

text='''
A treatise on things
====================

This is some *emphasised* and **strong** text. Here is a ``string literal``.

Another paragraph is here.

Here is a code block::

def fib(n):
if n == 0:
return 0
return n + fib(n - 1)

Section 2
=========

This para belongs to section 2.
'''

import pyglet
import rest

document = rest.DocutilsDecoder().decode(text)

window = pyglet.window.Window(resizable=True)
label = pyglet.text.DocumentLabel(document,
valign='top',
multiline=True)

@window.event
def on_resize(width, height):
label.y = height
label.width = width

@window.event
def on_draw():
window.clear()
label.draw()

pyglet.gl.glClearColor(1, 1, 1, 1)
pyglet.app.run()

Change log

3eca4854ef30 by Alex.Holkner on Feb 27, 2008   Diff
Simple docutils decoder.  Missing lists,
links and images (factor out from
html decoder).
Go to: 
Sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 832 bytes, 46 lines
Powered by Google Project Hosting