문제

Is it possible to embed code to Trac wiki page straight from source code? I mean code blocks, not links pointing to the source. Like

MyCode.java contents

도움이 되었습니까?

해결책

Look at IncludeMacro which is also able to embed from source repository (keyword source:).

Furthermore you can copy source code to wiki and format it with syntax-highlighting, for example:

{{{
#!python
hello = lambda: "world"
}}}

Read more about it here.

다른 팁

You're using 'code blocks' in a way that makes me think of partial citation.

As falkb pointed out, IncludeMacro is the current best way of embedding Trac (and even external) content into a Trac resource, that is rendered with support for Trac's WikiFormatting. But sadly, there is NO such partial citation capability yet.

You may want to at least request it as enhancement for the aforementioned plugin, and could even push it closer to reality by providing valid use case example - or better: some real code to make it happen. Be prepared to test code, if a patch is proposed or - ideally - if the trunk (development) branch receives changes to make partial citation happen.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top