[Moin-user] Include text from an external file

Schwols, Keith C keith.c.schwols at intel.com
Thu Aug 3 10:20:31 EDT 2006


I can't recommend this operation for anyone running a public wiki
(unless you put a lot more code to protect what file the user is trying
to include - which is why I still haven't put this up in MacroMarket),
but this is the macro I use on my corporate wiki behind a firewall.

 DESCRIPTION: Outputs the external file's content into page
  [[IncludeFile(externalfilename,<format>)]]

I initially set this up to have a IncludeFileRoot cfg value that would
always be prepended to the user's filename entry.  The purpose was to
restrict including file to a certain directory tree.  This version has
that removed and I just left a comment where it would a good idea to
test the user entry for a valid filename (security stuff).

]<eith


"Divide and rule, a sound motto. Unite and lead, a better one." - Goethe


>-----Original Message-----
>From: moin-user-bounces at lists.sourceforge.net [mailto:moin-user-
>bounces at lists.sourceforge.net] On Behalf Of Andrew Black - lists
>Sent: Tuesday, August 01, 2006 2:57 AM
>To: moin-user at lists.sourceforge.net
>Subject: [Moin-user] Include text from an external file
>
>I would like to include text from a file that is external from the
file.
>Something like
>   [IncludeFile( 'somedir/somefile' )]
>
>Is there are way of doing this
>
>Andrew
>
>-----------------------------------------------------------------------
--
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share
>your
>opinions on IT & business topics through brief surveys -- and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVD
EV
>_______________________________________________
>Moin-user mailing list
>Moin-user at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/moin-user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IncludeFile.py
Type: application/octet-stream
Size: 1961 bytes
Desc: IncludeFile.py
URL: <http://mail.python.org/pipermail/moin-user/attachments/20060803/46a2cc44/attachment.obj>


More information about the Moin-user mailing list