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

Allow the theme to specify a default pdfwidth value #455

Closed
vogella opened this issue May 25, 2016 · 8 comments
Closed

Allow the theme to specify a default pdfwidth value #455

vogella opened this issue May 25, 2016 · 8 comments
Assignees

Comments

@vogella
Copy link
Contributor

vogella commented May 25, 2016

The theme should allow to specify a default pdfwidth value for images to be used if the pdfwidth attribute is not specified.

See #453

@mojavelinux
Copy link
Member

We have one condition to work out. If a default image width is specified in the theme, should that value take precedence over the width value in the image macro? (generally, the value of the width attribute is intended as metadata only, not for sizing).

We also need to decide on a name for the key. image_default_width? (It does have to start with image_).

@vogella
Copy link
Contributor Author

vogella commented May 25, 2016

If a default image width is specified in the theme, should that value take precedence over the width
value in the image macro?

The most detailed value should be the used one. If no value is specified in image: the default value should be used, otherwise the the specified value. In DocBook I used the default one to define the size for all "normal" images, expect the very few that needed a special setting.

image_default_width

Sounds good. If it is specific for the PDF output I would add also add pdf, e.g., image_default_pdfwidth

@mojavelinux
Copy link
Member

If it is specific for the PDF output I would add also add pdf, e.g., image_default_pdfwidth

It's in the PDF theme, so PDF is already implied here.

@mojavelinux
Copy link
Member

So to clarify, the default (specified in the theme) would not be used in this case:

image::file.png[Description,640,480]

but it would be used in this case:

image::file.png[Description]

correct?

@vogella
Copy link
Contributor Author

vogella commented May 25, 2016

correct?

Sounds perfect for me.

@mojavelinux
Copy link
Member

👍

@mojavelinux mojavelinux added this to the v1.5.0.alpha.13 milestone Aug 4, 2016
@mojavelinux mojavelinux self-assigned this Aug 4, 2016
@mojavelinux
Copy link
Member

I think the default width specified in the theme (image_width) should take precedence over the width attribute. I say this because the width attribute is rarely meaningful for PDF, so it should have the lowest priority.

I'm proposing the following precedence:

  • pdfwidth attribute
  • scaledwidth attribute
  • image_width theme key
  • width attribute

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Aug 14, 2016
- allow default value for pdfwidth attribute to be specified in theme
- only allow vw units when resolving width for block image
- use ViewportWidth module to mark width with vw units
- consolidate variable names
@vogella
Copy link
Contributor Author

vogella commented Aug 15, 2016

Quote: I'm proposing the following precedence:

+1 for the proposal

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Aug 16, 2016
- allow default value for pdfwidth attribute to be specified in theme
- only allow vw units when resolving width for block image
- use ViewportWidth module to mark width with vw units
- consolidate variable names
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Aug 16, 2016
- allow default value for pdfwidth attribute to be specified in theme
- only allow vw units when resolving width for block image
- use ViewportWidth module to mark width with vw units
- consolidate variable names
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Aug 16, 2016
- allow default value for pdfwidth attribute to be specified in theme
- only allow vw units when resolving width for block image
- use ViewportWidth module to mark width with vw units
- consolidate variable names
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Aug 16, 2016
- allow default value for pdfwidth attribute to be specified in theme
- only allow vw units when resolving width for block image
- use ViewportWidth module to mark width with vw units
- consolidate variable names
fapdash pushed a commit to vogellacompany/asciidoctor-pdf that referenced this issue Dec 13, 2016
… (PR asciidoctor#513)

- allow default value for pdfwidth attribute to be specified in theme
- only allow vw units when resolving width for block image
- use ViewportWidth module to mark width with vw units
- consolidate variable names
fapdash pushed a commit to vogellacompany/asciidoctor-pdf that referenced this issue Dec 13, 2016
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

2 participants