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

Add asciidoctor compact theme #112

Open
leif81 opened this issue Nov 27, 2015 · 3 comments
Open

Add asciidoctor compact theme #112

leif81 opened this issue Nov 27, 2015 · 3 comments

Comments

@leif81
Copy link
Member

leif81 commented Nov 27, 2015

The brackets-asciidoctor-preview project ships with a compact version of the asciidoctor theme:

https://github.com/asciidoctor/brackets-asciidoc-preview/blob/master/themes/asciidoctor-compact.css

Any chance of bringing this over to the chrome extension? I find it'd be especially useful when printing documents. As much as I like the the default asciidoctor theme (colours, fonts, etc) I find it is excessively generous with size of margins, padding, etc. Printed documents seem to be as much as twice as many pages as I'd expect the content to require.

@mojavelinux
Copy link
Member

I'm completely in support of this, a compact them is important to have.

Getting there (the right way) means solving the underlying theme issue. We need to overhaul the stylesheet factory so that it builds themes for embedded documents (i.e., previews) in addition to full documents. (see asciidoctor/asciidoctor-stylesheet-factory#18) Then, we need to publish them properly so that they can be pulled down as a dependency.

@ggrossetie
Copy link
Member

Hello @leif81, you can already do it by adding a custom theme in the option page:

  1. Right click on the extension icon and click on "Options"
  2. "Add Stylesheet..." then select the compact.css file
  3. Save

compact

And here is the result (on left the standard theme and on the right the compact theme):

custom_css

I really like the compact theme and I think we should add it to the "Default" theme section (no manual upload required).

@coptercopter
Copy link

Based on @Mogztter idea I am using a slightly modified solution. I have added a custom JavaScript and experimented with zoom, transform and transform-origin attributes. In the end I found the following line of code solving my printing issues.

$('body').css('zoom','0.85');

It is theme-agnostic as well.

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

No branches or pull requests

4 participants