Source Code

Source Code

by Peter Saffrey -
Number of replies: 2
I am a lecturer using a Moodle installation at my University. I would like to make use of the Wiki module in a course teaching Python programming. As part of this, I want to embed source code into the Wiki. The problem is that even when I use the "preformatted" style in the editor or manually add "<pre>" tags, I can't get it to present the code literally - when I hit save, it removes the tab-stops in the code section. Anybody who knows Python will know that this destroys the meaning of the code fragments.

Any ideas? What's the point of a "<pre>" if it's going to change it when I hit "save"?

Peter
Average of ratings: -
In reply to Peter Saffrey

Re: Source Code

by Marty Boogaart -
Hi,

I don't know how to defeat the wiki; but, why not just take a snapshot and show the code as an image. If you also want people to have access to the code, then provide a link to download the source file.


Marty

In reply to Marty Boogaart

Re: Source Code

by Peter Saffrey -
That would work, but it's pretty brutal. I have a dozen examples to add and cutting out screenshots of all of them will take a while. It also makes it very unlikely that I can get use contributed examples, rather defeating the purpose of the Wiki.

I'm wondering why the Moodle Wiki has such a problem with source code examples - Wikipedia seems to handle this very cleanly. I've also got problems with the fact that I'm using Python, which produces CamelCase error messages. How do I force Moodle Wiki not to make something a link? I've tried prefixing with ! and enclosing in <nowiki>.

Incidentally, neither of these were in the Moodle documentation, I had to web-bash to find them.

"Defeat"ing the Wiki sounds like an accurate description. I've spent about 15 hours on a 2 page site so far - that's entirely on uploading existing content. It would have taken me less than 2 hours doing it in raw HTML using vi.

Pretty frustrated,

Peter