Edgewall Software

Ticket #635 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[merge]:code_block directive to rst

Reported by: tonib Owned by: jonas
Priority: normal Milestone:
Component: wiki system Version: 0.7.1
Severity: normal Keywords:
Cc:

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

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

Change History

Changed 4 years ago by anonymous

Changed 4 years ago by toni

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

Changed 4 years ago by anonymous

Changed 4 years ago by anonymous

Bigger patch including this is in #655

Changed 4 years ago by anonymous

  • summary changed from code_block directive to rst to [merge]:code_block directive to rst

Changed 4 years ago by jonas

  • status changed from new to closed
  • resolution set to fixed

Fixed in [847].

Add/Change #635 ([merge]:code_block directive to rst)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.