From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yCDwFwS0gWC5VwAAgWs5BA (envelope-from ) for ; Thu, 22 Apr 2021 19:36:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KALMEwS0gWBKFwAA1q6Kng (envelope-from ) for ; Thu, 22 Apr 2021 17:36:04 +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 8E68D16243 for ; Thu, 22 Apr 2021 19:36:03 +0200 (CEST) Received: from localhost ([::1]:59356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZdFB-00069a-J0 for larch@yhetil.org; Thu, 22 Apr 2021 13:36:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZdEF-000696-Ve for emacs-orgmode@gnu.org; Thu, 22 Apr 2021 13:35:04 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:36707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZdED-0002bX-Qf for emacs-orgmode@gnu.org; Thu, 22 Apr 2021 13:35:03 -0400 Received: by mail-wm1-x32b.google.com with SMTP id o9-20020a1c41090000b029012c8dac9d47so3708487wma.1 for ; Thu, 22 Apr 2021 10:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=bDXK3KKa0OsZbZsUutDVuMfqbeexK7dr3fv1RhfET1A=; b=s8LJgivHHYMYMFB4OcD0JpuJkEb2/Dr9EnlOE4SMA08musAo3s6+JQqwVJdXkW1P40 IOHzawrpOOgZznEMyre9F9GexgIlHJ6ZmAJz0QpzlxN4VeFTZqeGCnZMdrPjZyy2BZjc aHX9q44a8viGNaUDHlxnTJ+V9tTFlZt7xaD2WF7nx0dI0ouEtOcIPl6v6EuznABCMsR4 ZEhz9wUO6wBe54jRMtuzsZmGDl3qoosokOBFiPagM5fWjZ3aUuyxE+jPB3oTnxQz92zL A+bT/G02Qr1AJ90OCbRY2P0mW5VNx1kBIpEbG9J5LMcygzTaUc/hfeLm0FWpSK6kg6eJ AfJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=bDXK3KKa0OsZbZsUutDVuMfqbeexK7dr3fv1RhfET1A=; b=RwybICyMBNeQaclqqDlwo2mL+oBssudWamXva7IBJzy/VdSnQ5cPc8DMuL8Y8aTCAm zae7du8CzWg1X1ixgAPyeZiAwIXUuWzKyDv4LHmXJrKv76e5emknXHIxRpyHlHfNcZU3 +m738IVQKv6ZipOjqzKUUBhxHTaaOQZte6Ek6/F95HU3aXNNsuDxFG3xAuwxA1ew8Lsx 5y9xfJ5Ugyin/iSd9kptQvrVCUrYdDhCWgQL6fC1ywXmNlXKXEZQ72EAinVqOYhTbvzY o7k6b8bM/wVWuAfHhZ6rw72i52+mvGzNXFmOOMFNJh1PE3gJ97l4W11mPgQW98onnzPy JUZg== X-Gm-Message-State: AOAM530TVcJ/rFheFyzKQ2V5ykwC12XNg4cOqNg4xzAzb1rpa0CIoYSd 9p4pBRKuTibDyTYaSTbY+SXl3f5v7mlUL5Rr6q4= X-Google-Smtp-Source: ABdhPJwzn9EFgShl9H+VQA9xCTnPxeN0gxnTazunVfhU23Gu5+ucodLsYK/uBC28ugodvHm0NySrDfJ+H2V0+jO5FW4= X-Received: by 2002:a1c:2c85:: with SMTP id s127mr4909530wms.83.1619112899886; Thu, 22 Apr 2021 10:34:59 -0700 (PDT) MIME-Version: 1.0 References: <87fszly7zg.fsf@kyleam.com> <871rb5ft6a.fsf@wi.uni-muenster.de> <87y2dcmcuk.fsf@wi.uni-muenster.de> <87pmyo16qr.fsf@web.de> <87h7jy4ebe.fsf@nicolasgoaziou.fr> <87bla649i3.fsf@nicolasgoaziou.fr> In-Reply-To: <87bla649i3.fsf@nicolasgoaziou.fr> From: Tim Visher Date: Thu, 22 Apr 2021 13:34:24 -0400 Message-ID: Subject: Re: ox-html Incorrectly (?) Puts HTML Into the `` Tag To: Tim Visher <tim.visher@gmail.com>, Jens Lechtenboerger <lechten@wi.uni-muenster.de>, "Dr. Arne Babenhauserheide" <arne_bab@web.de>, Emacs Org Mode mailing list <emacs-orgmode@gnu.org>, Kyle Meyer <kyle@kyleam.com> Content-Type: multipart/alternative; boundary="0000000000003fc39105c09319fb" Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=tim.visher@gmail.com; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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." <emacs-orgmode.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>, <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode> List-Post: <mailto:emacs-orgmode@gnu.org> List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>, <mailto:emacs-orgmode-request@gnu.org?subject=subscribe> Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" <emacs-orgmode-bounces+larch=yhetil.org@gnu.org> X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619112963; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=bDXK3KKa0OsZbZsUutDVuMfqbeexK7dr3fv1RhfET1A=; b=bQY98H0brFMuv4oBSSIkhtCcn8jcRkg2rWTJGYzZXaTVdL4LVun9Lm54zflUbv5JYWmBDQ d75pVohcWwD9CjTQNuwS/OXyb4Oiw6SLuTPdUKYxx7WdN89b3slwQ3PNDUMPAxgzMrvOCv 1qZL33dCygLT9ZsetdDUIC26gyZYAq9a9WDAZkenpGydBham9S/Ry7o13vVzB2JTs3kwOm 1HCkiyYzazozmma3AR/F02U2fD1gQvXtHHEcs0HPKrSfC4BoCSSByrTyJ4wvsI4ywN4SIu TqlK+xcdWICzi0hKOXffCxRQNu5dsO8Zo6Wf/oe0oAYnRNTYz7hiD0BkhVwixQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619112963; a=rsa-sha256; cv=none; b=EMH13rPqsBT4oJdvYh7DO3DWsnLhBhr/aNhf92KhCR+awwNLholYCT0o5BnywKo68w4fBs L+oTOVKe48Cx0NIUnaTwh5N4QHANPwG56HA5ZRLYjZS2OufaE8uza1gz4c1fI4Z8pDUplH 43aVvuPmDsIFm4aM47OF0Ha0ZSZWNGR28hLRldAH54q5cDzEeuRgt5vEfwJkgcjZFEWRB/ ejQu73HUY3STraumN3CGudsiSZk+ANowUjvxD1fWD7hYe/pww6d8g9FYnFw9DSSjAYae9C mFTOzJB0bpBBnazBMvQuS14byLEpoGXKyoF55jbFhthbzHPTthmyvlGS7TxLpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=s8LJgivH; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Spam-Score: -2.27 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=s8LJgivH; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Queue-Id: 8E68D16243 X-Spam-Score: -2.27 X-Migadu-Scanner: scn0.migadu.com X-TUID: +78zHbVkbzmv --0000000000003fc39105c09319fb Content-Type: text/plain; charset="UTF-8" On Thu, Apr 22, 2021 at 11:36 AM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote: > Tim Visher <tim.visher@gmail.com> writes: > > > Thanks for the tip. What I'm thinking more is somehow getting the heading > > pre-output generation, stripping any characters that `org` would consider > > special (I'm hoping there's already a function that can at least mark > > 'markup' text in a given org string), and _then_ passing it to whatever > ox > > function is responsible for using the title. That way it's as generic as > it > > can possibly be. > > What format has "heading pre-output generation"? Is a string or is it > parsed data? The first part of your paragraph sounds like you want to > rewrite an Org parser. > > How do you pass it to ox function responsible for using the title? I.e., > who/what is responsible for making the change to the title? Is it the > user? > > You may need to clarify your specifications. > > > I confess though that I don't follow exactly what you're talking about > > defining a temporary export back-end. > > In `org-html--build-meta-info' from "ox-html.el", replace the following > > (org-html-plain-text > (org-element-interpret-data (plist-get info :title)) info) > > with > > (org-export-data-with-backend (plist-get info :title) > (org-export-create-backend > :transcoders > '((bold . (lambda (_ c _) c)) > (italic . (lambda (_ c _) c)))) > info) > > Now re-evaluate the function `org-html--build-meta-info' and try > exporting a document to HTML with a title containing bold and italic > syntax, even nested, e.g. > > #+title: /Some *bold* text/ > > > Why would that be necessary or beneficial to the end of teaching org > > how to use only the 'plain text' of a heading for the title in N ox > > backends? > > Adding the function `org-export-strip-syntax below to "ox.el" > > (defun org-export-strip-syntax (data info) > (org-export-data-with-backend data > (org-export-create-backend > :transcoders > '((bold . (lambda (_ c _) c)) > (italic . (lambda (_ c _) c)))) > info)) > > you can now call it from any export back-end whenever its needs to > remove syntax from a piece of code. > > You can also drop the info argument and add it to "org-element.el". But > it depends on what you want to obtain. Also, some syntax is not obvious > to strip, as I suggested in my previous message. > Awesome! This is a ton of great info. If I decide to bite this off I'll be sure to reference this. :) --0000000000003fc39105c09319fb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">On Thu, Apr 22, 2021 at 11:36 AM Nicolas = Goaziou <<a href=3D"mailto:mail@nicolasgoaziou.fr">mail@nicolasgoaziou.f= r</a>> wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D"g= mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204= ,204,204);padding-left:1ex">Tim Visher <<a href=3D"mailto:tim.visher@gma= il.com" target=3D"_blank">tim.visher@gmail.com</a>> writes:<br> <br> > Thanks for the tip. What I'm thinking more is somehow getting the = heading<br> > pre-output generation, stripping any characters that `org` would consi= der<br> > special (I'm hoping there's already a function that can at lea= st mark<br> > 'markup' text in a given org string), and _then_ passing it to= whatever ox<br> > function is responsible for using the title. That way it's as gene= ric as it<br> > can possibly be.<br> <br> What format has "heading pre-output generation"? Is a string or i= s it<br> parsed data? The first part of your paragraph sounds like you want to<br> rewrite an Org parser.<br> <br> How do you pass it to ox function responsible for using the title? I.e.,<br= > who/what is responsible for making the change to the title? Is it the<br> user?<br> <br> You may need to clarify your specifications.<br> <br> > I confess though that I don't follow exactly what you're talki= ng about<br> > defining a temporary export back-end.<br> <br> In `org-html--build-meta-info' from "ox-html.el", replace the= following<br> <br> =C2=A0 (org-html-plain-text<br> =C2=A0 =C2=A0(org-element-interpret-data (plist-get info :title)) info)<br> <br> with<br> <br> =C2=A0 (org-export-data-with-backend (plist-get info :title)<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-export-create-backend<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:transcoders<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'((bold . (lambda (_ c _) = c))<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(italic . (lambda (_ c = _) c))))<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info)<br> <br> Now re-evaluate the function `org-html--build-meta-info' and try<br> exporting a document to HTML with a title containing bold and italic<br> syntax, even nested, e.g.<br> <br> =C2=A0 #+title: /Some *bold* text/<br> <br> > Why would that be necessary or beneficial to the end of teaching org<b= r> > how to use only the 'plain text' of a heading for the title in= N ox<br> > backends?<br> <br> Adding the function `org-export-strip-syntax below to "ox.el"<br> <br> =C2=A0 (defun org-export-strip-syntax (data info)<br> =C2=A0 =C2=A0 (org-export-data-with-backend data<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-export-create-backend<br= > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:transcoders<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'((bold . (lambda (= _ c _) c))<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(italic . (lambd= a (_ c _) c))))<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info))<br> <br> you can now call it from any export back-end whenever its needs to<br> remove syntax from a piece of code.<br> <br> You can also drop the info argument and add it to "org-element.el"= ;. But<br> it depends on what you want to obtain. Also, some syntax is not obvious<br> to strip, as I suggested in my previous message.<br></blockquote><div><br><= /div><div>Awesome! This is a ton of great info. If I decide to bite this of= f I'll be sure to reference this. :)=C2=A0</div></div></div> --0000000000003fc39105c09319fb--