From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id iKxAOsyUgGQ3CwEASxT56A (envelope-from ) for ; Wed, 07 Jun 2023 16:31:41 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yPj6OcyUgGTc6AAAauVa8A (envelope-from ) for ; Wed, 07 Jun 2023 16:31:40 +0200 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 90C823C787 for ; Wed, 7 Jun 2023 16:31:40 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q6uBL-0005Ve-AM; Wed, 07 Jun 2023 10:30:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6uB2-0005UU-Oi for emacs-orgmode@gnu.org; Wed, 07 Jun 2023 10:30:22 -0400 Received: from mailer-211-160.hitrost.net ([91.185.211.160]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6uB0-0005X1-It for emacs-orgmode@gnu.org; Wed, 07 Jun 2023 10:30:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: In-reply-to:Subject:Cc:To:From:References:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gQWp7PlGZqvGW2nUgJQdPCME/r1u0YUuEEdex0IKk2c=; b=3noROLkdvDUyUZh8oSS915b6sl UJVjg96UBAxNhYAOnUE3cJNM2NAUCKTfPVsuRCzbEBfCZwqJWIw35Y/y0eDGluprU43m0L+LIMLHS fa9vL714rIdxBN8q2zHOwERDCCL2fc2vDv6Ds5/Gqxc+VGjEbwxGGHDZno6jVhiR4dSXxMWZQIJMt p9yL5b1I3SglLFRLi/uTczEMk95XyHo3M56eJv9JnbuE0gklXticMJ5XLxxFtQ5TP/NT4n03GHzZP e2klJwjn4Qv6qtQZC3HOBFup1D7nL/ewxTIeQ1mpYxIQGD++nel99kGCaWShX08uoo/3w7jQYmE+z zJEw3dcg==; Received: from 92-63-16-127.dynamic.telemach.net ([92.63.16.127] helo=Tauriel) by b1.hitrost.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96-58-g4e9ed49f8) (envelope-from ) id 1q6uAk-00C3iY-0R; Wed, 07 Jun 2023 16:30:02 +0200 References: <871qip3u90.fsf@localhost> <87fs74j4la.fsf@christianmoe.com> <87cz27eka4.fsf@localhost> User-agent: mu4e 1.2.0; emacs 27.2 From: Christian Moe To: Ihor Radchenko Cc: emacs-orgmode@gnu.org, gerard.vermeulen@posteo.net, Timothy Subject: Re: [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG In-reply-to: <87cz27eka4.fsf@localhost> Date: Wed, 07 Jun 2023 16:30:01 +0200 Message-ID: <87h6rjqr9y.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain X-GeoIP: Country [IP], SI [92.63.16.127] X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-Authenticated-Id: mail@christianmoe.com Received-SPF: pass client-ip=91.185.211.160; envelope-from=mail@christianmoe.com; helo=mailer-211-160.hitrost.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1686148300; a=rsa-sha256; cv=none; b=DNjhpGyiqsLTZswK4S4i8q6PNnF8fDb9hEB4ABt2O+RT3+EKrBWrtmoy4pbupX7Wz9W121 9TZUDK/aqHo6CJcZtpvb8SA6iZczrtO4thCm+vRi4fa1Y1huqCEr0r/lgbWbKwWpG4P7Kn Ms3ptG6lUCRESo+T9p9R/Z/xRYPJT9abcTIjOh4LdilBuZGiwnc8HeiEoDhjjblGFEGLmb WXHP0TnruTiI4Jm8pFDH5wP2UcKpQ/28Q7LVHtVKJY8Ip9v3SJCua+vbn5nO/bFLeNVneS pPQrrB2QbheghN62oDviP8ji4ggiDqNZ8LJFSRoyurqFiVZ4FLrJDi/eLltvyw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=3noROLkd; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1686148300; 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=gQWp7PlGZqvGW2nUgJQdPCME/r1u0YUuEEdex0IKk2c=; b=s1gekgU+wd+6za95/y6S5vzq7CnA7I9FXGDcuAFDiRpJ15eVOcsWsMKr6dR8WH5p/cTm7C 0hCXLE1MkTh23kwmXXwN8iJBbe0o+l7AB4ffAeDZ5uzuqtMQp/eAxwX3WtH7ye8/HkTNv6 smpXoZhQvjslelJ972yrN5yaKLyqcrj2TImwrAFNZbXao5wB+YQ/ZbllWz6ayjGq17DinG Qd387OXUxY41xHD/lhKB2euegk3Co7eD9+mq69YF92RMHQ59Ex5XBb87NohB5UZBDNmm5P aSmUfWbxX0/GYh4vYeEqcwnBjKT24voM+Vlb8XfuUov0vba5qPxbqFYS9RjIIw== Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=3noROLkd; dmarc=none; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -3.50 X-Spam-Score: -3.50 X-Migadu-Queue-Id: 90C823C787 X-TUID: cyKBpOD6XXF5 Ihor Radchenko writes: > Christian Moe writes: > >> I think there's a better approach. Tl;dr: >> >> - A better way to have active CSS in SVG images is to link to the >> external SVG file with the rather than tag, as we used >> to. > > Reading the linked threads, it seems that has its own > downsides. Why is it strictly better then? I'm not sure it's strictly better. The problem in the linked threads was with scaling, and I don't think it applies anymore. As I just tested in Firefox, at least, I can control the size of Gerard's SVG illustration perfectly well by setting CSS height and width attributes on an . Apart from that, my reasoning amounted only to this: - works as well as embedding for CSS - For Org to extract and embed the SVG means more things that can break (though I admit that it can be made a lot less fragile than the #+INCLUDE hack) and when they do break, it's an Org problem. With Org just needs to properly format the tags; if it does, the rest is the browser's responsibility. - If the external SVG file is modified, with embedding all files referencing it need to be exported again for the change to take effect. With linking to the external file, all that is needed is refreshing the browser. - Readable, uncluttered HTML is nice; huge, unreadable stretches of SVG aren't. Some arguments for embedding I didn't consider: - fewer http calls - It makes accessing the SVG internals with Javascript a bit easier than with (the difference is just one line of JS) -- and a lot easier if you trigger Firefox's same-origin restrictions by keeping the files on a file system rather than a server. >> - Without patching Org, you can embed an external SVG file as an SVG >> island in Org HTML export simply by using #+INCLUDE. > > To be clear, I am in favor of adding "embedding" switch for ox-html in > general. It is a feature several people requested elsewhere - for all images. > #+INCLUDE is cumbersome, does not work with captions, and will generally > break Org customization relying on Org knowing what kind of object is > being exported. Fair points. Yours, Christian