Opened 20 years ago
Closed 20 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: | |||
Internal 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)
Change History (6)
by , 20 years ago
Attachment: | code_block_directive.py added |
---|
comment:1 by , 20 years ago
by , 20 years ago
Attachment: | syntaxhiglightning_rst.patch added |
---|
comment:3 by , 20 years ago
Summary: | code_block directive to rst → [merge]:code_block directive to rst |
---|
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