emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Failure to resolve internal links on ox-html export?
@ 2021-06-11 17:53 Tim Visher
  2021-06-11 18:31 ` Juan Manuel Macías
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Visher @ 2021-06-11 17:53 UTC (permalink / raw)
  To: Emacs Org Mode mailing list

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

Hi Everyone,

I'd like to be able to link to various areas of a large wiki file I
maintain for when I'm looking at an entry in emacs. However, I will often
email exported subtrees and when I do that if I have a link to a heading
that's outside the current subtree it fails with a `user-error: Unable to
resolve link: …`, I assume because the export tree doesn't contain that
heading.

Is there any way to tell the exporter to simply make those into plain text
_or_ to simply ignore the error?

Thanks in advance!

--

In Christ,

Timmy V.

https://blog.twonegatives.com
http://five.sentenc.es

[-- Attachment #2: Type: text/html, Size: 817 bytes --]

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

* Re: Failure to resolve internal links on ox-html export?
  2021-06-11 17:53 Failure to resolve internal links on ox-html export? Tim Visher
@ 2021-06-11 18:31 ` Juan Manuel Macías
  2021-06-18 19:47   ` Tim Visher
  0 siblings, 1 reply; 6+ messages in thread
From: Juan Manuel Macías @ 2021-06-11 18:31 UTC (permalink / raw)
  To: Tim Visher; +Cc: orgmode

Hi Tim,

Try setting this variable to non-nil:

(setq org-export-with-broken-links t)

Best regards,

Juan Manuel 

Tim Visher writes:

> Hi Everyone,
>
> I'd like to be able to link to various areas of a large wiki file I
> maintain for when I'm looking at an entry in emacs. However, I will
> often email exported subtrees and when I do that if I have a link to a
> heading that's outside the current subtree it fails with a
> `user-error: Unable to resolve link: …`, I assume because the export
> tree doesn't contain that heading.
>
> Is there any way to tell the exporter to simply make those into plain
> text _or_ to simply ignore the error?
>
> Thanks in advance!
>
> --
>
> In Christ,
>
> Timmy V.
>
> https://blog.twonegatives.com
> http://five.sentenc.es
>


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

* Re: Failure to resolve internal links on ox-html export?
  2021-06-11 18:31 ` Juan Manuel Macías
@ 2021-06-18 19:47   ` Tim Visher
  2021-06-18 20:37     ` Juan Manuel Macías
  2021-06-18 22:18     ` Tim Cross
  0 siblings, 2 replies; 6+ messages in thread
From: Tim Visher @ 2021-06-18 19:47 UTC (permalink / raw)
  To: Juan Manuel Macías; +Cc: orgmode

[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

Hi Juan Manuel,

On Fri, Jun 11, 2021 at 2:31 PM Juan Manuel Macías <maciaschain@posteo.net>
wrote:

> Try setting this variable to non-nil:
>
> (setq org-export-with-broken-links t)
>

Thanks for the tip here! This is definitely close to what I want. I think
I'm going to need to code up something additional though in that none of
the default options (mark or ignore) are really the behavior that I want.

- mark: I don't like the way the text comes out here. I don't want to have
BROKEN LINK in the exported text at all.
- ignore: I don't like how the text of the link simply disappears in this
case.

What I really want is something that keeps the link text but drops the
link, essentially converting it into plain text (or stylized text if the
link text is in markup).

I'll have to play around with how to do that.

--

In Christ,

Timmy V.

https://blog.twonegatives.com
http://five.sentenc.es

[-- Attachment #2: Type: text/html, Size: 1479 bytes --]

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

* Re: Failure to resolve internal links on ox-html export?
  2021-06-18 19:47   ` Tim Visher
@ 2021-06-18 20:37     ` Juan Manuel Macías
  2021-06-18 22:18     ` Tim Cross
  1 sibling, 0 replies; 6+ messages in thread
From: Juan Manuel Macías @ 2021-06-18 20:37 UTC (permalink / raw)
  To: Tim Visher; +Cc: orgmode

Hi Tim,

Tim Visher writes:

> What I really want is something that keeps the link text but drops the
> link, essentially converting it into plain text (or stylized text if
> the link text is in markup).

According to the `org-export-with-broken-links' docstring:

-----------------------------------
[...] If it is set to ‘mark’, broken links are marked as such in the
output, with a string like

  [BROKEN LINK: path]

where PATH is the un-resolvable reference.

This option can also be set with the OPTIONS keyword, e.g.,
"broken-links:mark".
-----------------------------------

It's not exactly what you're looking for, but it can help you find a
solution.

Best regards,

Juan Manuel 


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

* Re: Failure to resolve internal links on ox-html export?
  2021-06-18 19:47   ` Tim Visher
  2021-06-18 20:37     ` Juan Manuel Macías
@ 2021-06-18 22:18     ` Tim Cross
  2021-06-20 15:01       ` Tim Visher
  1 sibling, 1 reply; 6+ messages in thread
From: Tim Cross @ 2021-06-18 22:18 UTC (permalink / raw)
  To: emacs-orgmode


Tim Visher <tim.visher@gmail.com> writes:

> Hi Juan Manuel,
>
> On Fri, Jun 11, 2021 at 2:31 PM Juan Manuel Macías <maciaschain@posteo.net> wrote:
>
>  Try setting this variable to non-nil:
>
>  (setq org-export-with-broken-links t)
>
> Thanks for the tip here! This is definitely close to what I want. I think I'm going to need to code up something additional though in that none of the
> default options (mark or ignore) are really the behavior that I want.
>
> - mark: I don't like the way the text comes out here. I don't want to have BROKEN LINK in the exported text at all.
> - ignore: I don't like how the text of the link simply disappears in this case.
>
> What I really want is something that keeps the link text but drops the link, essentially converting it into plain text (or stylized text if the link text is in
> markup).
>
> I'll have to play around with how to do that.

Although I've never used them, I think export filters sound like they
might be what you want. Have a look at the Advanced Export configuration
section of the manual and how to define export filters. You should be
able to define an org-export-filter-link-function that will tranform
links into just the title text from the original link.

-- 
Tim Cross


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

* Re: Failure to resolve internal links on ox-html export?
  2021-06-18 22:18     ` Tim Cross
@ 2021-06-20 15:01       ` Tim Visher
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Visher @ 2021-06-20 15:01 UTC (permalink / raw)
  To: Tim Cross; +Cc: Emacs Org Mode mailing list

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

On Fri, Jun 18, 2021 at 6:22 PM Tim Cross <theophilusx@gmail.com> wrote:

>
> Tim Visher <tim.visher@gmail.com> writes:
>
> > Hi Juan Manuel,
> >
> > On Fri, Jun 11, 2021 at 2:31 PM Juan Manuel Macías <
> maciaschain@posteo.net> wrote:
> >
> >  Try setting this variable to non-nil:
> >
> >  (setq org-export-with-broken-links t)
> >
> > Thanks for the tip here! This is definitely close to what I want. I
> think I'm going to need to code up something additional though in that none
> of the
> > default options (mark or ignore) are really the behavior that I want.
> >
> > - mark: I don't like the way the text comes out here. I don't want to
> have BROKEN LINK in the exported text at all.
> > - ignore: I don't like how the text of the link simply disappears in
> this case.
> >
> > What I really want is something that keeps the link text but drops the
> link, essentially converting it into plain text (or stylized text if the
> link text is in
> > markup).
> >
> > I'll have to play around with how to do that.
>
> Although I've never used them, I think export filters sound like they
> might be what you want. Have a look at the Advanced Export configuration
> section of the manual and how to define export filters. You should be
> able to define an org-export-filter-link-function that will tranform
> links into just the title text from the original link.
>

Thanks, Tim! I'll check them out. I hadn't heard of them before.

[-- Attachment #2: Type: text/html, Size: 2005 bytes --]

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

end of thread, other threads:[~2021-06-20 15:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 17:53 Failure to resolve internal links on ox-html export? Tim Visher
2021-06-11 18:31 ` Juan Manuel Macías
2021-06-18 19:47   ` Tim Visher
2021-06-18 20:37     ` Juan Manuel Macías
2021-06-18 22:18     ` Tim Cross
2021-06-20 15:01       ` Tim Visher

Code repositories for project(s) associated with this 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).