emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* COMMENTed Radio Targets: Any comments?
@ 2010-10-30 14:09 Jambunathan K
  2010-11-05 20:44 ` Matt Lundin
  0 siblings, 1 reply; 4+ messages in thread
From: Jambunathan K @ 2010-10-30 14:09 UTC (permalink / raw)
  To: emacs-orgmode


I am noticing Some inconsistencies with commented out 'Radioed
Targets'. Example is down below. Comments are welcome ...

In the generated HTML,

1. The section titled 'Radioed Target' is not exported because it is
   commented out.
2. References to 'Radioed Target' still get exported as link. It
   points to self.
   
I am not sure what the right behaviour should be ...

I see two options (that I think are consistent):

1. In the Org file, references to 'Radioed Target' is still linkified
   and clicking on it takes me to the right heading (although it is
   COMMENTed out)
   
   The corresponding thing for the HTML exporter is to 'ignore' the
   COMMENT tag on the headline and (still) export it with refrences to
   that headline as internal links.

2. The exported HTML doesn't contain the radioed headline. So
   references to radioed text shouldn't be linkified.
   
Btw, does the behaviour in (1) surprise anyone? 

# Input Org file

#+begin_src emacs-lisp
  (org-link-search-must-match-exact-headline nil)
#+end_src

* Links
** Targets
*** COMMENT <<<Radioed Target>>>
** References
*** References to Radioed Links
    This section has references to Radioed Target.


# Output HTML file
# Shows interesting sections    
    
#+begin_src html
  <div id="text-table-of-contents">
    <ul>
      <li>
        <a href="#sec-1">
          1 Links 
        </a>
        <ul>
          <li>
            <a href="#sec-1_1">
              1.1 Targets 
            </a>
          </li>
          <li>
            <a href="#sec-1_2">
              1.2 References 
            </a>
            <ul>
              <li>
                <a href="#sec-1_2_1">
                  1.2.1 References to Radioed Links 
                </a>
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
  </div>
#+end_src

    
#+begin_src html
  <div id="outline-container-1" class="outline-2">
    <h2 id="sec-1">
      <span class="section-number-2">
        1
      </span>
      Links 
    </h2>
    <div class="outline-text-2" id="text-1">
    </div>
    <div id="outline-container-1_1" class="outline-3">
      <h3 id="sec-1_1">
        <span class="section-number-3">
          1.1
        </span>
        Targets 
      </h3>
      <div class="outline-text-3" id="text-1_1">
      </div>
    </div>
    <div id="outline-container-1_2" class="outline-3">
      <h3 id="sec-1_2">
        <span class="section-number-3">
          1.2
        </span>
        References 
      </h3>
      <div class="outline-text-3" id="text-1_2">
      </div>
      <div id="outline-container-1_2_1" class="outline-4">
        <h4 id="sec-1_2_1">
          <span class="section-number-4">
            1.2.1
          </span>
          References to Radioed Links 
        </h4>
        <div class="outline-text-4" id="text-1_2_1">
          <p>
            This section has references to 
            <a href="#sec-1_2_1">
              Radioed Target
            </a>
            .
          </p>
        </div>
      </div>
    </div>
  </div>
#+end_src
    
Jambunathan K.

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

* Re: COMMENTed Radio Targets: Any comments?
  2010-10-30 14:09 COMMENTed Radio Targets: Any comments? Jambunathan K
@ 2010-11-05 20:44 ` Matt Lundin
  2010-11-06  6:58   ` Jambunathan K
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Lundin @ 2010-11-05 20:44 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode

Jambunathan K <kjambunathan@gmail.com> writes:

> I am noticing Some inconsistencies with commented out 'Radioed
> Targets'. Example is down below. Comments are welcome ...
>
> In the generated HTML,
>
> 1. The section titled 'Radioed Target' is not exported because it is
>    commented out.
> 2. References to 'Radioed Target' still get exported as link. It
>    points to self.
>    
> I am not sure what the right behaviour should be ...

AFAIK, there are no tests in the exporter to determine whether the
target of such a link actually exists. 

> * Links
> ** Targets
> *** COMMENT <<<Radioed Target>>>
> ** References
> *** References to Radioed Links
>     This section has references to Radioed Target.

For stable links to particular headlines, I would recommend CUSTOM_IDs
over radio targets. E.g.,

* Links
** Targets
   :PROPERTIES:
   :CUSTOM_ID: target
   :END:
** References
*** References to Radioed Links
    This section has references to Radioed Target.

Best,
Matt

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

* Re: COMMENTed Radio Targets: Any comments?
  2010-11-05 20:44 ` Matt Lundin
@ 2010-11-06  6:58   ` Jambunathan K
  2010-11-06 14:24     ` Matt Lundin
  0 siblings, 1 reply; 4+ messages in thread
From: Jambunathan K @ 2010-11-06  6:58 UTC (permalink / raw)
  To: Matt Lundin; +Cc: emacs-orgmode


Hello Matt

> For stable links to particular headlines, I would recommend CUSTOM_IDs
> over radio targets. E.g.,

I am raising these questions or bugs or even aberrations as a result of
my work on OpenOffice. 

IOW, I am not looking at 'using them as a feature' but to 'understand
them as a feature' and 'cross-checking' my OpenOffice's exporter against
the HTML exporter.

So the question of swithching to custom-ids doesn't arise in my case. 

Jambunathan K.

Matt Lundin <mdl@imapmail.org> writes:

> Jambunathan K <kjambunathan@gmail.com> writes:
>
>> I am noticing Some inconsistencies with commented out 'Radioed
>> Targets'. Example is down below. Comments are welcome ...
>>
>> In the generated HTML,
>>
>> 1. The section titled 'Radioed Target' is not exported because it is
>>    commented out.
>> 2. References to 'Radioed Target' still get exported as link. It
>>    points to self.
>>    
>> I am not sure what the right behaviour should be ...
>
> AFAIK, there are no tests in the exporter to determine whether the
> target of such a link actually exists. 
>
>> * Links
>> ** Targets
>> *** COMMENT <<<Radioed Target>>>
>> ** References
>> *** References to Radioed Links
>>     This section has references to Radioed Target.
>
> For stable links to particular headlines, I would recommend CUSTOM_IDs
> over radio targets. E.g.,
>
> * Links
> ** Targets
>    :PROPERTIES:
>    :CUSTOM_ID: target
>    :END:
> ** References
> *** References to Radioed Links
>     This section has references to Radioed Target.
>
> Best,
> Matt

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

* Re: COMMENTed Radio Targets: Any comments?
  2010-11-06  6:58   ` Jambunathan K
@ 2010-11-06 14:24     ` Matt Lundin
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Lundin @ 2010-11-06 14:24 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode

Hi Jambunathan,

Jambunathan K <kjambunathan@gmail.com> writes:

>> For stable links to particular headlines, I would recommend CUSTOM_IDs
>> over radio targets. E.g.,
>
> I am raising these questions or bugs or even aberrations as a result of
> my work on OpenOffice. 
>
> IOW, I am not looking at 'using them as a feature' but to 'understand
> them as a feature' and 'cross-checking' my OpenOffice's exporter against
> the HTML exporter.
>
> So the question of swithching to custom-ids doesn't arise in my case. 
>

Thanks for clarifying. I misunderstood the context of the request. I
think it would by helpful to mention such context (i.e., work on the
OpenOffice exporter) in the original post.

FWIW, the following commenting syntax correctly inserts an invisible
target in the html:

--8<---------------cut here---------------start------------->8---
* Heading
# <<<atarget>>>
** Subheading
atarget 
--8<---------------cut here---------------end--------------->8---

exports as...

--8<---------------cut here---------------start------------->8---
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><a name="atarget" id="atarget"></a><span class="section-number-2">1</span> Heading </h2>
<div class="outline-text-2" id="text-1">


</div>

<div id="outline-container-1_1" class="outline-3">
<h3 id="sec-1_1"><span class="section-number-3">1.1</span> Subheading </h3>
<div class="outline-text-3" id="text-1_1">

<p><a href="#sec-1">atarget</a> 
</p>
--8<---------------cut here---------------end--------------->8---

Using the COMMENT keyword, by contrast, creates an orphaned link, as you
note.

> I see two options (that I think are consistent):

> 1. In the Org file, references to 'Radioed Target' is still linkified
>    and clicking on it takes me to the right heading (although it is
>    COMMENTed out)
   
>    The corresponding thing for the HTML exporter is to 'ignore' the
>    COMMENT tag on the headline and (still) export it with refrences to
>    that headline as internal links.

> 2. The exported HTML doesn't contain the radioed headline. So
>    references to radioed text shouldn't be linkified.

I vote for #2. I expect org-export to clobber anything with a COMMENT
keyword. But if the radio target is clobbered, then words pointing to it
should not be "linkified." 

Note: I'm referring here only to automatic radio targets of the
<<<triple-bracket>>> variety. If the user explicitly inserts links such
as [[atarget]], they should remain even if the target does not exist.

Best,
Matt

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

end of thread, other threads:[~2010-11-06 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-30 14:09 COMMENTed Radio Targets: Any comments? Jambunathan K
2010-11-05 20:44 ` Matt Lundin
2010-11-06  6:58   ` Jambunathan K
2010-11-06 14:24     ` Matt Lundin

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).