Skip to content

Commit

Permalink
resolves asciidoctor#582 display title for abstract
Browse files Browse the repository at this point in the history
- display title for abstract
- allow abstract title to be customized by theme
  • Loading branch information
mojavelinux committed Sep 25, 2016
1 parent 5e8c596 commit 954599d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/themes/base-theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ caption_margin_outside: 0
abstract_font_size: 13.5
abstract_line_height: 1.4
abstract_padding: 0
abstract_title_align: center
abstract_title_font_style: bold
admonition_border_color: 'EEEEEE'
admonition_border_width: 0.5
admonition_padding: [0, 12, 0, 12]
Expand Down
6 changes: 6 additions & 0 deletions data/themes/default-theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ abstract:
line_height: $lead_line_height
font_style: italic
first_line_font_style: bold
title:
align: center
font_color: $heading_font_color
font_family: $heading_font_family
font_size: $heading_h4_font_size
font_style: $heading_font_style
admonition:
border_color: $base_border_color
border_width: $base_border_width
Expand Down
34 changes: 34 additions & 0 deletions docs/theming-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,40 @@ The keys in this category control the arrangement and style of the abstract.
(default: 0)
|abstract:
padding: [0, 12, 0, 12]

3+|*Key Prefix:* abstract_title

|align
|<<text-alignments,Text alignment>> +
(default: center)
|sidebar:
title:
align: center

|font_color
|<<colors,Color>>
|sidebar:
title:
font_color: #333333

|font_family
|<<fonts,Font family name>>
|sidebar:
title:
font_family: Noto Serif

|font_size
|<<values,Number>>
|sidebar:
title:
font_size: 13

|font_style
|<<font-styles,Font style>> +
(default: bold)
|sidebar:
title:
font_style: bold
|===

=== Thematic Break
Expand Down
5 changes: 5 additions & 0 deletions lib/asciidoctor-pdf/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ def convert_floating_title node
def convert_abstract node
add_dest_for_block node if node.id
pad_box @theme.abstract_padding do
if node.title?
theme_font :abstract_title do
layout_heading node.title, align: (@theme.abstract_title_align || @theme.base_align).to_sym
end
end
theme_font :abstract do
prose_opts = { line_height: @theme.abstract_line_height }
# FIXME control more first_line_options using theme
Expand Down

0 comments on commit 954599d

Please sign in to comment.