= Code example box with syntax highlighting = == Description == Renders a code example box with syntax highlighting. It support three types of examples - simple, correct and incorrect. All rights reserved by [http://codedgers.com Codedgers Inc.] == Bugs/Feature Requests == Existing bugs and feature requests for CodeExampleMacro are [report:9?COMPONENT=CodeExampleMacro here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=CodeExampleMacro&owner=nuald new ticket]. == Download == Download the zipped source from [download:codeexamplemacro here]. == Source == You can check out CodeExampleMacro from [http://trac-hacks.org/svn/codeexamplemacro here] using Subversion, or [source:codeexamplemacro browse the source] with Trac. == Example == The simple example: {{{ {{{ #!CodeExample #!python def apply_timer(self): timer = QTimer(self) self.connect(timer, SIGNAL('timeout()'), self.update_statusbar) timer.start(settings.HINTS_UPDATE_PERIOD) }}} }}} will be rendered as: [[Image(example.png)]] The incorrect example: {{{ {{{ #!BadCodeExample #!python def create_hint_list(self): self.hints.extend(self.globals.get_hint_list()) }}} }}} will be rendered as: [[Image(incorrect_example.png)]] The correct example: {{{ {{{ #!GoodCodeExample #!python def update_statusbar(self): self.combo_box.insertItem(0, self.hints.get_current_hint()) self.combo_box.setCurrentIndex(0) }}} }}} will be rendered as: [[Image(correct_example.png)]] == Recent Changes == [[ChangeLog(codeexamplemacro, 3)]] == Author/Contributors == '''Author:''' [wiki:nuald] [[BR]] '''Contributors:'''