Re: customized link pointing at a src block

2019-11-10 Thread Fraga, Eric
You want the equivalent of the LaTeX exporter's

,[ C-h v org-latex-prefer-user-labels RET ]
| org-latex-prefer-user-labels is a variable defined in ‘ox-latex.el’.
| Its value is t
| Original value was nil
| 
|   You can customize this variable.
| 
| 
| This variable was introduced, or its default value was changed, in
| version 26.1 of Emacs.
| 
| Documentation:
| Use user-provided labels instead of internal ones when non-nil.
| 
| [...]
| 
| For headlines that do not define the CUSTOM_ID property or
| elements without a NAME, Org will continue to use its default
| labeling scheme to generate labels and resolve links into proper
| references.
`

I don't think the HTML exporter has anything similar but it should be
possible to implement...

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78


customized link pointing at a src block

2019-11-09 Thread Łukasz Stelmach
Hi,

I'd like to have collapsible source code blocks in my org document
exported to HTML. To collapse and restore I have used[1]. The library
requires a link (or a button) with appropirate properties. A link needs
to point (href) to a block and have additional custom data-toggle
property. On Debian9/Emacs 24/org-mode 8.x I was able to craft such
links by hand

#+HTML: Show

#+NAME: code1
#+BEGIN_SRC python
return 42
#+END_SRC

On Debian10/Emacs26/org-mode 9.1.9 src blocks with a NAME get
automatically generated id-s (org-export-get-reference) and I can see no
way to determine href in my HTML snippet. (ATTR_HTML before org-mode
link does not work as advertised in the manual either).

Is there any way to generate a link (or a button) for every code block
with matching href/id you can recommend?

[1] https://getbootstrap.com/docs/4.2/components/collapse/

Kind regards,
-- 
Było mi bardzo miło.  --- Rurku. --- ...
>Łukasz<--- To dobrze, że mnie słuchasz.


signature.asc
Description: PGP signature