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

Add support for quoted text attributes (prefixed in square brackets) #350

Open
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
6 participants
@Hextremist
Copy link

Hextremist commented Nov 2, 2015

Supports all the types listed in the examples for asciidoc:
http://www.methods.co.nz/asciidoc/chunked/ch10.html
I.e. work for underline, overline, line-through, colors, big and
small.

@Hextremist

This comment has been minimized.

Copy link

Hextremist commented Nov 2, 2015

Hi, I did some changes to make underline, colors etc work as for the Asciidoctor HTML format.

@Hextremist Hextremist closed this Nov 2, 2015

@Hextremist Hextremist reopened this Nov 2, 2015

@Hextremist Hextremist force-pushed the Hextremist:more_formatting branch from 30c3a15 to d71c846 Nov 19, 2015

@Hextremist Hextremist force-pushed the Hextremist:more_formatting branch from d71c846 to ec11657 Dec 3, 2015

@Hextremist Hextremist force-pushed the Hextremist:more_formatting branch from ec11657 to d71c846 Dec 19, 2015

Hextremist added some commits Nov 1, 2015

Add support for quoted text attributes (prefixed in square brackets)
Supports all the types listed in the examples for asciidoc:
http://www.methods.co.nz/asciidoc/chunked/ch10.html
I.e. work for underline, overline, line-through, colors, big and
small.
Make colors hash an instance variable of Transform
Instead of creating the hash on every invocation of apply(), it is created
once.
Fancier looking kbd
The keyboard keys now look more like keys.

@Hextremist Hextremist force-pushed the Hextremist:more_formatting branch 2 times, most recently from dde6407 to 53612bd Jan 16, 2016

@mojavelinux mojavelinux force-pushed the asciidoctor:master branch from 58a3685 to c4441ae May 14, 2016

@igagis

This comment has been minimized.

Copy link

igagis commented Jun 1, 2016

Absence of line-through and underline and red and blue colours blocks the use of potential asciidoc-diff utility with asciidoctor-pdf

@git-ere

This comment has been minimized.

Copy link

git-ere commented Oct 28, 2016

I came over the same problem:
stackoverflow discussion

I've tried to fix this issue and I think I've got a solution. As I never did Ruby programming neither know the ascidoctor architecture, below I describe the code changes I did.

Pls feel free to comment.
changed line 1817 of converter.rb
old:
quoted_text = %(<span class="#{role}">#{open}#{node.text}#{close}</span>)

new:

style = add_style style, role, 'font-style', 'font_style'
  style = add_style style, role, 'font-size', 'font_size'
  style = add_style style, role, 'color', 'font_color'
  quoted_text = %(<span style="#{style}">#{open}#{node.text}#{close}</span>)

added method in converter.rb

def add_style (style, role, styleName, *themeName)
    themeName = themeName ? themeName.first : styleName
    value = eval %(@theme.#{role}_#{themeName})
    if value
       if style
         style = %(#{style};)
       end
       style = %(#{style}#{styleName}:#{value})
    end
    return style
  end

added lines in transform.rb

added after line 225

  when 'font-size'
    unless fragment[:size]
      fragment[:size] = pvalue
    end

I've just tested with some styling properties. If ok all of theming-guide should propably being added.

@git-ere git-ere referenced this pull request Nov 3, 2016

Open

How to use role in PDF #652

@mojavelinux mojavelinux force-pushed the asciidoctor:master branch from 17b3a0f to d8ad7cd Nov 23, 2016

@mojavelinux mojavelinux force-pushed the asciidoctor:master branch 3 times, most recently from 0505610 to 48915ca Dec 12, 2016

@mojavelinux

This comment has been minimized.

Copy link
Member

mojavelinux commented Dec 13, 2016

I'm cherry picking from this pull request to make the changes easier to track. I've implemented the underline and line-through roles thus far.

I'm planning to map big and small to the base_font_size_large and base_font_size_small theme settings.

I'm still thinking about the best way to handle the colors.

@mojavelinux mojavelinux force-pushed the asciidoctor:master branch from c7fabd2 to 57d87df Feb 6, 2017

@Patola

This comment has been minimized.

Copy link

Patola commented Sep 30, 2017

Any progress on the color dealing in asciidoctor?

@jlozadad

This comment has been minimized.

Copy link

jlozadad commented Jan 20, 2018

any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment