Changes

Jump to navigation Jump to search
2,679 bytes added ,  22:07, 19 April 2009
Added a sample page
end
</pre>
 
== Sample Page ==
Here is an example how to use these files:
 
<texcode>
\setupcolors[state=start]
\definecolor[colorprettyone] [r=.9, g=.0, b=.0] % red
\definecolor[colorprettytwo] [r=.0, g=.8, b=.0] % green
\definecolor[colorprettythree][r=.0, g=.0, b=.9] % blue
\definecolor[colorprettyfour] [s=0.60] % gray
\definecolor[colorprettyfive] [orange]
\definepalet[colorpretty]
[prettyone=colorprettyone,
prettytwo=colorprettytwo,
prettythree=colorprettythree,
prettyfour=colorprettyfour,
prettyfive=colorprettyfive]
% Apache httpd.conf listings
\installprettytype[APA][APA]
\definetyping [APA] [option=APA]
\definepalet [APAcolorpretty][colorpretty]
\setuptyping [APA] [bodyfont=10pt]
% Python listings
\installprettytype[PY][PY]
\definetyping [PY] [option=PY]
\definepalet [PYcolorpretty] [colorpretty]
\setuptyping [PY] [bodyfont=10pt]
% buildout.cfg listings
\installprettytype[CFG][CFG]
\definetyping [CFG] [option=CFG]
\definepalet [CFGcolorpretty][colorpretty]
\setuptyping [CFG] [bodyfont=10pt]
 
\starttext
\section{httpd.conf sample}
\startAPA
<VirtualHost *>
ServerName www.example.com
ErrorLog /var/log/apache2/error.log
LogLevel error
CustomLog /var/log/apache2/access.log combinedio
 
RewriteEngine On
RewriteLog /var/log/apache2/rewrite.log
 
# allow access to ZMI only from local network
<LocationMatch /manage>
Order Deny,Allow
Deny from all
Allow from 10.
</LocationMatch>
</VirtualHost>
\stopAPA
 
\section{Python sample}
\startPY
#!/usr/local/bin/python
 
import os.path, sys
 
# Just a comment
foo = os.environ.get('FOO')
bar = os.environ.get('BAR')
 
if foo:
foo = os.path.realpath(foobar)
elif bar:
bar = os.path.realpath(bar)
else:
print >> sys.stderr, '''
FOO or BAR need to be set!
'''
 
# Another comment
def test_foobar_title(self):
nothing_special = getattr(self.types, 'FooBar')
\stopPY
 
\section{buildout.cfg sample}
\startCFG
# Use this section to install and configure a Zope
# Enterprise Objects server.
# For options see http://pypi.python.org/pypi/plone.recipe.zope2zeoserver
[zeoserver]
recipe = plone.recipe.zope2zeoserver
zope2-location = ${zope2:location}
zeo-address = ${buildout:zeo-address}
effective-user = zeo
# Put the log, pid and socket files in var/zeoserver
zeo-log = ${buildout:directory}/var/zeoserver/zeoserver.log
pid-file = ${buildout:directory}/var/zeoserver/zeoserver.pid
socket-name = ${buildout:directory}/var/zeoserver/zeo.zdsock
\stopCFG
\stoptext
</texcode>
Anonymous user

Navigation menu