emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to differentiate between lists in HTML export
@ 2014-11-05  1:36 Marcin Borkowski
  2014-11-05  7:43 ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Borkowski @ 2014-11-05  1:36 UTC (permalink / raw)
  To: Org-Mode mailing list

Hi list,

as I've said some time ago, I'm working on a custom exporter.  What I'd
like to achieve is differentiating between lists – essentially, I'd like
a list to translate to something like this:

<ul id="some unique ID">
<li>Item 1</li>
<li>Item 2</li>
</ul>

Is there any support for this kind of stuff in the exporter framework or
should I code it myself?  (It should be rather easy – e.g. have a global
variable keeping track of the number of unordered lists so far.)

Notice that I explicitly /do not want/ the user to manually enter unique
IDs etc., nor do I want him to run some function inserting CUSTOM_ID
properties etc.

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

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

* Re: How to differentiate between lists in HTML export
  2014-11-05  1:36 How to differentiate between lists in HTML export Marcin Borkowski
@ 2014-11-05  7:43 ` Nicolas Goaziou
  2014-11-09  0:10   ` Marcin Borkowski
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2014-11-05  7:43 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Org-Mode mailing list

Hello,

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> as I've said some time ago, I'm working on a custom exporter.  What I'd
> like to achieve is differentiating between lists – essentially, I'd like
> a list to translate to something like this:
>
> <ul id="some unique ID">
> <li>Item 1</li>
> <li>Item 2</li>
> </ul>
>
> Is there any support for this kind of stuff in the exporter framework or
> should I code it myself?  (It should be rather easy – e.g. have a global
> variable keeping track of the number of unordered lists so far.)

See `org-export-get-ordinal'.


Regards,

-- 
Nicolas Goaziou

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

* Re: How to differentiate between lists in HTML export
  2014-11-05  7:43 ` Nicolas Goaziou
@ 2014-11-09  0:10   ` Marcin Borkowski
  2014-11-09  8:24     ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Borkowski @ 2014-11-09  0:10 UTC (permalink / raw)
  To: Org-Mode mailing list


On 2014-11-05, at 08:43, Nicolas Goaziou wrote:

> Hello,
>
> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>
>> as I've said some time ago, I'm working on a custom exporter.  What I'd
>> like to achieve is differentiating between lists – essentially, I'd like
>> a list to translate to something like this:
>>
>> <ul id="some unique ID">
>> <li>Item 1</li>
>> <li>Item 2</li>
>> </ul>
>>
>> Is there any support for this kind of stuff in the exporter framework or
>> should I code it myself?  (It should be rather easy – e.g. have a global
>> variable keeping track of the number of unordered lists so far.)
>
> See `org-export-get-ordinal'.

Thanks, but this is not really what I'd like to have: the strings
generated by org-export-get-ordinal are /not/ unique throughout the file
(they seem to be unique within one level of hierarchy).  Any other
suggestions?

> Regards,


-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

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

* Re: How to differentiate between lists in HTML export
  2014-11-09  0:10   ` Marcin Borkowski
@ 2014-11-09  8:24     ` Nicolas Goaziou
  2014-11-09 21:36       ` Marcin Borkowski
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2014-11-09  8:24 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Org-Mode mailing list

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Thanks, but this is not really what I'd like to have: the strings
> generated by org-export-get-ordinal are /not/ unique throughout the file
> (they seem to be unique within one level of hierarchy).

They should be unique. How did you use this function?


Regards,

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

* Re: How to differentiate between lists in HTML export
  2014-11-09  8:24     ` Nicolas Goaziou
@ 2014-11-09 21:36       ` Marcin Borkowski
  2014-11-09 23:08         ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Borkowski @ 2014-11-09 21:36 UTC (permalink / raw)
  To: Org-Mode mailing list


On 2014-11-09, at 09:24, Nicolas Goaziou wrote:

> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>
>> Thanks, but this is not really what I'd like to have: the strings
>> generated by org-export-get-ordinal are /not/ unique throughout the file
>> (they seem to be unique within one level of hierarchy).
>
> They should be unique. How did you use this function?

Sorry for the noise, it seems to be working now.  (I threw out the
code, but AFAIR the non-uniqueness arised with ordinals of /items/ in
different lists.)

> Regards,

Thanks,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

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

* Re: How to differentiate between lists in HTML export
  2014-11-09 21:36       ` Marcin Borkowski
@ 2014-11-09 23:08         ` Nicolas Goaziou
  2014-11-10  2:02           ` Marcin Borkowski
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2014-11-09 23:08 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Org-Mode mailing list

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Sorry for the noise, it seems to be working now.  (I threw out the
> code, but AFAIR the non-uniqueness arised with ordinals of /items/ in
> different lists.)

Yes, ordinals for items are relative to the list they belong to. OTOH
for plain lists, this is the sequence number among other plain lists in
the buffer (see docstring).


Regards,

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

* Re: How to differentiate between lists in HTML export
  2014-11-09 23:08         ` Nicolas Goaziou
@ 2014-11-10  2:02           ` Marcin Borkowski
  0 siblings, 0 replies; 7+ messages in thread
From: Marcin Borkowski @ 2014-11-10  2:02 UTC (permalink / raw)
  To: Org-Mode mailing list


On 2014-11-10, at 00:08, Nicolas Goaziou wrote:

> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>
>> Sorry for the noise, it seems to be working now.  (I threw out the
>> code, but AFAIR the non-uniqueness arised with ordinals of /items/ in
>> different lists.)
>
> Yes, ordinals for items are relative to the list they belong to. OTOH
> for plain lists, this is the sequence number among other plain lists in
> the buffer (see docstring).

That's exactly what I thought.  (I need ordinals for plain lists, since
I sometimes convert them to groups of radio buttons in my derived html
backend; at first, I mistakenly took ordinals of items...)

Tip to myself (and to whoever might need it): to have a unique id of a
list item, combine the id of the parent list with the (relative) id of
the item.

> Regards,

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

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

end of thread, other threads:[~2014-11-10  2:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05  1:36 How to differentiate between lists in HTML export Marcin Borkowski
2014-11-05  7:43 ` Nicolas Goaziou
2014-11-09  0:10   ` Marcin Borkowski
2014-11-09  8:24     ` Nicolas Goaziou
2014-11-09 21:36       ` Marcin Borkowski
2014-11-09 23:08         ` Nicolas Goaziou
2014-11-10  2:02           ` Marcin Borkowski

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