[Pydotorg-redesign] Wiki integration

Johannes Gijsbers jlgijsbers at planet.nl
Fri Aug 15 17:30:22 EDT 2003


The consensus on this list seemed to be that integrating the wiki with the rest
of the site was a desirable thing. I've just taken a first shot at implementing
it, by partially using ht2html. 

Basically, there's a index.ht file in the same directory is and moin_config.py
gets its page footer and header from the processed index.html. The
moin_config.py I used is attached. I also created a new css file for the wiki,
based on ui.css from MoinMoin, which imports ht2html.css for consistency with
the rest of the site.

When I get CVS access, would anyone object when I implement this on python.org?

Johannes

-------------- next part --------------
"""
    MoinMoin - Configuration

    Copyright (c) 2000-2002 by J?rgen Hermann <jh at web.de>
    All rights reserved, see COPYING for details.

    Note that there are more config options than you'll find in
    the version of this file that is installed by default; see
    the module MoinMoin.config for a full list of names and their
    default values.

    Also, the URL http://purl.net/wiki/moin/HelpOnConfiguration has
    a list of config options.

    $Id: moin_config.py,v 1.8 2002/11/25 20:23:09 jhermann Exp $
"""
__version__ = "$Revision: 1.8 $"[11:-2]

# If you run several wikis on one host (commonly called a wiki farm),
# uncommenting the following allows you to load global settings for
# all your wikis. You will then have to create "farm_config.py" in
# the MoinMoin package directory.
#
# from MoinMoin.farm_config import *

# basic options (you normally need to change these)
sitename = 'Python Language Website'
interwikiname = None
data_dir = './data/'
url_prefix = '/wiki'
logo_url = url_prefix + '/img/moinmoin.gif'

# encoding and WikiName char sets
# (change only for outside America or Western Europe)
charset = 'iso-8859-1'
upperletters = "A-Z??????????????????????????????"
lowerletters = "0-9a-z?????????????????????????????????"

# options people are likely to change due to personal taste
show_hosts = 1                          # show hostnames?
nonexist_qm = 1                         # show '?' for nonexistent?
backtick_meta = 1                       # allow `inline typewriter`?
allow_extended_names = 1                # allow ["..."] markup?
edit_rows = 20                          # editor size
max_macro_size = 50                     # max size of RecentChanges in KB (0=unlimited)
bang_meta = 0                           # use ! to escape WikiNames?
show_section_numbers = 1                # enumerate headlines?

# charting needs "gdchart" installed!
# you can remove the test and gain a little speed (i.e. keep only
# the chart_options assignment, or remove this code section altogether)
try:
    import gdchart
    chart_options = {'width': 720, 'height': 400}
except ImportError:
    pass

# values that depend on above configuration settings
logo_string = ''
css_url = url_prefix + '/css/wiki.css' # stylesheet link, or ''
html_head = """
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=%s">
""" % (charset,)

# security critical actions (deactivated by default)
if 0:
    allowed_actions = ['DeletePage', 'AttachFile']

navi_bar = []

ht2html_file = file('index.html')
ht_text = ht2html_file.read()
ht2html_file.close()

def get_text_delimited_by(text, start, end):
    return text[text.index(start):text.index(end)]

title1 = get_text_delimited_by(ht_text,
                               '<!-- start of page table -->',
                               '<!-- start of body cell -->')
title1 += '<td valign="top" width="90%" class="body"><br/>'
title2 = ''

page_footer1 = ''
page_footer2 = '</td>' + get_text_delimited_by(ht_text,
                                               '<!-- end of body cell -->',
                                               '<!-- end of page table -->')

-------------- next part --------------
Other-links:
    <h3>PythonInfo Wiki</h3>
    <li><a href="FrontPage">Wiki FrontPage</a>
    <li><a href="RecentChanges">RecentChanges</a>
    <li><a href="TitleIndex">TitleIndex</a>
    <li><a href="WordIndex">WordIndex</a>
    <li><a href="SiteNavigation">SiteNavigation</a>
    <li><a href="HelpContents">HelpContents</a>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wiki.css
Type: text/css
Size: 1482 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pydotorg-redesign/attachments/20030815/af2a25f5/wiki-0168.css


More information about the Pydotorg-redesign mailing list