Skip to content

Commit

Permalink
Added source code syntax highlighting.
Browse files Browse the repository at this point in the history
  • Loading branch information
espenak committed Aug 9, 2009
1 parent 4cb59b2 commit bde8f18
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@
*~
plonetheme.fui.egg-info/
dist/
.DS_Store
19 changes: 17 additions & 2 deletions README.rst
Expand Up @@ -48,6 +48,12 @@ You can install this theme in Plone using buildout.
Bordered image float right|img|bordered-float-right


Code syntax highlighting
------------------------

The theme loads prettify.js (http://code.google.com/p/google-code-prettify/).
Add the *prettify* class to your <pre> blocks to get syntax hightlighting.


Getting the dynamic click-to-edit feature back
----------------------------------------------
Expand All @@ -57,9 +63,18 @@ This feature is disabled with a tal definition in
re-enable it, you can simply remove the entire file.


Release a new version (for developers)
--------------------------------------


For developers
--------------

Release a new version to pypi.python.org with::

~$ python setup.py egg_info -RDb "" sdist upload


You can run plone in the foreground with:

~$ plonectl fg

Note that resources are not added unless you reinstall the product.
6 changes: 6 additions & 0 deletions plonetheme/fui/browser/configure.zcml
Expand Up @@ -50,4 +50,10 @@
layer=".interfaces.IThemeSpecific"
/>

<browser:resourceDirectory
name="plonetheme.fui.javascripts"
directory="javascripts"
layer=".interfaces.IThemeSpecific"
/>

</configure>
23 changes: 23 additions & 0 deletions plonetheme/fui/browser/javascripts/prettify.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions plonetheme/fui/browser/stylesheets/prettify.css
@@ -0,0 +1,30 @@
.str{color:#080}
.kwd{color:#008}
.com{color:#888}
.typ{color:#606}
.lit{color:#066}
.pun{color:#660}
.pln{color:#000}
.tag{color:#008}
.atn{color:#606}
.atv{color:#080}
.dec{color:#606}
pre.prettyprint{
border-color: #ccc;
border-style: solid;
border-width: 1px 1px 1px 6px;
padding: 5px 5px 5px 10px;
margin: 10px 0 10px 20px;
}
@media print{.str{color:#060}
.kwd{color:#006;font-weight:bold}
.com{color:#600;font-style:italic}
.typ{color:#404;font-weight:bold}
.lit{color:#044}
.pun{color:#440}
.pln{color:#000}
.tag{color:#006;font-weight:bold}
.atn{color:#404}
.atv{color:#060}
}

6 changes: 6 additions & 0 deletions plonetheme/fui/profiles/default/cssregistry.xml
Expand Up @@ -28,4 +28,10 @@
cacheable="True" compression="safe" cookable="True"
enabled="1" expression=""/>

<stylesheet title=""
id="++resource++plonetheme.fui.stylesheets/prettify.css"
media="screen" rel="stylesheet" rendering="import"
cacheable="True" compression="safe" cookable="True"
enabled="1" expression=""/>

</object>
5 changes: 5 additions & 0 deletions plonetheme/fui/profiles/default/jsregistry.xml
Expand Up @@ -24,4 +24,9 @@
enabled="True" expression="" inline="False"/>
-->

<javascript
id="++resource++plonetheme.fui.javascripts/prettify.js"
cacheable="True" compression="safe" cookable="True"
enabled="True" inline="False"/>

</object>
Expand Up @@ -63,7 +63,7 @@

<body tal:attributes="class string:${here/getSectionFromURL} template-${template/id};
dir python:test(isRTL, 'rtl', 'ltr')"
tal:define="kss_inline_editable python:False;">
tal:define="kss_inline_editable python:False;" onload="prettyPrint()">
<div id="visual-portal-wrapper">

<div id="portal-top" i18n:domain="plone">
Expand Down
2 changes: 1 addition & 1 deletion setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
import os

version = '2.0.2'
version = '2.1.0'

setup(name='plonetheme.fui',
version=version,
Expand Down

0 comments on commit bde8f18

Please sign in to comment.