emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: Help resolving CUSTOM_ID based links that point to outside current subtree scope
Date: Fri, 28 Jul 2017 19:19:03 +0000	[thread overview]
Message-ID: <CAFyQvY0G5aguvPFe8aSE0b+ONkOCsSvY40fB0jBx67R-he+OFg@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY2fz7is0Wn0-WJoeJuCs7NBM6CrDo4Jp=kuU_4tR2ROPA@mail.gmail.com>

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

Ah! I made a typo in the example above; here's the corrected one:

* Link source
:PROPERTIES:
:EXPORT_FILE_NAME: link-source
:END:
- Link to [[#link-dest][Link dest]]
* Link dest
:PROPERTIES:
:EXPORT_FILE_NAME: link-dest
:CUSTOM_ID: link-dest
:END:

("Link source" and "Link dest" subtrees are at the same level. So exporting
just "Link source" subtree does not 'see' the "Link dest" subtree.)

On Fri, Jul 28, 2017 at 3:17 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:

> Hello,
>
> Is there a way to make org-export-resolve-id-link look for link resolution
> outside the current scope?
>
> I just threw in a (save-restriction (widen) ..) inside
> org-export-resolve-id-link, and that of course did not work (and thus this
> email).
>
> Below is a little example:
>
> * Link source
> :PROPERTIES:
> :EXPORT_FILE_NAME: link-source
> :END:
> - Link to [[#link-dest][Link dest]]
> ** Link dest
> :PROPERTIES:
> :EXPORT_FILE_NAME: link-dest
> :CUSTOM_ID: link-dest
> :END:
>
> - I would like to export just the "Link source" subtree (let's say C-c C-e
> C-s t A), and have the link resolve to the "link-dest" CUSTOM_ID.
> - To put this the other way, I want to export just the subtree, but look
> at the whole buffer for link resolution.
>
> I know that does not make sense, but I need that for the Hugo exporter
> backend.
>
> Application: I have one subtree (Hugo post) containing a CUSTOM_ID based
> internal link to some other subtree (Hugo post), and I want to retain the
> link reference. Hugo would then figure out the rest.
>
> What function could I advice and with what to make this happen?
>
> Thanks.
> --
>
> Kaushal Modi
>
-- 

Kaushal Modi

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

  reply	other threads:[~2017-07-28 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 19:17 Help resolving CUSTOM_ID based links that point to outside current subtree scope Kaushal Modi
2017-07-28 19:19 ` Kaushal Modi [this message]
2017-08-01  8:25   ` Nicolas Goaziou
2017-08-01 11:08     ` Kaushal Modi
2017-08-01 16:46       ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY0G5aguvPFe8aSE0b+ONkOCsSvY40fB0jBx67R-he+OFg@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).