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 #185 autofit font size in listing & literal blocks #186

Merged
merged 1 commit into from
Jun 16, 2015

Conversation

mojavelinux
Copy link
Member

  • autofit (reduce font size) to prevent wrapping in listing & literal blocks
  • prevent font size from being reduced more than *_font_size_min
  • activate autofit if autofit option is specified on block
  • activate autofit if autofit-option attribute is specified on document
  • add autofit example to chronicles.adoc
  • add additional helper methods to core_ext

@mojavelinux
Copy link
Member Author

Note that this fix has some gaps. If the longest line has a callout number or the longest line uses inline formatting, the adjustment will overcompensate, making the text smaller than it has to be. This is a tricky...and expensive...calculation to get precise.

@mojavelinux
Copy link
Member Author

I think for now, this is a good start.

@mojavelinux
Copy link
Member Author

Is source-autofit too specific? Should it be autofit-option instead?

@mojavelinux mojavelinux force-pushed the issue-185 branch 4 times, most recently from 99aff66 to 2c246da Compare June 13, 2015 08:07
@mojavelinux
Copy link
Member Author

I think this is good to go now.

@mojavelinux
Copy link
Member Author

@rlopez133 does this work for you now?

@rlopez133
Copy link

When I try to build my pdf, getting this error:

/root/asciidoctor-pdf/lib/asciidoctor-pdf/converter.rb:10:in `require_relative': /root/asciidoctor-pdf/lib/asciidoctor-pdf/sanitizer.rb:4: syntax error, unexpected '<' (SyntaxError)
<!DOCTYPE html>
 ^
/root/asciidoctor-pdf/lib/asciidoctor-pdf/sanitizer.rb:5: syntax error, unexpected '<'
<html lang="en" class="">
 ^
/root/asciidoctor-pdf/lib/asciidoctor-pdf/sanitizer.rb:5: syntax error, unexpected keyword_class, expecting end-of-input
<html lang="en" class="">
                     ^
    from /root/asciidoctor-pdf/lib/asciidoctor-pdf/converter.rb:10:in `<top (required)>'
    from /root/asciidoctor-pdf/lib/asciidoctor-pdf.rb:3:in `require_relative'
    from /root/asciidoctor-pdf/lib/asciidoctor-pdf.rb:3:in `<top (required)>'
    from /root/asciidoctor-pdf/bin/asciidoctor-pdf:3:in `require_relative'
    from /root/asciidoctor-pdf/bin/asciidoctor-pdf:3:in `<main>'

@mojavelinux
Copy link
Member Author

Are you sure you are running it on the adoc file? I'll double check, but that seems to be the only way we'd see a DOCTYPE in the output.

@rlopez133
Copy link

Ya running it on the same doc file. I reverted the changes to get adoc-pdf working again. Not sure why it was not happy. I manually copied the files since it wasn't avail via the git pull. This could prob be part of my prob maybe I missed something....

@mojavelinux
Copy link
Member Author

Gotcha. I'll verify. If it looks clean from my end, I'll merge and then you can test again.

@mojavelinux mojavelinux force-pushed the issue-185 branch 2 times, most recently from fb40f2d to ff706ec Compare June 16, 2015 05:35
- autofit (reduce font size) to prevent wrapping in listing & literal blocks
- prevent font size from being reduced more than *_font_size_min
- activate autofit if autofit option is specified on block
- activate autofit if autofit-option attribute is specified on document
- add autofit example to chronicles.adoc
- add additional helper methods to core_ext
mojavelinux added a commit that referenced this pull request Jun 16, 2015
resolves #185 autofit font size in listing & literal blocks
@mojavelinux mojavelinux merged commit 2e503e8 into asciidoctor:master Jun 16, 2015
@mojavelinux mojavelinux deleted the issue-185 branch June 16, 2015 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants