Entradas etiquetadas como ‘moinmoin’

MoinMoin, um wiki para você ou para sua empresa

19 Dezembro, 2007 · Deixe um comentário

O MoinMoin também pode ser utilizado como servidor standalone, o nome
desta versão se chama DesktopEdition, não é necessário nenhum software
como apache, mod_python ou banco de dados para fazê-lo funcionar, somente
o Python, recomenda-se a versão 2.4 ou superior.

A última versão do DesktopEdition pode ser encontrada em http://moinmo.in/DesktopEdition,
já testado em plataformas Windows, Unix e Mac OS. Para iniciar o DesktopEdition
configure o moin.py para apontar para localhost na porta 8080 e acesse pelo
seu navegador o endereço http://localhost:8080

Para personalizar o acesso, a imagem do logo e a língua do moin, configure
o wikiconfig.py:

# -*- coding: utf-8 -*-
"MoinMoin - Configuration"
from MoinMoin.multiconfig import DefaultConfig
class Config(DefaultConfig):
sitename = "Meu Wiki"
logo_string = "Meu Wiki"
language_ignore_browser = True
language_default = "pt"
acl_rights_default = u"LeonardoGregianin:read,write,delete,revert,admin User2:read,write User3:read All:nowiki"

Para acessar uma rede local sua ou da sua empresa é necessário criar um script chamado wikiserverconfig.py apontando para porta 80 e um nome para o webserver, por exemplo:

# -*- coding: utf-8 -*-
"MoinMoin - Server Configuration"
from __main__ import DefaultConfig
class Config(DefaultConfig):
port = 80
interface = "10.0.0.1"

e é só :-)

Categorias: moinmoin · python
Etiquetado: ,

Plugin CiteThisPage para MoinMoin

21 Novembro, 2007 · Deixe um comentário

Esse plugin provê detalhes bibliográficos para uma página do MoinMoin. Atualmente suporta estilos de citação para ABNT, Modern Language Association e BibTeX (LaTeX).

import re
from MoinMoin.Page import Page
from MoinMoin.action import ActionBase

class CiteThisPage(ActionBase):
def __init__(self, pagename, request):
ActionBase.__init__(self, pagename, request)

def get_form_html(self, buttons_html):
page = Page(self.request, self.pagename)

# URL
revision = page.current_rev()
interwiki = self.request.getBaseURL()
url = ‘%s%s?action=recall&rev=%i’ % (interwiki, page.url(self.request), revision)

# Date of last revision
time = page.mtime_printable(self.request)
date = re.search(“(?P<date>.+?) (?P<time>.+?)”, time)

# Site name
publisher = interwiki.split(“http://”)[1].capitalize()
if publisher.startswith(“www.”):
publisher = interwiki.split(“http://www.”)[1].capitalize()

_ = self._
cite = {
‘comment1′: (_(“Page name”)),
‘comment2′: (_(“Publisher”)),
‘comment3′: (_(“Permanent URL”)),
‘comment4′: (_(“Date of last revision”)),
‘comment5′: (_(“Bibliographic details for”)),
‘comment6′: (_(“Citation styles”)),
‘comment7′: (_(“Available in”)),
‘comment8′: “%s” % self.pagename,
‘comment9′: “%s” % publisher,
‘comment10′: “%s” % url,
‘comment11′: “%s” % date.group(“date”), # year-month-day
‘comment12′: “%s” % date.group(“date”).split(“-”)[0], # year
}

return “”"
<strong>%(comment5)s %(comment8)s</strong><br />
<tr>
<td class=”label”><label>%(comment1)s: %(comment8)s</label></td><br />
<td class=”label”><label>%(comment2)s: <i>%(comment9)s</i></label></td><br />
<td class=”label”><label>%(comment3)s: %(comment10)s</label></td><br />
<td class=”label”><label>%(comment4)s: %(comment11)s</label></td><br />
</tr>
<br />
<strong>%(comment6)s:</strong><br />
<br />
<tr>
<strong>ABNT:</strong><br />
<td class=”label”><label><i>%(comment9)s</i>. %(comment7)s <label>%(comment10)s. %(comment4)s: %(comment11)s.</label>
</td><br />
</tr>
<br />
<tr>
<strong>Modern Language Association:</strong><br />
<td class=”label”><label>”%(comment8)s”. <i>%(comment9)s</i>. %(comment11)s %(comment7)s %(comment10)s</label>.
</td><br />
<tr>
<br />
<tr>
<strong>BibTeX:</strong><br />
<td class=”label”><label>
@misc{ wiki:xxx,<br />
author = “%(comment9)s”,<br />
title = “%(comment8)s”,<br />
year = “%(comment12)s”,<br />
url = “\url{%(comment10)s}”,<br />
note = “[Online; "%(comment11)s"]“}<br />
</td><br />
<tr>
“”" % cite

def execute(pagename, request):
CiteThisPage(pagename, request).render()

Categorias: moinmoin · python
Etiquetado: ,