Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#635 closed defect (fixed)

[merge]:code_block directive to rst

Reported by: tonib Owned by: Jonas Borgström
Priority: normal Milestone:
Component: wiki system Version: 0.7.1
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:

Description

Hi,

I am mainly writing in rst wiki syntax. But one of the things missing in this is to syntax highlight code block.

In the trac wiki syntax this is possible with the {{{ #!cpp }}} syntax.

I looked around on the net and found a solution in the leo project. They have introduced a code_block directive. So one writes

.. code_block:: Python

To get a code_block with python syntax.

I have attached how they implement it in leo. It isn't very complex. I dont know how to integrate it in trac.

Leo is distributed under a python license which is a BSD style license. So it should be no problems to use it in trac.

Attachments (2)

code_block_directive.py (2.6 KB ) - added by anonymous 15 years ago.
syntaxhiglightning_rst.patch (2.5 KB ) - added by anonymous 15 years ago.

Download all attachments as: .zip

Change History (6)

by anonymous, 15 years ago

Attachment: code_block_directive.py added

comment:1 by toni, 15 years ago

I added the directive.

The only changes that were needed to do was in trac/wikimacros/rst.py

I've attached the patch.

If you include it the wiki should be updated. I can do it but I would need to know if the patch will be included into the tree.

/T

by anonymous, 15 years ago

comment:2 by anonymous, 15 years ago

Bigger patch including this is in #655

comment:3 by anonymous, 15 years ago

Summary: code_block directive to rst[merge]:code_block directive to rst

comment:4 by Jonas Borgström, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in [847].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.