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

Some attributes must me set from command line #608

Closed
edusantana opened this issue Sep 18, 2016 · 2 comments
Closed

Some attributes must me set from command line #608

edusantana opened this issue Sep 18, 2016 · 2 comments
Milestone

Comments

@edusantana
Copy link

There are some attributes that must be set from command line:

File off-line.adoc:

== Links off-line
:linkattrs:
:nofooter:
:linkcss:
:iconfont-remote!:
:stylesdir: css
:stylesheet: asciidoctor2.css
:icons: font

Content here.

If I run:

asciidoctor off-line.adoc

The expected intent was to include css/asciidoctor2.css as: <link rel="stylesheet" href="css/asciidoctor2.css">

But I end up with a embedded style:

<style>
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */ 
(...)
</style>

But it I run

asciidoctor -a stylesheet=asciidoctor2.css -a stylesdir=css -a linkcss off-line.adoc

It works!

I think it's related to #578

@mojavelinux
Copy link
Member

The only attributes the must be specified from the commandline or via the API are the "secure attributes", which are identified in this table: http://asciidoctor.org/docs/user-manual/#builtin-attributes

The problem you are having is that you are trying to set header-only attributes outside of the document header. A document header either starts with a doctitle:

= Links off-line
:linkattrs:
:nofooter:
:linkcss:
:iconfont-remote!:
:stylesdir: css
:stylesheet: asciidoctor2.css
:icons: font

Content here.

or a list of attribute entries:

:linkattrs:
:nofooter:
:linkcss:
:iconfont-remote!:
:stylesdir: css
:stylesheet: asciidoctor2.css
:icons: font

== Links off-line

Content here.

@mojavelinux mojavelinux added this to the support milestone Sep 18, 2016
@mojavelinux
Copy link
Member

A second-level heading is not a valid document header.

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

No branches or pull requests

2 participants