How to Generate DOWNLOAD keyword for HTML Anchor

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

How to Generate DOWNLOAD keyword for HTML Anchor

jnorthr
To be able to suggest to a browser that a downloadable file is a stream file, the html anchor syntax uses the 'download' keyword. To have asciidoctor give me this:

a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip" download>Samples [/a>

i have tried many variations of :

link:https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]

but no joy. Is this do-able ?
thx
jim
Reply | Threaded
Open this post in threaded view
|

Re: How to Generate DOWNLOAD keyword for HTML Anchor

mojavelinux
Administrator
Let's add this as an option on the link tag. Could you file an issue in core? Please reference https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download

Until then, you could supply a custom template for inline_anchor (for example, inline_anchor.html.slim). Here's the starting point:


> link:<a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]">https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]

There's no need to use the link: prefix when the URL begins with http: or https:. In other words, you can write this as:

<a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]">https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]

If we implement the download option, then it will look like:

<a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples,opts=download]">https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples,opts=download]

Cheers,
 
-Dan

On Mon, May 23, 2016 at 8:27 AM, jnorthr [via Asciidoctor :: Discussion] <[hidden email]> wrote:
To be able to suggest to a browser that a downloadable file is a stream file, the html anchor syntax uses the 'download' keyword. To have asciidoctor give me this:

Samples

i have tried many variations of :

link:https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]

but no joy. Is this do-able ?
thx
jim


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-to-Generate-DOWNLOAD-keyword-for-HTML-Anchor-tp4711.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: How to Generate DOWNLOAD keyword for HTML Anchor

jnorthr
Happy to file an issue Dan but have never done one before so don’t know how ;-{

Yes love the ideas for opts=  type of syntax in link declarations as this opens the way for future new HTML syntax stuff we can offer in our asciidoctor !

Will let you know how it goes on inline_anchor use.
thx Jim
 
On 23 May 2016, at 20:48, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:

Let's add this as an option on the link tag. Could you file an issue in core? Please reference https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download

Until then, you could supply a custom template for inline_anchor (for example, inline_anchor.html.slim). Here's the starting point:


> link:<a href="<a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]" class="">https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]"><a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]" class="">https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]

There's no need to use the link: prefix when the URL begins with http: or https:. In other words, you can write this as:

<a href="<a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]" class="">https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]"><a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]" class="">https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]

If we implement the download option, then it will look like:

<a href="<a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples,opts=download]" class="">https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples,opts=download]"><a href="https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples,opts=download]" class="">https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples,opts=download]

Cheers,
 
-Dan

On Mon, May 23, 2016 at 8:27 AM, jnorthr [via Asciidoctor :: Discussion] <<a href="x-msg://3/user/SendEmail.jtp?type=node&amp;node=4713&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
To be able to suggest to a browser that a downloadable file is a stream file, the html anchor syntax uses the 'download' keyword. To have asciidoctor give me this:

Samples

i have tried many variations of :

link:https://github.com/GPars/Website/blob/master/src/main/resources/downloads/gpars-1.0.0/gpars-samples-1.0.0.zip[Samples]

but no joy. Is this do-able ?
thx
jim


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-to-Generate-DOWNLOAD-keyword-for-HTML-Anchor-tp4711.html
To start a new topic under Asciidoctor :: Discussion, email <a href="x-msg://3/user/SendEmail.jtp?type=node&amp;node=4713&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



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



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-to-Generate-DOWNLOAD-keyword-for-HTML-Anchor-tp4711p4713.html
To unsubscribe from How to Generate DOWNLOAD keyword for HTML Anchor, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: How to Generate DOWNLOAD keyword for HTML Anchor

mojavelinux
Administrator

On Wed, May 25, 2016 at 12:20 AM, jnorthr [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Happy to file an issue Dan but have never done one before so don’t know how ;-{

It's just like writing an e-mail. Just go to:


Click "New Issue"

Type a subject and a message, then press "Submit new issue"

Cheers,

-Dan

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