emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* exporting link abbreviations
@ 2014-03-29 16:57 Greg Minshall
  2014-03-29 18:48 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Minshall @ 2014-03-29 16:57 UTC (permalink / raw)
  To: org-mode

hi.  i'm playing with the example in the manual of a google map link
(gmap:).  technology is wonderful, and it's amazing (to simple-minded
me) to see the map pop up with the locations.

but, i'm less happy with how these links look when i've provided no
description and they are exported.  if i have a link like:
----
[[gmap:123 Main Street, Our Town, California, United States]]
----

what is *shown* on the exported web page (say) is something ugly like:
----
http://maps.google.com/maps?q=123%20Main%20Street,%20Our%20Town,%20California,%20United%20States
----

i'd rather not specify the address twice (once in the link tag, a second
time in the link description), out of laziness, i guess (but also for
2nd-normal-form'ity).

what i'd *like* the user to see on the web page is the address ("123
Main Street, Out Town, California, United States", in this example).

i could define a macro:
----
#+MACRO: gmap   [[gmap: $1][$1]]
----
and invoke it with
----
{{{gmap(123 Main Street Los Altos California United States)}}}
----

but then
1) i'd have to get rid of the commas in the address (it might
be nice to have a "$*" or some such to give the entire argument ); and

2) i wouldn't have the link active in my org-mode buffer itself
(something i find so magical, plus it helps entering the info to be able
to check the map before exporting).

i wonder if there's something i've missed?  or, if something could be
added?

cheers, Greg Minshall

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: exporting link abbreviations
  2014-03-29 16:57 exporting link abbreviations Greg Minshall
@ 2014-03-29 18:48 ` Nicolas Goaziou
  2014-03-29 21:42   ` Greg Minshall
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2014-03-29 18:48 UTC (permalink / raw)
  To: Greg Minshall; +Cc: org-mode

Hello,

Greg Minshall <minshall@acm.org> writes:

> but, i'm less happy with how these links look when i've provided no
> description and they are exported.  if i have a link like:
> ----
> [[gmap:123 Main Street, Our Town, California, United States]]
> ----
>
> what is *shown* on the exported web page (say) is something ugly like:
> ----
> http://maps.google.com/maps?q=123%20Main%20Street,%20Our%20Town,%20California,%20United%20States
> ----
>
> i'd rather not specify the address twice (once in the link tag, a second
> time in the link description), out of laziness, i guess (but also for
> 2nd-normal-form'ity).
>
> what i'd *like* the user to see on the web page is the address ("123
> Main Street, Out Town, California, United States", in this example).
>
> i could define a macro:
> ----
> #+MACRO: gmap   [[gmap: $1][$1]]
> ----
> and invoke it with
> ----
> {{{gmap(123 Main Street Los Altos California United States)}}}
> ----
>
> but then
> 1) i'd have to get rid of the commas in the address (it might
> be nice to have a "$*" or some such to give the entire argument ); and

No, you don't have to. Commas can be escaped within a macro:

  {{{gmap(123 Main Street\, Los Altos\, California\, United States)}}}

> 2) i wouldn't have the link active in my org-mode buffer itself
> (something i find so magical, plus it helps entering the info to be able
> to check the map before exporting).

You may want to add gmap as a new link type with dedicated export
functions. See `org-add-link-type'.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: exporting link abbreviations
  2014-03-29 18:48 ` Nicolas Goaziou
@ 2014-03-29 21:42   ` Greg Minshall
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Minshall @ 2014-03-29 21:42 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode

Nicholas,

> You may want to add gmap as a new link type with dedicated export
> functions. See `org-add-link-type'.

awesome -- thanks!  (sorry i didn't see it/think of it in the manual.)

cheers, Greg
----
Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> Greg Minshall <minshall@acm.org> writes:
> 
> > but, i'm less happy with how these links look when i've provided no
> > description and they are exported.  if i have a link like:
> > ----
> > [[gmap:123 Main Street, Our Town, California, United States]]
> > ----
> >
> > what is *shown* on the exported web page (say) is something ugly like:
> > ----
> > http://maps.google.com/maps?q=123%20Main%20Street,%20Our%20Town,%20California,%20United%20States
> > ----
> >
> > i'd rather not specify the address twice (once in the link tag, a second
> > time in the link description), out of laziness, i guess (but also for
> > 2nd-normal-form'ity).
> >
> > what i'd *like* the user to see on the web page is the address ("123
> > Main Street, Out Town, California, United States", in this example).
> >
> > i could define a macro:
> > ----
> > #+MACRO: gmap   [[gmap: $1][$1]]
> > ----
> > and invoke it with
> > ----
> > {{{gmap(123 Main Street Los Altos California United States)}}}
> > ----
> >
> > but then
> > 1) i'd have to get rid of the commas in the address (it might
> > be nice to have a "$*" or some such to give the entire argument ); and
> 
> No, you don't have to. Commas can be escaped within a macro:
> 
>   {{{gmap(123 Main Street\, Los Altos\, California\, United States)}}}
> 
> > 2) i wouldn't have the link active in my org-mode buffer itself
> > (something i find so magical, plus it helps entering the info to be able
> > to check the map before exporting).
> 
> You may want to add gmap as a new link type with dedicated export
> functions. See `org-add-link-type'.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-29 21:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-29 16:57 exporting link abbreviations Greg Minshall
2014-03-29 18:48 ` Nicolas Goaziou
2014-03-29 21:42   ` Greg Minshall

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).