Cover on AsciiDoctor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Cover on AsciiDoctor

KillianPerea
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

mojavelinux
Administrator
You are probably looking for the title / subtitle division.

The title page only supports the following elements:

* document title
* document subtitle
* author
* revision and date
* background image
* logo

Example with all elements:

= Title: Subtitle
Author Name
v1.0.0, 2016-02-22
:title-logo-image: image:logo.png[Logo,100,100]
:title-page-background-image: image:bg.jpg[]

Aside from that, content is not supported on the title page (unless you are willing to customize the converter code).

If you need a more general layout for a cover page, I recommend using a front cover, which is defined using the front-cover-image attribute.

:front-cover-image: image:front-cover.pdf[]

-Dan


On Mon, Feb 22, 2016 at 5:32 PM, KillianPerea [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi, i'm a beginner on asciidoctor and asciidoctor-pdf and i'm trying to make a cover, I want to make something like this:

= title
name
ponent name
date
...

But only the 2 first items are displayed correctly, I read the documentation and seems like it's a template.

It's possible modify this template to add more elements behind the title?

Thanks and sorry for my bad english.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Cover-on-AsciiDoctor-tp4378.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

mojavelinux
Administrator
In reply to this post by KillianPerea
Note that the front cover can be any image type or a PDF.

-Dan

On Mon, Feb 22, 2016 at 6:56 PM, Dan Allen <[hidden email]> wrote:
You are probably looking for the title / subtitle division.

The title page only supports the following elements:

* document title
* document subtitle
* author
* revision and date
* background image
* logo

Example with all elements:

= Title: Subtitle
Author Name
v1.0.0, 2016-02-22
:title-logo-image: image:logo.png[Logo,100,100]
:title-page-background-image: image:bg.jpg[]

Aside from that, content is not supported on the title page (unless you are willing to customize the converter code).

If you need a more general layout for a cover page, I recommend using a front cover, which is defined using the front-cover-image attribute.

:front-cover-image: image:front-cover.pdf[]

-Dan


On Mon, Feb 22, 2016 at 5:32 PM, KillianPerea [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi, i'm a beginner on asciidoctor and asciidoctor-pdf and i'm trying to make a cover, I want to make something like this:

= title
name
ponent name
date
...

But only the 2 first items are displayed correctly, I read the documentation and seems like it's a template.

It's possible modify this template to add more elements behind the title?

Thanks and sorry for my bad english.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Cover-on-AsciiDoctor-tp4378.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

oddhack
Are the title-logo-image and title-page-background-image options officially supported in 1.5.5? They don't seem to be in the user guide. I tried them and don't see either image in the html5 output. asciidoctor-pdf does show them both, but I gave it a 2100x500 SVG and no combination of pdfwidth=, scaledwidth=, or explicit width/height attributes on the image: I've tried has made it fit the page width.

Jon
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

mojavelinux
Administrator
The cover page feature is only for Asciidoctor PDF. (see https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#theme-related-document-attributes). To be honest, I don't see how it applies to HTML since a cover page in HTML doesn't really make sense.

However, you could use a docinfo file to add an image above the document title in the HTML output.

Cheers,

-Dan

On Thu, Mar 2, 2017 at 3:54 AM, oddhack [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Are the title-logo-image and title-page-background-image options officially supported in 1.5.5? They don't seem to be in the user guide. I tried them and don't see either image in the html5 output. asciidoctor-pdf does show them both, but I gave it a 2100x500 SVG and no combination of pdfwidth=, scaledwidth=, or explicit width/height attributes on the image: I've tried has made it fit the page width.

Jon


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Cover-on-AsciiDoctor-tp4378p5320.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

oddhack
mojavelinux wrote
The cover page feature is only for Asciidoctor PDF. (see
https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#theme-related-document-attributes).
To be honest, I don't see how it applies to HTML since a cover page in HTML
doesn't really make sense.
I was hoping for something like this: https://www.khronos.org/registry/spir-v/specs/1.1/SPIRV.html (which is, obviously, doable without builtin support. albeit that's an asciidoc-generated HTML not asciidoctor; it would just be more convenient if the builtin title image attributes did something similar in HTML outputs).

Regarding my other question:

> asciidoctor-pdf
> does show them both, but I gave it a 2100x500 SVG and no combination of
> pdfwidth=, scaledwidth=, or explicit width/height attributes on the image:
> I've tried has made it fit the page width.

Is there any control over how the size of background images maps onto the PDF page?

Thanks,
Jon
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

mojavelinux
Administrator
Jon,

Regarding my other question:

> asciidoctor-pdf
> does show them both, but I gave it a 2100x500 SVG and no combination of
> pdfwidth=, scaledwidth=, or explicit width/height attributes on the image:
> I've tried has made it fit the page width.

Is there any control over how the size of background images maps onto the PDF page?

Sorry, I missed that question. I looked through the code and I found a note to myself that the converter is not scaling the background SVG. It should scale the image to fit within the page like it does for other formats. I've opened https://github.com/asciidoctor/asciidoctor-pdf/issues/765 to address this shortcoming.

In the meantime, you can work around this problem by opening the SVG in an image editor and scaling it to the width and height that would fit the page. You can do so either by adding the width and height properties, or adjusting the view box (aka canvas) to match the size of the page. In other words, it needs to fit properly without scaling.

Currently, there's no way to adjust how scaling is done for a background image. Once the referenced issue is resolved, all background images, including SVGs, will be scaled to fit the page size. The best way to get the scaling you want is to modify the image (or its canvas) so it fits properly on the page without needing to be scaled.

Cheers,

-Dan


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

mojavelinux
Administrator
In reply to this post by oddhack
Jon,

I was hoping for something like this: https://www.khronos.org/registry/spir-v/specs/1.1/SPIRV.html (which is, obviously, doable without builtin support. albeit that's an asciidoc-generated HTML not asciidoctor; it would just be more convenient if the builtin title image attributes did something similar in HTML outputs).

I still feel strongly that for HTML this is a branding customization. Where one person is going to want to place a title image, another will want to place it somewhere else. I've seen it over the title, under the title, as a background image, as a floating header, etc. This is why I suggest docinfo. It's exactly what that feature was designed for. You can add extra "chrome" to the page out of the box.

If sometime wants to propose a placement for this title image in the default stylesheet, I'd be happy to review that proposal. If the community generally agrees it's acceptable and should be included, we'll make it happen.

Cheers,

-Dan

--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

IlliteratePhD
Is there any functionality for generating a final page? I'd like to add a templated final page to the theme I'm creating atm. Also, when you talk about title image, are you referring to the title logo or is there another image opportunity available?

/ Patrik
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

mojavelinux
Administrator
Here are the options Asciidoctor PDF in regards to cover and title pages:

* title logo that appears on title page (title-logo-image)
* background image for title page (title-page-background-image)
* front cover page (as image or single-page PDF) (front-cover-image)
* back cover image (as image or single-page PDF) (back-cover-image)

Asciidoctor PDF does not provide a templated final page. The recommended way to handle this is to generate a single-page PDF, then insert it as the back cover image.

Of course, you can extend the converter to add a custom final page, but that's not something that the theme handles currently.

-Dan

On Fri, Aug 11, 2017 at 12:06 AM, IlliteratePhD [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is there any functionality for generating a final page? I'd like to add a templated final page to the theme I'm creating atm. Also, when you talk about title image, are you referring to the title logo or is there another image opportunity available?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Cover-on-AsciiDoctor-tp4378p5823.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Cover on AsciiDoctor

IlliteratePhD
Ok, thanks!