You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nicola Racco has written another RedCloth CodeRay extension which has more features.
I modified the for_redcloth.rb file so that the user can specify language in a similary way: LANG[SEQUENCE] (where SEQUENCE is in the format :option=value), so all options of the encoder could be specified in SEQUENCE. But it doesn't work.
For example, RedCloth completely ignores: bc[ruby:line_numbers=table:highlight_lines=1,3-5] (I believe that ':', '=', ' ' characters are not allowed).
It could be possible to use another 'work-around' with a syntax like element[LANG_NAME]<!c:SEQUENCE>. For example:
bc[ruby]. <!c:line_numbers=table:highlight_lines=1,2-3>
def a
a = 3
end
In this way the opts[:text] variable will begin with this 'special' tag. - @nicolaracco
There may be options like :wrap and :line_numbers that you don't want the user to control via the markup. They could destroy a wiki page or a blog's comment with that. So, we should only support the options that are really useful and safe.
I don't think additional syntaxes are a good idea. You'd have to choose between something that could easily be the start of some real code, so it gets in the way, or something that is hard to remember. Either way, it doesn't really look integrated with Textile.
My feeling is that we should reduce the user options to a minimum. While I can see the use of :highlight_lines, I doubt somebody would need line numbers, or no line numbers in a specific code snippet. Can you describe a real use case?
Well, for line numbering my blog is a real use case :) In my blog most of the code blocks are about 10/15 lines, so line numbering is unnecessary, but in the post Extending RedCloth with CodeRay, there's a code snippet of 60 lines, and line numbering is useful only in that case.
In any case, beyond line numbering, I also vote for simplicity. The problem is to choose a good position (style, class etc.) for these options.
The solution I proposed in my blog uses only the options 'ln' and 'h' placed in the class attribute, like:
bc[ruby](ln h3 h8 h4_7). code
but it's a rough solution (it hides some css classes), however I think options in that form are 'simple' to remember. Maybe we could use the style attribute:
There's also a completely new implementation of RedCloth https://github.com/jgarber/redcloth-parslet and integration with Redcarpet and such. IMO, just documenting how to use them together might be a good approach.
Nicola Racco has written another RedCloth CodeRay extension which has more features.
From Redmine: http://odd-eyed-code.org/issues/233
The text was updated successfully, but these errors were encountered: