all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Custom <<anchor>> possibility?
@ 2021-05-20 19:25 Jean Louis
  2021-05-20 19:59 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Jean Louis @ 2021-05-20 19:25 UTC (permalink / raw)
  To: emacs-orgmode

Is it possible to create a custom <<anchor>>:

From: (info "(org) Internal Links")

     1. one item
     2. <<target>>another item
     Here we refer to item [[target]].

That is fine, however, in the HTML output the <<target>> will become
something like: <li><a id="orgc0c2c98"></a>another item</li>

As I am developing finely grained referenced Org outputs I would need
the id="orgc0c2c98" to be defined how I wish it and not interpolated
into something random.

Is there a possibility to tell Org, that <<target>> really remains
"target" as in id="target" instead of a random ID?


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/



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

* Re: Custom <<anchor>> possibility?
  2021-05-20 19:25 Custom <<anchor>> possibility? Jean Louis
@ 2021-05-20 19:59 ` Nicolas Goaziou
  2021-05-20 20:19   ` Jean Louis
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2021-05-20 19:59 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Jean Louis <bugs@gnu.support> writes:

> Is it possible to create a custom <<anchor>>:
>
> From: (info "(org) Internal Links")
>
>      1. one item
>      2. <<target>>another item
>      Here we refer to item [[target]].
>
> That is fine, however, in the HTML output the <<target>> will become
> something like: <li><a id="orgc0c2c98"></a>another item</li>
>
> As I am developing finely grained referenced Org outputs I would need
> the id="orgc0c2c98" to be defined how I wish it and not interpolated
> into something random.
>
> Is there a possibility to tell Org, that <<target>> really remains
> "target" as in id="target" instead of a random ID?

See `org-html-prefer-user-labels'.

Regards.

-- 
Nicolas Goaziou


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

* Re: Custom <<anchor>> possibility?
  2021-05-20 19:59 ` Nicolas Goaziou
@ 2021-05-20 20:19   ` Jean Louis
  2021-05-20 22:18     ` Samuel Wales
  0 siblings, 1 reply; 8+ messages in thread
From: Jean Louis @ 2021-05-20 20:19 UTC (permalink / raw)
  To: emacs-orgmode

* Nicolas Goaziou <mail@nicolasgoaziou.fr> [2021-05-20 23:00]:
> > Is there a possibility to tell Org, that <<target>> really remains
> > "target" as in id="target" instead of a random ID?
> 
> See `org-html-prefer-user-labels'.

Thanks.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/



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

* Re: Custom <<anchor>> possibility?
  2021-05-20 20:19   ` Jean Louis
@ 2021-05-20 22:18     ` Samuel Wales
  2021-05-20 23:00       ` Jean Louis
  2021-05-21 12:51       ` Nicolas Goaziou
  0 siblings, 2 replies; 8+ messages in thread
From: Samuel Wales @ 2021-05-20 22:18 UTC (permalink / raw)
  To: emacs-orgmode

thanks for pointing us to this variable.

docstring says "This process ensures that these values are unique and
valid...", so it sounds like you could create non-unique or invalid
identifiers without it.

does this mean, for example, if the user exports a subtree with two
link targets with the same user label, then if this variable is
non-nil, then the output could include more than one link target?

what if this var were nil [the default], my brain is not working well
now, but it seems as if the exporter could still get confused which
target to link to, even if it is not printing duplicatedly-named
targets.

so i am curious what the purpose of the default is?

On 5/20/21, Jean Louis <bugs@gnu.support> wrote:
> * Nicolas Goaziou <mail@nicolasgoaziou.fr> [2021-05-20 23:00]:
>> > Is there a possibility to tell Org, that <<target>> really remains
>> > "target" as in id="target" instead of a random ID?
>>
>> See `org-html-prefer-user-labels'.
>
> Thanks.
>
>
> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> Sign an open letter in support of Richard M. Stallman
> https://stallmansupport.org/
> https://rms-support-letter.github.io/
>
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


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

* Re: Custom <<anchor>> possibility?
  2021-05-20 22:18     ` Samuel Wales
@ 2021-05-20 23:00       ` Jean Louis
  2021-05-20 23:50         ` Samuel Wales
  2021-05-21 12:51       ` Nicolas Goaziou
  1 sibling, 1 reply; 8+ messages in thread
From: Jean Louis @ 2021-05-20 23:00 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

* Samuel Wales <samologist@gmail.com> [2021-05-21 01:19]:
> thanks for pointing us to this variable.
> 
> docstring says "This process ensures that these values are unique and
> valid...", so it sounds like you could create non-unique or invalid
> identifiers without it.
> 
> does this mean, for example, if the user exports a subtree with two
> link targets with the same user label, then if this variable is
> non-nil, then the output could include more than one link target?

I may try to give the example here:

<<paragraph>>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
lectus. Sed sit amet ipsum mauris. 

<<paragraph>>
Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut
tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper
ultricies.

which results in:

<a id="paragraph"></a>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
lectus. Sed sit amet ipsum mauris. 
</p>

<p>
<a id="paragraph"></a>
Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut
tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper
ultricies.
</p>

> what if this var were nil [the default], my brain is not working well
> now, but it seems as if the exporter could still get confused which
> target to link to, even if it is not printing duplicatedly-named
> targets.
> 
> so i am curious what the purpose of the default is?

You already discovered the purpose: "This process ensures that these
values are unique and valid..."

Randomly generated internal hyperlinks are not part of author's
document creation and I don't believe they can be unique across all
documents as they rely on randomity, not uniqueness, but they may be
unique in one document. The sentence should say "This process ensures
that these values are unique to specific document and valid"

Problem with it is that those random anchors/links are random, and
that makes it a bad default for user. A user may bookmark the link 

https://www.example.com/doc#org2cf8625 with some title, but with the
next document generation same link may appear as
https://www.example.com/doc#org6ac9de0 and that means that bookmark
disappeared, at least for HTML export.

For me personally I am editing Org text (not files) on a meta level
where all objects have its unique ID and from there I can create Org
files. Then each object of a structure of meta level Org has its
unique ID. Also the document has its unique ID. Then it becomes
possible to automatically create anchors like <<1:17311:31121>> which
are truly unique across all documents, remain immutable, and are
trackable. With "trackable" I mean that it is possible to generate a
list of "referenced by" documents, documents which hyperlink to that
anchor.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/



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

* Re: Custom <<anchor>> possibility?
  2021-05-20 23:00       ` Jean Louis
@ 2021-05-20 23:50         ` Samuel Wales
  0 siblings, 0 replies; 8+ messages in thread
From: Samuel Wales @ 2021-05-20 23:50 UTC (permalink / raw)
  To: Samuel Wales, emacs-orgmode

thanks for the example.  yes, that is the example i was thinkng of.

i was asking, why does adding uniqueness do any good currently.  if
the user has your example as follows, it does create duplicates in the
output, but i don't get why that all by itself needs fixing by
default.

===vvv
I may try to give the example here:

<<paragraph>>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
lectus. Sed sit amet ipsum mauris.

<<paragraph>>
Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut
tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper
ultricies.

which results in:

<a id="paragraph"></a>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
lectus. Sed sit amet ipsum mauris.
</p>

<p>
<a id="paragraph"></a>
Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut
tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper
ultricies.
</p>
===^^^

so the duplicates in the output there are apparently a problem.  i am
not sure why, unless a link needs to point to each.  perhaps so that
the reader of the web page can point to each?  but as you say,
generating the document again foils that plot.

[note: i started the thread about toc links.  this is a subtly
different question although it overlaps.]


On 5/20/21, Jean Louis <bugs@gnu.support> wrote:
> * Samuel Wales <samologist@gmail.com> [2021-05-21 01:19]:
>> thanks for pointing us to this variable.
>>
>> docstring says "This process ensures that these values are unique and
>> valid...", so it sounds like you could create non-unique or invalid
>> identifiers without it.
>>
>> does this mean, for example, if the user exports a subtree with two
>> link targets with the same user label, then if this variable is
>> non-nil, then the output could include more than one link target?
>
> I may try to give the example here:
>
> <<paragraph>>
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
> lectus. Sed sit amet ipsum mauris.
>
> <<paragraph>>
> Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut
> tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper
> ultricies.
>
> which results in:
>
> <a id="paragraph"></a>
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
> lectus. Sed sit amet ipsum mauris.
> </p>
>
> <p>
> <a id="paragraph"></a>
> Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut
> tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper
> ultricies.
> </p>
>
>> what if this var were nil [the default], my brain is not working well
>> now, but it seems as if the exporter could still get confused which
>> target to link to, even if it is not printing duplicatedly-named
>> targets.
>>
>> so i am curious what the purpose of the default is?
>
> You already discovered the purpose: "This process ensures that these
> values are unique and valid..."
>
> Randomly generated internal hyperlinks are not part of author's
> document creation and I don't believe they can be unique across all
> documents as they rely on randomity, not uniqueness, but they may be
> unique in one document. The sentence should say "This process ensures
> that these values are unique to specific document and valid"
>
> Problem with it is that those random anchors/links are random, and
> that makes it a bad default for user. A user may bookmark the link
>
> https://www.example.com/doc#org2cf8625 with some title, but with the
> next document generation same link may appear as
> https://www.example.com/doc#org6ac9de0 and that means that bookmark
> disappeared, at least for HTML export.
>
> For me personally I am editing Org text (not files) on a meta level
> where all objects have its unique ID and from there I can create Org
> files. Then each object of a structure of meta level Org has its
> unique ID. Also the document has its unique ID. Then it becomes
> possible to automatically create anchors like <<1:17311:31121>> which
> are truly unique across all documents, remain immutable, and are
> trackable. With "trackable" I mean that it is possible to generate a
> list of "referenced by" documents, documents which hyperlink to that
> anchor.
>
> --
> Jean
>
> Take action in Free Software Foundation campaigns:
> https://www.fsf.org/campaigns
>
> Sign an open letter in support of Richard M. Stallman
> https://stallmansupport.org/
> https://rms-support-letter.github.io/
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


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

* Re: Custom <<anchor>> possibility?
  2021-05-20 22:18     ` Samuel Wales
  2021-05-20 23:00       ` Jean Louis
@ 2021-05-21 12:51       ` Nicolas Goaziou
  2021-05-21 19:28         ` Samuel Wales
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2021-05-21 12:51 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Hello,

Samuel Wales <samologist@gmail.com> writes:

> so i am curious what the purpose of the default is?

I think the purpose of the default value is to offer a solution that
works for everyone. It is certainly not the best one in all situations.

For example, I heard that even in 2021, using full Unicode in a URL is
not good idea. Yet, some users may want to use Unicode symbols in
a target.

Regards,
-- 
Nicolas Goaziou


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

* Re: Custom <<anchor>> possibility?
  2021-05-21 12:51       ` Nicolas Goaziou
@ 2021-05-21 19:28         ` Samuel Wales
  0 siblings, 0 replies; 8+ messages in thread
From: Samuel Wales @ 2021-05-21 19:28 UTC (permalink / raw)
  To: Samuel Wales, emacs-orgmode

tahnk you.  that makes sense for validity.  still not sure about
uniqueness.  it's not needed for me to understand, though.
of course with across-export link stability then uniqueness would be meaningful.


On 5/21/21, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Samuel Wales <samologist@gmail.com> writes:
>
>> so i am curious what the purpose of the default is?
>
> I think the purpose of the default value is to offer a solution that
> works for everyone. It is certainly not the best one in all situations.
>
> For example, I heard that even in 2021, using full Unicode in a URL is
> not good idea. Yet, some users may want to use Unicode symbols in
> a target.
>
> Regards,
> --
> Nicolas Goaziou
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


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

end of thread, other threads:[~2021-05-21 19:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-20 19:25 Custom <<anchor>> possibility? Jean Louis
2021-05-20 19:59 ` Nicolas Goaziou
2021-05-20 20:19   ` Jean Louis
2021-05-20 22:18     ` Samuel Wales
2021-05-20 23:00       ` Jean Louis
2021-05-20 23:50         ` Samuel Wales
2021-05-21 12:51       ` Nicolas Goaziou
2021-05-21 19:28         ` Samuel Wales

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.