Version 10 (modified by rjollos, 4 years ago) (diff)

Clarification in example

Code example box with syntax highlighting


The CodeExampleMacro renders a code example box that supports syntax highlighting. It support three types of examples: simple, correct, and incorrect. The SELECT ALL link highlights all of the code in the box to simplify the copy and paste action.

All rights reserved by Codedgers Inc.

Bugs/Feature Requests

Existing bugs and feature requests for CodeExampleMacro are here.

If you have any issues, create a new ticket.


Download the zipped source from here.


You can check out CodeExampleMacro from here using Subversion, or browse the source with Trac.


The simple example:

    def apply_timer(self):
        timer = QTimer(self)
        self.connect(timer, SIGNAL('timeout()'), self.update_statusbar)

will be rendered as:

The simple example image.

The incorrect example:

    def create_hint_list(self):

will be rendered as:

The incorrect example image.

The correct example:

    def update_statusbar(self):
        self.combo_box.insertItem(0, self.hints.get_current_hint())

will be rendered as:

The correct example image.

The is also support for getting sources from the repository using CodeExamplePath, BadCodeExamplePath, GoodCodeExamplePath.

regex="def update_statusbar"

will be rendered as:

The correct example image.

Parameters for *Path macros:

  • path - a file in the repository
  • regex - (optional) a regular expression indicates which to start getting
  • lines - (optional) limits number of lines of code to get

Recent Changes

[11775] by rjollos on 2012-07-25 09:01:47
Part of [11766].
[11766] by rjollos on 2012-07-24 06:33:37
Renamed 0.11 directory to trunk.
[10843] by rjollos on 2011-10-27 08:17:57
Adding configuration file that results in svn revision info being added to the egg file.


Author: nuald
Maintainer: nuald

Attachments (7)

Download all attachments as: .zip