From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?=C5=81ukasz_Stelmach?= Subject: customized link pointing at a src block Date: Sat, 02 Nov 2019 20:34:25 +0100 Message-ID: <87r22q139a.fsf%steelman@post.pl> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34106) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQzCV-0007H1-4Z for emacs-orgmode@gnu.org; Sat, 02 Nov 2019 15:36:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQzCT-0003qe-Ud for emacs-orgmode@gnu.org; Sat, 02 Nov 2019 15:36:42 -0400 Received: from mx.post.pl ([89.161.254.201]:62951) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iQzCT-0003pC-OM for emacs-orgmode@gnu.org; Sat, 02 Nov 2019 15:36:41 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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<= /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, =2D-=20 By=C5=82o mi bardzo mi=C5=82o. --- Rurku. = --- ... >=C5=81ukasz< --- To dobrze, =C5=BCe mnie s= =C5=82uchasz. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEkPlMeih05HaDBMFPALaXbGOR03EFAl292rVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDkw Rjk0QzdBMjg3NEU0NzY4MzA0QzE0RjAwQjY5NzZDNjM5MUQzNzEACgkQALaXbGOR 03GW6wgAwdv7YNb9V4km9bzTv9pGyolXWljpZbL4vZSzBu3gD8K6N93n4ZPlTuzF 3JlvuGRZna8U0QPULqfijtecsvuJq8eTVoNQ5nBC6uEshp0GRctItFiOB2Cd4jDv yzr68xK6r6lryb8CZXsccB7MKIM8hGB1yEUOSXd7dVRLR6bhpYPG+8ddnTleZJ6U IYeM3Yvb8IIEoBpZnrpjN0G392FgrTLTFy19o9Ky22CENspMfJGK6xoGg5EaGzD5 2I/ciS6ESu1aP2Q4k3ri5G7jO4ozkWxsVOS90Nw3Bz1hNpUKt80Xx5HcYz8qOAf7 7CNNABu4r4/XBrI9U6SCbVnLiK48pQ== =7U6Z -----END PGP SIGNATURE----- --=-=-=--