emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Łukasz Stelmach" <steelman@post.pl>
To: emacs-orgmode@gnu.org
Subject: customized link pointing at a src block
Date: Sat, 02 Nov 2019 20:34:25 +0100	[thread overview]
Message-ID: <87r22q139a.fsf%steelman@post.pl> (raw)

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

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: <a class="btn" data-toggle="collapse" href="#code1">Show</a>

    #+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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 617 bytes --]

             reply	other threads:[~2019-11-02 19:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-02 19:34 Łukasz Stelmach [this message]
2019-11-10 11:25 ` customized link pointing at a src block Fraga, Eric

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=87r22q139a.fsf%steelman@post.pl \
    --to=steelman@post.pl \
    --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).