Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolves #4593 add styling for table header and striping in docbook converter #4421

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/asciidoctor/converter/docbook5.rb
Expand Up @@ -379,7 +379,11 @@ def convert_table node
pgwide_attribute = (node.option? 'pgwide') ? ' pgwide="1"' : ''
frame = 'topbot' if (frame = node.attr 'frame', 'all', 'table-frame') == 'ends'
grid = node.attr 'grid', nil, 'table-grid'
result << %(<#{tag_name = node.title? ? 'table' : 'informaltable'}#{common_attributes node.id, node.role, node.reftext}#{pgwide_attribute} frame="#{frame}" rowsep="#{(%w(none cols).include? grid) ? 0 : 1}" colsep="#{(%w(none rows).include? grid) ? 0 : 1}"#{(node.attr? 'orientation', 'landscape', 'table-orientation') ? ' orient="land"' : ''}>)
stripes = node.attr 'stripes', nil, 'table-stripes'
stripe_style = ("striped-even" if stripes==='even') || ("striped-odd" if stripes==='odd') || nil
header_style = ('headerbg' if node.option? 'headerbg') || nil
tab_style = [stripe_style, header_style].compact.join(',');
result << %(<#{tag_name = node.title? ? 'table' : 'informaltable'}#{common_attributes node.id, node.role, node.reftext}#{pgwide_attribute} frame="#{frame}" rowsep="#{(%w(none cols).include? grid) ? 0 : 1}" colsep="#{(%w(none rows).include? grid) ? 0 : 1}"#{(node.attr? 'orientation', 'landscape', 'table-orientation') ? ' orient="land"' : ''} #{tab_style.empty? ? '' : 'tabstyle="' + "#{tab_style}" +'"'}>)
if node.option? 'unbreakable'
result << '<?dbfo keep-together="always"?>'
elsif node.option? 'breakable'
Expand Down