From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OE4XAwgwvV9zPwAA0tVLHw (envelope-from ) for ; Tue, 24 Nov 2020 16:08:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YLm1OgcwvV/0cgAAB5/wlQ (envelope-from ) for ; Tue, 24 Nov 2020 16:08:39 +0000 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 6CEE09406FA for ; Tue, 24 Nov 2020 16:08:39 +0000 (UTC) Received: from localhost ([::1]:51706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khars-0006k3-Gx for larch@yhetil.org; Tue, 24 Nov 2020 11:08:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khar0-0006iA-98 for emacs-orgmode@gnu.org; Tue, 24 Nov 2020 11:07:43 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:10218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1khaqw-0007s0-8U for emacs-orgmode@gnu.org; Tue, 24 Nov 2020 11:07:41 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4CgTSN4Sp5zQlWX for ; Tue, 24 Nov 2020 17:07:32 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=guelker.eu; s=MBO0001; t=1606234050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v6Kno7hyJrAXv/8tBDH+GoIZDR2+eUd5AvoUz+Dcz0M=; b=B02Q+y5HCLmdsxSa17lksTWECziqWSWb+oETXQei4ldVoW+vpU7cSyC1VYyVsgL5P4wCe4 ran0PeXjLxJ5PABWdDM5jaisBiSaCz6sUnif8iHCBx7IbQDy57ePW/4WR2CHiElU6045yk AdMmJKjxYcmk9FbK4wTJHD1lBOQuuLKQRidS3utAKdbeGjjLdBwqraSzQhRd8dd0RNwQc/ 0/hojZn9SGZOeEQPGnaOgl44WcZR5Zd9F07DoSYxAnmDPbq+UwuHEpG3jGbYmBj9Fekt3z EtAPOIeY/r14rAD/D+abYW/i++P1RGa3xTWjN3IlFq6YS8mztsXhpFST6wsOoA== Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id A0aBmaYWNkiJ for ; Tue, 24 Nov 2020 17:07:29 +0100 (CET) From: =?utf-8?Q?Marvin_=E2=80=98quintus=E2=80=99_G=C3=BClker?= To: emacs-orgmode@gnu.org Subject: Re: Differentiate source blocks in export? References: <87a6v7gdej.fsf@fastmail.fm> Mail-Followup-To: emacs-orgmode@gnu.org Date: Tue, 24 Nov 2020 17:07:27 +0100 In-Reply-To: <87a6v7gdej.fsf@fastmail.fm> (Joost Kremers's message of "Tue, 24 Nov 2020 13:14:28 +0100") Message-ID: <87sg8yivr4.fsf@guelker.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-MBO-SPAM-Probability: X-Rspamd-Score: -4.86 / 15.00 / 15.00 X-Rspamd-Queue-Id: 5EE721726 X-Rspamd-UID: 834206 Received-SPF: pass client-ip=80.241.56.171; envelope-from=post+orgmodeml@guelker.eu; helo=mout-p-201.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=guelker.eu header.s=MBO0001 header.b=B02Q+y5H; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: Uv/rAUWz8DUB Hi! Am Dienstag, dem 24. November 2020 schrieb Joost Kremers: > I was wondering if there's a way to distinguish between different kind of= source > code blocks when exporting to HTML. > > Specifically, I would like a way to mark certain code blocks in my Org fi= le so > that those code blocks get a specific class in the HTML export. You can use the BEGIN_EXPORT/END_EXPORT pair to include a literal HTML DIV tag around your target code block. Try this: Wrapped code block in a div with a custom class: #+BEGIN_EXPORT html
#+END_EXPORT #+BEGIN_SRC c #include int main(int argc, char* argv[]) { printf("This is wrapped in the div\n"); return 0; } #+END_SRC #+BEGIN_EXPORT html
#+END_EXPORT Normal codeblock without: #+BEGIN_SRC c #include int main(int argc, char* argv[]) { printf("This is not wrapped in anything unusual\n"); return 0; } #+END_SRC Note how one of the EXPORT blocks wraps the opening tag of the DIV and the other one wraps the closing tag. -quintus --=20 Dipl.-Jur. M. G=C3=BClker | https://mg.guelker.eu | For security: Passau, Germany | kontakt@guelker.eu | () Avoid HTML e-mail European Union | PGP: see homepage | /\ http://asciiribbon.org