I would like to emphasize some part of a source when using asciidoc
for instance, I have this portion of text
[source, ruby, numbered]
------------
total_amount, frequent_renter_points = 0, 0
result = "Rental Record for #{name}\n"
@rentals.each do |element|
this_amount = 0
-------------
I would like to make lines 2 to 4 appear differently (another
background or in bold), how can I pass these kind of parameters to the
pigments highlighter
I've followed the hl_lines trail which works well in command line but
I would like to streamline this with my asciidoc workflow.
> I would like to emphasize some part of a source when using asciidoc
> for instance, I have this portion of text
> [source, ruby, numbered] > ------------ > total_amount, frequent_renter_points = 0, 0 > result = "Rental Record for #{name}\n" > @rentals.each do |element| > this_amount = 0 > -------------
> I would like to make lines 2 to 4 appear differently (another > background or in bold), how can I pass these kind of parameters to the > pigments highlighter
There is no built-in for extra parameters for pygmentize, you will have to make a custom conf file containing:
source-style=template="source-highlight-block",presubs=(),postsubs=("callou ts",),posattrs=("style","language","src_numbered"),filter="pygmentize -f html -l {language} {src_numbered?-O linenos=table} {encoding?-O encoding={encoding}}"
> I've followed the hl_lines trail which works well in command line but > I would like to streamline this with my asciidoc workflow.
> thanks in advance
> -- > You received this message because you are subscribed to the Google Groups "asciidoc" group. > To post to this group, send email to asciidoc@googlegroups.com. > To unsubscribe from this group, send email to asciidoc+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/asciidoc?hl=en.
I had to read a little bit about asciidoc configuration files, but it
worked
Here is the configuration setting that I've added to source-highlight-
filter.conf
> On 31 October 2011 08:31, Ramzi Akremi <ramzi.akr...@gmail.com> wrote:
> > Hi all,
> > I would like to emphasize some part of a source when using asciidoc
> > for instance, I have this portion of text
> > [source, ruby, numbered]
> > ------------
> > total_amount, frequent_renter_points = 0, 0
> > result = "Rental Record for #{name}\n"
> > @rentals.each do |element|
> > this_amount = 0
> > -------------
> > I would like to make lines 2 to 4 appear differently (another
> > background or in bold), how can I pass these kind of parameters to the
> > pigments highlighter
> There is no built-in for extra parameters for pygmentize, you will
> have to make a custom conf file containing:
> > I've followed the hl_lines trail which works well in command line but
> > I would like to streamline this with my asciidoc workflow.
> > thanks in advance
> > --
> > You received this message because you are subscribed to the Google Groups "asciidoc" group.
> > To post to this group, send email to asciidoc@googlegroups.com.
> > To unsubscribe from this group, send email to asciidoc+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/asciidoc?hl=en.
I've just committed a patch that adds and 'args' block attribute to source highlight blocks to allow arbitrary parameters to be passed to the source highlighters, so your example can now be done out of the box with:
["source","ruby","numbered",args="-O \"hl_lines=1 10 13\""] ------- the source code -------
> I had to read a little bit about asciidoc configuration files, but it > worked > Here is the configuration setting that I've added to source-highlight- > filter.conf
> On Oct 30, 11:03 pm, Lex Trotman<ele...@gmail.com> wrote: >> On 31 October 2011 08:31, Ramzi Akremi<ramzi.akr...@gmail.com> wrote:
>>> Hi all,
>>> I would like to emphasize some part of a source when using asciidoc
>>> for instance, I have this portion of text
>>> [source, ruby, numbered] >>> ------------ >>> total_amount, frequent_renter_points = 0, 0 >>> result = "Rental Record for #{name}\n" >>> @rentals.each do |element| >>> this_amount = 0 >>> -------------
>>> I would like to make lines 2 to 4 appear differently (another >>> background or in bold), how can I pass these kind of parameters to the >>> pigments highlighter
>> There is no built-in for extra parameters for pygmentize, you will >> have to make a custom conf file containing:
>> with attributes for the extra parameters added.
>> Cheers >> Lex
>>> I've followed the hl_lines trail which works well in command line but >>> I would like to streamline this with my asciidoc workflow.
>>> thanks in advance
>>> -- >>> You received this message because you are subscribed to the Google Groups "asciidoc" group. >>> To post to this group, send email to asciidoc@googlegroups.com. >>> To unsubscribe from this group, send email to asciidoc+unsubscribe@googlegroups.com. >>> For more options, visit this group athttp://groups.google.com/group/asciidoc?hl=en.