Create links for referenced images in MMD

Br
Briar Kit
Posts: 1788
Joined: Thu Apr 04, 2013 9:04 am
Platform: Mac

Tue Apr 05, 2016 9:41 pm Post

EDIT

If anyone reads this thread and wants a simple How-To about sculpting inline and referenced images in Scrivener using MultiMarkdown, this link might help…

http://briarkitesme.com/2016/04/07/usin ... scrivener/

Best

Briar Kit

+++++++++++++++++++++++


Hi

To create an inline image, we can use:

Code: Select all

![Alt](/image.png "Title")


To create a referenced image, we can use:

Code: Select all

![Alt][1]
[1]: /image.png "Title"


To create an inline linked image, we can use:

Code: Select all

[![alt text](/image.png)](http://example.com/ "Title")


But can we add a link to a referenced image?

Code: Select all

![Alt][1]
[1]: ??????????????


Thanks

Briar Kit
Last edited by Briar Kit on Thu Apr 07, 2016 5:31 pm, edited 1 time in total.
Account closed January 2017

Mr
MrGruff
Posts: 208
Joined: Tue Jun 05, 2007 4:22 pm
Location: UK
Contact:

Wed Apr 06, 2016 3:15 pm Post

So far as I can see, the answer is 'probably not' (as ever, Ioa can give a definitive answer).

Any link would have to go in the resource details, after the filename. I've tried a few things and I can get this syntax to be processed through to HTML:

Code: Select all

![Image caption][limagelabel]

[imagelabel]: imagefilename width=400px target="http://www.livinglantern.co.uk"


But, the problem is that the last part just gets spat out as an attribute in the link and isn't any kind of formatted HTML.

Br
Briar Kit
Posts: 1788
Joined: Thu Apr 04, 2013 9:04 am
Platform: Mac

Wed Apr 06, 2016 6:55 pm Post

Hi

Many thanks for the reply and help.

I've tried countless permutations, but have failed to strike lucky so far.

Logically, it feels as though it should be possible, but perhaps my logic is letting me down.

Thanks again.

Best

Briar Kit
Account closed January 2017

User avatar
AmberV
Posts: 20584
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Wed Apr 06, 2016 11:54 pm Post

Maybe I’m thinking about this the other way around, but it seems like the “Title” attribute has migrated to the hyperlink in the third example. If the progression starts with the first example, wouldn’t the third look like the following?

Code: Select all

[![alt text](/image.png "Title")](http://example.com/)


As for linking a referenced image, just extend the logic in the above example and replace the inline image code with reference code:

Code: Select all

[![alt text][im1]](http://example.com/ "Link title")

[im1]: /image.png "Image title"


This will result in the following HTML (note that both elements have their own title):

Code: Select all

<a href="http://example.com/" title="Link title">
    <img src="/image.png" alt="alt text" id="im1" title="Image title" />
</a>


You can even combine referenced links with referenced images:

Code: Select all

[![alt][im1]][link1]

[im1]: image.png "Image title"

[link1]: http://example.com "Link title"


P.S. It's nice to see you around again! :D
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

Br
Briar Kit
Posts: 1788
Joined: Thu Apr 04, 2013 9:04 am
Platform: Mac

Thu Apr 07, 2016 6:32 am Post

Thanks, Ioa

Not near a Mac at the moment, so I can't try your ideas right now, but I know you that what you have written will work.

Code: Select all

[I believe in Ioa][BELIEVE]


I have mainly been using MMD with WordPress, and the syntax for the third example comes from its support site...

https://en.support.wordpress.com/markdo ... reference/

Your final idea is closest to what I am looking for, with im1 and link1 in their own set of square brackets after [alt]. Pretty near perfect, though was hoping I could make it neater by only having one item after [alt] that references both the image and the link. Just want the body text to have as little distracting code as possible, dumping the referenced image and link info into a separate file that I can keep in its own peripheral split while writing. Your final syntax is banging on the door of Utopia.

And thanks for the PS.

Best

Briar Kit
Last edited by Briar Kit on Thu Apr 07, 2016 10:17 am, edited 2 times in total.
Account closed January 2017

Br
Briar Kit
Posts: 1788
Joined: Thu Apr 04, 2013 9:04 am
Platform: Mac

Thu Apr 07, 2016 7:05 am Post

Actually, MMD Valhalla for me would be to dump everything—including the ALT text—to the line of referenced syntax…

Code: Select all

![im1]
[im1] … ImageURL, ImageTitle, ImageAltText, ImageLinkURL


Time for me to try, try, and try again.

Best

Briar Kit
Account closed January 2017

Br
Briar Kit
Posts: 1788
Joined: Thu Apr 04, 2013 9:04 am
Platform: Mac

Thu Apr 07, 2016 7:29 am Post

So, based on…

Code: Select all

[![alt][im1]][link1]

[im1]: image.png "Image title"

[link1]: http://example.com "Link title"


I tried…

Code: Select all

![*HATHAWAY – Eight Arias For A Bardic Life. A Helios Collective co-production with Buxton Festival*][poster]][posterlink]

[poster]: https://briarkitesme.files.wordpress.com/2016/03/hathaway.jpg "HATHAWAY – Eight Arias For A Bardic Life"

[posterlink]: http://www.buxtonfestival.co.uk/music-series/hathaway/ "HATHAWAY – EIGHT ARIAS FOR A BARDIC LIFE"


But "posterlink" comes up as a text link under the image:

imagelink.jpg


Mmmmmmm

Best

Briar Kit
Account closed January 2017

User avatar
xiamenese
Posts: 3394
Joined: Mon Jan 29, 2007 1:32 am
Platform: Mac
Location: London or Exeter, UK.

Thu Apr 07, 2016 7:59 am Post

Hi Briar Kit,

Nice to see you back. :)

Comparing your bits of code, it looks to me as if you are missing a [ right at the beginning in the latter case … could that be the problem?

Mind you, I know nothing about using MMD, so what do I know? :oops:

Mr X
The Scrivenerato sometimes known as Mr X.
MacBook Pro Retina 10.13, 8GB RAM, 512GB SSID
MacBook Pro 17" (late 2011) 10.13, 8GB RAM, 512GB SSID
iPad Air 2, iOS 11, 64GB
Scrivener, Scapple, Nisus Writer Pro, Bookends …

Br
Briar Kit
Posts: 1788
Joined: Thu Apr 04, 2013 9:04 am
Platform: Mac

Thu Apr 07, 2016 9:06 am Post

Hi X (I am not one for titles; was brought up to show respect by using people's names...only using titles in jest or derision)

Thank you and thank you again.

I am not at my Mac right now, but I have either copied the line into the post incorrectly, or you have proved that fresh eyes trump an addled brain. I am pretty sure that Ioa's code must be right, that your eyes are better than my brain, and that I must have erred yet again. Doh.

Very grateful to you, X. Once more indebted.

Will try again when I get back to my Mac.

Best

Briar Kit
Account closed January 2017

Br
Briar Kit
Posts: 1788
Joined: Thu Apr 04, 2013 9:04 am
Platform: Mac

Thu Apr 07, 2016 10:11 am Post

xiamenese wrote:Hi Briar Kit,

Nice to see you back. :)

Comparing your bits of code, it looks to me as if you are missing a [ right at the beginning in the latter case … could that be the problem?

Mind you, I know nothing about using MMD, so what do I know? :oops:

Mr X


Bless those eyes: they saw the error of my ways. Ioa's code works. I had missed out the opening [.

This works:

Code: Select all

[![*HATHAWAY – Eight Arias For A Bardic Life. A Helios Collective co-production with Buxton Festival*][poster]][posterlink]

[poster]: https://briarkitesme.files.wordpress.com/2016/03/hathaway.jpg "HATHAWAY – Eight Arias For A Bardic Life. A Helios Collective co-production with Buxton Festival"

[posterlink]: http://www.buxtonfestival.co.uk/music-series/hathaway/ "HATHAWAY – EIGHT ARIAS FOR A BARDIC LIFE"


http://briarkitesme.com/2016/03/18/savi ... -hathaway/

Anne Hathaway. Saved. And Linked.

Now the quest to get it down to this syntax…

Code: Select all

![im1]
[im1] … ImageURL, ImageTitle, ImageAltText, ImageLinkURL


Many thanks, X. You may claim you know nothing about using MMD, but your nothing outshone my discombobulated efforts.

Best

Briar Kit
Account closed January 2017

User avatar
xiamenese
Posts: 3394
Joined: Mon Jan 29, 2007 1:32 am
Platform: Mac
Location: London or Exeter, UK.

Thu Apr 07, 2016 4:34 pm Post

Hello Briar Kit,

I used to sign myself 'Mark", but then there were so many 'Mark's who suddenly appeared on this forum, and for some time Jaysen had been calling me 'Mr X' from my username, that I just changed to that, and changed my forum signature to reflect it.

:)

Mark
The Scrivenerato sometimes known as Mr X.
MacBook Pro Retina 10.13, 8GB RAM, 512GB SSID
MacBook Pro 17" (late 2011) 10.13, 8GB RAM, 512GB SSID
iPad Air 2, iOS 11, 64GB
Scrivener, Scapple, Nisus Writer Pro, Bookends …

Br
Briar Kit
Posts: 1788
Joined: Thu Apr 04, 2013 9:04 am
Platform: Mac

Thu Apr 07, 2016 5:21 pm Post

xiamenese wrote:Hello Briar Kit,

I used to sign myself 'Mark", but then there were so many 'Mark's who suddenly appeared on this forum, and for some time Jaysen had been calling me 'Mr X' from my username, that I just changed to that, and changed my forum signature to reflect it.

:)

Mark


Hi Mark

I know. I'm a little left field. Or very.

And still very grateful for your help.

Have a good weekend.

Best

Briar Kit
Account closed January 2017

Br
Briar Kit
Posts: 1788
Joined: Thu Apr 04, 2013 9:04 am
Platform: Mac

Thu Apr 07, 2016 5:30 pm Post

If anyone reads this thread and wants a simple How-To about sculpting inline and referenced images in Scrivener using MultiMarkdown, this link might help…

http://briarkitesme.com/2016/04/07/usin ... scrivener/

Best

Briar Kit
Account closed January 2017