Skip to content

Commit

Permalink
Control font style of first line of abstract from theme
Browse files Browse the repository at this point in the history
  • Loading branch information
nawroth committed Dec 22, 2015
1 parent 6430ea6 commit d510cc7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/themes/default-theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ abstract:
font_size: $lead_font_size
line_height: $lead_line_height
font_style: italic
first_line_font_style: bold
admonition:
border_color: $base_border_color
border_width: $base_border_width
Expand Down
7 changes: 5 additions & 2 deletions lib/asciidoctor-pdf/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,11 @@ def convert_abstract node
add_dest_for_block node if node.id
pad_box @theme.abstract_padding do
theme_font :abstract do
# FIXME control first_line_options using theme
prose_opts = { line_height: @theme.abstract_line_height, first_line_options: { styles: [font_style, :bold] } }
prose_opts = { line_height: @theme.abstract_line_height }
# FIXME control more first_line_options using theme
if (first_line_font_style = @theme.abstract_first_line_font_style.to_sym) && first_line_font_style != font_style
prose_opts[:first_line_options] = { styles: [font_style, first_line_font_style] }
end
# FIXME make this cleaner!!
if node.blocks?
node.blocks.each do |child|
Expand Down

0 comments on commit d510cc7

Please sign in to comment.