[Ctk-developers] Include source code in MediaWiki
Sascha Zelzer
s.zelzer at dkfz-heidelberg.de
Wed Jan 26 14:05:35 UTC 2011
Hi,
thanks Bill for explaining the VTK approach! I had a closer look at it
and really like the ease how contributors can add examples which are
automatically categorized and tested. I think that would work very well
for small stand-alone programs in CTK too. But considering the current
number of external users/contributors, the system might be overkill for
us right now...
The tutorials I had in mind would consist of probably many source files
and the wiki text could also be split into several pages. I am not sure
yet if I could come up with a standard way for managing the source files
and wiki pages without constraining the tutorial writer too much.
I looked at several MediaWiki extensions which do syntax highlighting
and external file inclusion. Most of them (with external file support)
had some security issues, but the changes they made to existing
extensions to enable the external file feature where pretty simple. So I
figured that we would need a syntax highlighter for our Wiki anyway and
patched the popular
http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
extension to allow highlighting external files (can also highlight CMake
files). The patch does not have the security issues of the available
extensions because it only allows remote URLs to be included. It also
has unique features like embedding only parts of a remote file (certain
line numbers or sections, based on markers inside the file).
What do you think, can we get the CTK Wiki sysadmin to install the
extension? I attached the patch for the trunk version of the
SyntaxHighlight_GeSHi extension and an already patched version of the
extension (bundled with GeSHi) is available here:
ftp://ftp.dkfz-heidelberg.de/outgoing/MediaWiki/
I think that could get us started with some tutorials and we could
migrate to a more sophisticated system like VTK is using later.
- Sascha
On 01/23/2011 01:52 PM, Bill Lorensen wrote:
> With both ITK and VTK we provide examples on a wiki:
> http://vtk.org/Wiki/VTK/Examples
>
> Please note that this process also has the potential for malicious code.
>
> Our users create the examples on the wiki using certain conventions.
> Each night we scrape the wiki, push any changes to a git repository,
> tun regression tests and present the results in a dashboard:
> http://www.cdash.org/CDash/index.php?project=VTKWikiExamples
> http://www.cdash.org/CDash/index.php?project=ITKWikiExamples
>
> When regression baselines are changed, there are automatically updated
> on the wiki.
>
> The process is described here:
> http://vtk.org/Wiki/VTK/Examples#Information_for_Wiki_Examples_Administrators
>
> The sync script is called:
> SyncRepoWithWiki.sh
> and the scraping script is:
> Admin/ScrapeWiki
>
> The scrape wiki script uses a package called mwclient.
>
> Bill
>
> On Sun, Jan 23, 2011 at 6:56 AM, Sascha Zelzer
> <s.zelzer at dkfz-heidelberg.de> wrote:
>> Hi guys,
>>
>> I'd like to start writing some tutorials using our Wiki. The thing is, I
>> will need many source code examples and creating this source code inside the
>> Wiki will likely result in incorrect code in the future (if it compiled at
>> all in the beginning), as the used API may evolve.
>>
>> The best I could come up with so far is having a git repository (wherever)
>> containing the tutorial code and a dartclient building the tutorial code
>> against the current CTK version. Now we only need a way to directly include
>> the code in the Wiki. I found this extension which seems to do exactly that:
>>
>> http://www.mediawiki.org/wiki/Extension:Include
>>
>> I agree that the warnings on top are not that encouraging, but I'm not a
>> webbrowser security expert... do you guys have any other idea how to avoid
>> the separation of tutorial code from the actual source code it is using?
>>
>> For testing purposes, I created a test page which uses the include extension
>> (which will not work of course, until the extension is installed):
>>
>> http://www.commontk.org/index.php/Documentation/IncludeTest
>>
>> Thanks for your feedback,
>>
>> Sascha
>> _______________________________________________
>> Ctk-developers mailing list
>> Ctk-developers at commontk.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SyntaxHighlight_GeSHi_remotefile.patch
Type: text/x-patch
Size: 7240 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20110126/4bf87ddc/attachment.bin>
More information about the Ctk-developers
mailing list