From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SKo5KaC7EGKwDQAAgWs5BA (envelope-from ) for ; Sat, 19 Feb 2022 10:42:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qBDlJaC7EGIN1gAAauVa8A (envelope-from ) for ; Sat, 19 Feb 2022 10:42:56 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 12ED411E42 for ; Sat, 19 Feb 2022 10:42:56 +0100 (CET) Received: from localhost ([::1]:48192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLMGU-0000Yb-OO for larch@yhetil.org; Sat, 19 Feb 2022 04:42:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLMFm-0000Cd-Uq for emacs-orgmode@gnu.org; Sat, 19 Feb 2022 04:42:10 -0500 Received: from mout02.posteo.de ([185.67.36.66]:36723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLMF0-0007Wv-UB for emacs-orgmode@gnu.org; Sat, 19 Feb 2022 04:42:10 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 74612240106 for ; Sat, 19 Feb 2022 10:41:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1645263667; bh=H0tqM3FfvYWAOfhWkbxGTLKVyibeAj8WaZXU/AiKqig=; h=From:To:Cc:Subject:Date:From; b=jk+3SbS0hj9kqcrW2KXpwqdeO1umZrLP9k4DbP+ZDdiVxXbrJtoAT5577gxdyU96Q q9GNKU8xrIMZMcSYLAjN1+va232ilG7C73e3fBhM6CvDb4T+SNU44I2xW7HHVcmBeK yOBYhSB+vNZ4yD1cDuYfckWBwXzmJfc4McWutNGMMfPRRqbgfhk+Pd0qACj4uCbCqo Kwn/hb9hfLonqSk/HUGxaqh/4gt6AT1h1ZM6OdWn8Sz+NMLalQ81xT3hQEt386eV/3 BtbNW2z4Ad34TSgNL9G4nmAdzTfqoyC7d9zVqw2uMdkAm+B6TyM+Ft2eA3X91Gegho 0iABg0u5szCtA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4K13Tt55fVz9rxL; Sat, 19 Feb 2022 10:41:06 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: "Samuel Banya" Subject: Re: Question Regarding Creating HTML Style Buttons With Org Mode References: <086129c3-de30-4e0b-a0b7-6b1c9b0578b6@www.fastmail.com> <871r01i1pm.fsf@posteo.net> <45e958d4-9c0c-4ea6-90b7-433ed9f38d44@www.fastmail.com> <875ypbap18.fsf@posteo.net> <871qzzaofq.fsf@posteo.net> <9c3009fc-3d69-41dc-ae61-0d60e10f1598@www.fastmail.com> Date: Sat, 19 Feb 2022 09:41:04 +0000 In-Reply-To: <9c3009fc-3d69-41dc-ae61-0d60e10f1598@www.fastmail.com> (Samuel Banya's message of "Fri, 18 Feb 2022 20:02:14 -0500") Message-ID: <87r17zb3db.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=maciaschain@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645263776; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=MDVdyFIBOp5IKCKEpaWiZLYasvKqJYRI9ESQQjISk0Y=; b=Sbpjl5abG6DIyIb2kBYoLtwVC2e6OQbXNoZF1PkWj8kT4UtIOwqY1r3VHrF/q5kXxS3AQ8 3Z6WC3RhZiLbkGOXBOhl+BfkMPNNVWrHF3Bn67+b94dWr/u2FJxrNcrFCUblAhN5bNrABL rEJEoavJU36/wE3GO23f7PpIee7+1+EHymipEjRJjYs/FWDdiiz17JEm/lqaXZQkyvBCqB dbX9TPMdyvWGKkpObDFsm5AHXKFN95RflMfqqg2/irwDblIU46i8lRuKJaw8r/fXEGhroQ CLAUJh7WWOCQOQfyVwVX/2YVP4u+WJ9miyxdfZc/ErHy1WIHyLGcTetB6SUpJg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645263776; a=rsa-sha256; cv=none; b=QEKJQKppPFQJPymJhCdvNIYvWTGDBDCI7eVRP/I4WtM6WMUKj6hdH/oyZl3b4iUzeD2KGH AcP4Wto4Y1HUjj+v8v6HyhvCYWJTwxXtH0m0/47Pa80ewfYobkv7PPP6RwnyqB9S98oLqu 4loXRcyXXuIqJcym5DDY+qToQbbj4bUdyCRI2a/LTSNQ9BF+JA4X+LP/UjwamSxkIkV3up AJHhEsGsIgE6CAbmZskAwbgNWRjmC764FYdxwcZ4KHPQjLq4iWCLMJApDeXm3C6c/E3KrQ 8zMHMH8cMEF9Niuc5YvJMtSsNXNliXzDKtwiuLYC9U6t63O6SwkFyiGIfGbvXg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=jk+3SbS0; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.53 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=jk+3SbS0; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 12ED411E42 X-Spam-Score: -4.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: JXbKbbDNpcoa Samuel Banya writes: > To clarify, did you evaluate that code block on the org mode docs > itself? The code must be evaluated *before* using that new type of link, or saved to your ~/.emacs. You can simply evaluate it in your `scratch' buffer: (org-link-set-parameters "button" :face '(:foreground "green4" :underline t) :follow (lambda (path) (browse-url path)) :export (lambda (path desc backend) (when (eq backend 'html) (format "
" path desc)))) If you want to pass the class or id 'manually' to each link, and thus have more control, you can evaluate this other version, where the class or id would be added at the end of the link description, after (for example) "!style": (org-link-set-parameters "button" :face '(:foreground "green4" :underline t) :follow (lambda (path) (browse-url path)) :export (lambda (path desc backend) (when (eq backend 'html) (let* ((style (if (string-match "\\(!style .+\\)" desc) (match-string 1 desc) "")) (desc (replace-regexp-in-string style "" desc))) (format "
" style path desc))))) Example: [[button:http://www.sambanya.com/artgallery.html][Art Gallery Page Link !style class="mybutton"]] == HTML ==>

> I ask because if I try to evaluate it, aka 'C-c C-c' on the > '#begin_src' block, nothing happens. When you evaluate the code and add the new link type 'button', does it appear in your document with the face defined for that link: green, underlined? Have you tried testing it on a clean Emacs/Org? Best regards, Juan Manuel