question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

set backend attribute to indicate pdf

See original GitHub issue

Currently the value of the {backend} attribute is html5.

I propose it be either pdf or html or html-pdf or html5-pdf.

Although the toolchain involves the html, the end user is targetting pdf and may have logic (as I do) which seeks to deactivate features or modify the document in response to that.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ahus1commented, Nov 23, 2019

Currently the “backend” is the converter from AsciiDoc to HTML, and you could use different converters, for example html5s, the semantic HTML converter.

For now I recommend that you add your own attribute on the command line/build process like this:

asciidoctor-pdf -a testattr=abc basic-example.adoc

Looking forward (and to be discussed) the appropriate attribute I’d see is {env}. You can use it or {env-github} today to find out if your source is rendered for example on GitHub for preview:

ifdef::env-github[]
:imagesdir: foo/
endif::[]

I wonder if this this should be pdfjs or pdf.

1reaction
Mogzttercommented, Nov 23, 2019

The backend is strictly intended for converter resolution.

Ok.

Since this conversion relies on the HTML converter to run first, I’m inclined to say the backend should remain unchanged or be html-pdf.

At first, I thought that the conversion to HTML was just an implementation detail (ie. an intermediate step to produce a PDF) but now I don’t think it’s true. The conversion to HTML is a central piece of this converter.

Why not web-pdf? I think it’s important to be consistent in the naming, so if we rename this project asciidoctor-web-pdf then I think the backend should be web-pdf. I also think that html-pdf can be confusing because both html and pdf are output formats.

You could also consider introducing a new attribute to give an indication that pdf is the intended output format.

outfileformat=pdf? outfilemimetype=application/pdf? I don’t use separators because outfilesuffix does not use separators but arguably it’s hard to read…

What do you think about env-web-pdf and env=web-pdf?

Read more comments on GitHub >

github_iconTop Results From Across the Web

'basebackend' attribute is not properly set for 'pdf' backend.
I'm tring to relay on 'basebackend' attribute to register extension. It works fine for html backends, but when I set 'pdf' it still...
Read more >
Document Attributes Reference | Asciidoctor Docs
A convenience attribute for checking which basebackend is active. <basebackend> is the value of the basebackend attribute (e.g., basebackend-html ).
Read more >
PDF form field properties, Adobe Acrobat
In Adobe Acrobat, how a form field behaves is determined by settings in the Properties dialog box for that individual field. You can...
Read more >
backend_pdf — Matplotlib 3.6.2 documentation
Write out the various deferred objects and the pdf end matter. ... Backends may want to override this in order to render each...
Read more >
How to Embed PDF file using HTML ? - GeeksforGeeks
When embedding a pdf HTML code into a website, the embed tag isn't used as often as the previous tags because if the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found