Skip to content

Commit

Permalink
Experiment in using captions for counters
Browse files Browse the repository at this point in the history
  • Loading branch information
James Carlson committed Dec 23, 2014
1 parent ed6cdd5 commit 7c04ed5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/asciidoctor/latex/environment_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,24 @@ def process parent, reader, attrs
puts "$ref2counter: #{attrs['id']} => #{$counter[env_name].to_s}".yellow
end


warn "caption: #{attrs['caption']}".yellow if $VERBOSE
attrs['title'] = env_name.capitalize
caption = attrs.delete 'caption'
warn "caption: #{attrs['caption']}".cyan if $VERBOSE

warn "env_name: #{env_name}".cyan if $VERBOSE
warn "end EnvironmentBlock\n".blue if $VERBOSE

if attrs['role'] == 'code'
create_block parent, :listing, reader.lines, attrs
block = create_block parent, :listing, reader.lines, attrs
else
create_block parent, :environment, reader.lines, attrs
block = create_block parent, :environment, reader.lines, attrs
end

block.assign_caption caption, 'environment'
warn "caption: #{attrs['caption']}".magenta if $VERBOSE
block

end

end
Expand Down

0 comments on commit 7c04ed5

Please sign in to comment.