I made a plugin which provides this functionality:
https://github.com/mediatainment/redmine_codebutton/
Hope this helps someone, till redmine implements it by default.
質問
The most Users which use redmine, are programmers. They need the code highlight syntax very, very often which is.
< pre >< code class="LANGUAGE_NAME" >
Some Code
< /code>< /pre>
Maybe someone can suggest a plugin if that exists. Or shows me the code where the editor happens, so I can implement and provide it as plugin.
Many, many, thanks
解決
I made a plugin which provides this functionality:
https://github.com/mediatainment/redmine_codebutton/
Hope this helps someone, till redmine implements it by default.
他のヒント
There is a "PRE" button in the Redmine Wiki toolbar, which partially does, what you want. I.e., it surrounds the code with just <pre>
. At least, you will be able to use this button as a sample...
I'm not aware of any plugin, which comes with the button, you request...
Redmine lets you add any button to the Wiki toolbar. For this you just need to add an element to jsToolBar.prototype.elements
as follows:
jsToolBar.prototype.elements.ruby = {
type: 'button',
title: 'Ruby code',
fn: {
wiki: function() { /* handle it here */ this.encloseLineSelection('<pre><code class="ruby">\n', '\n</code></pre>') }
}
};
See also: javascripts/jstoolbar/textile.js
.
If someone is still have that problem I recently uploaded redmine plugin that replaces built-in coderay with highlightJS. Plugin feature much more markups, very good language autodetection as well as dual language highlighting (i.e http+json in body). Plugin url is:
https://github.com/dominch/redmine_highlightjs
Language autodetection works great, so probably You will no longer need to input specific language class. Plugin takes care about that and just work!