PREP 2015 Question Authoring - Archived

Syntax highlighting

Re: Syntax highlighting

by Davide Cervone -
Number of replies: 0
OK, I've found the problem with the extra pre/code block and have fixed it in the copy of PGML.pl in the PREP2015 course.

I've also added the ability to use

``` class
preformatted code
that will be displayed verbatim
with tabs converted to 4 spaces
```
The class is optional, and must consist of alphanumeric characters followed by a newline. The main code follows between the ``` delimiters. It will retain the line breaks and spacing from the PGML source code, and no further PGML commands are performed on the code (so you can't do bold or math or anything like that).

I haven't included any code highlighting javascript myself, but you can do so as you have been doing. Making that part of PGML will require adding the javascript to the WeBWorK distribution and so it will be something I can't easily add locally for this course.

This is not very heavily tested, so let me know if you see anything fishy. I hope this meets your needs.