Re: [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG

2023-06-15 Thread Ihor Radchenko
gerard.vermeu...@posteo.net writes:

> On 07.06.2023 19:57, Ihor Radchenko wrote:
> [...]
> I understand why you prefer the  tag over the  tag.
>
>> Finally, I can see that there are ways to use CSS on img+svg:
>> https://blog.union.io/code/2017/08/10/img-svg-fill/
>
> I failed to make the flower example work with the information on this 
> site.

I am not expert in html. Maybe someone else (Timothy?) can chime in.

That said, I do not see why we cannot offer  strategy as an
option regardless whether is can solve the problem with CSS.

> ;; For each SVG image during HTML export:
> ;; 1. It checks `svg-as-object' and "image in-lining" whether to
> ;;embed the SVG image in an  tag.
> ;; 2. If not, it checks `svg-inclusion' and "image in-lining"
> ;;whether to copy the SVG contents to the HTML output.
> ;; 3. If not, it falls back to checking "image in-lining" whether to
> ;;embed the SVG image in an  tag (as any other image type).
> ;; 4. It is possible to set `svg-as-object' and/or `svg-inclusion':
> ;;- For each SVG link by means of "#+ATTR_HTML: :svg-as-object t"
> ;;  or "#+ATTR_HTML: :svg-inclusion t".
> ;;- Within file scope by means of "#+OPTIONS: svg-as-object:t" or
> ;;  "#+OPTIONS: svg-inclusion:t".
> ;;- Within toplevel scope by means of the options
> ;;  `org-html-svg-as-object' or `org-html-svg-inclusion'.

I think you missed `org-html-inline-image-rules' where users can
include/exclude svg images from inlining.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG

2023-06-15 Thread Ihor Radchenko
Max Nikulin  writes:

> Has anybody compared memory footprint of a document with multiple SVG 
> images rendered by a browser with  vs  strategies? It seems 
> at least Firefox may create frames for each  so the page may be 
> rather heavy.

I do not think it matters. At least, it should not stop us from
providing  as an optional feature.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [POLL] Will it be ok to allow HABIT property inheritance? (optionally) (was: [BUG] org-habit does not respect STYLE property inheritance)

2023-06-15 Thread Dmitry Logvinenko
--
Dmitry Logvinenko // dmlogv


0001-lisp-org-habit.el-Inherit-habit-style-property.patch
Description: Binary data


Re: Is this proper time format?

2023-06-15 Thread David Masterson
Ihor Radchenko  writes:

> David Masterson  writes:
>
>>  To assist project planning, TODO items can be labeled with a date
>> -and/or a time.  The specially formatted string carrying the date and
>> +and/or a time purposes like when an event happens, a deadline for a
>> +task, or tracking time spent on a task as described in later sections
>> +of this chapter.  The specially formatted string carrying the date and
>>  time information is called a /timestamp/ in Org mode.
>
> What about:
>
> To assist project planning, TODO items can be labeled with a date
> and/or a time.  The specially formatted string carrying the date and
> time information is called a /timestamp/ in Org mode.  This may be
> a little confusing because timestamp is often used as indicating when
> something was created or last changed.  However, in Org mode this term
> is used in a much wider sense.
>
> Timestamps can be used to plan appointments, schedule tasks, set
> deadlines, track time, and more.  The following sections describe
> the timestamp format and tooling that Org mode provides for common
> use cases dealing with time and time intervals.

I agree with your change.  I'm often minimalist in my changes (especially when
I'm trying not to rock the boat), but that's not always good.  If that's
it, make the change in both files and we can call it a day.  :-)

-- 
David Masterson



Re: [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG

2023-06-15 Thread Max Nikulin

On 15/06/2023 20:09, gerard.vermeu...@posteo.net wrote:

;;    - For each SVG link by means of "#+ATTR_HTML: :svg-as-object t"
;;  or "#+ATTR_HTML: :svg-inclusion t".


Is there any advantages of using separate boolean attributes instead of 
multiple values?


- :svg object
- :svg img
- :svg dom (or any other value for inserting contents of SVG files into 
HTML)


"inline" is really ambiguous here since it may mean CSS display property 
block vs. inline that is similar to Org's block-level elements and 
inline objects.


Has anybody compared memory footprint of a document with multiple SVG 
images rendered by a browser with  vs  strategies? It seems 
at least Firefox may create frames for each  so the page may be 
rather heavy.




Re: [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG

2023-06-15 Thread gerard . vermeulen




On 07.06.2023 19:57, Ihor Radchenko wrote:
[...]
I understand why you prefer the  tag over the  tag.


Finally, I can see that there are ways to use CSS on img+svg:
https://blog.union.io/code/2017/08/10/img-svg-fill/


I failed to make the flower example work with the information on this 
site.

It could be my fault, but maybe also because the post targets the React
framework since its subtitle reads "A Side Quest in Optimizing 
Performance

for React".

FWIW, here a brief description of how I solved my problem of making the
MDN flower work taking into account the comments for improvement as
far as I could. Thanks!

https://forge.chapril.org/gav451/emacs.d/src/branch/main/site-lisp/ox-svg4css/ox-svg4css.el
is a new derived backend for personal use.  The commentary section of
the backend and MWE follow below:

#+begin_src emacs-lisp
;; This library implements an HTML derived backend for Org export.
;; It tries to address limitations of SVG images and CSS in HTML pages.
;; For each SVG image during HTML export:
;; 1. It checks `svg-as-object' and "image in-lining" whether to
;;embed the SVG image in an  tag.
;; 2. If not, it checks `svg-inclusion' and "image in-lining"
;;whether to copy the SVG contents to the HTML output.
;; 3. If not, it falls back to checking "image in-lining" whether to
;;embed the SVG image in an  tag (as any other image type).
;; 4. It is possible to set `svg-as-object' and/or `svg-inclusion':
;;- For each SVG link by means of "#+ATTR_HTML: :svg-as-object t"
;;  or "#+ATTR_HTML: :svg-inclusion t".
;;- Within file scope by means of "#+OPTIONS: svg-as-object:t" or
;;  "#+OPTIONS: svg-inclusion:t".
;;- Within toplevel scope by means of the options
;;  `org-html-svg-as-object' or `org-html-svg-inclusion'.
;;
;; Caveats: the HTML output does not comply with W3C recommendations
;; after `svg-as-object' and/or `svg-inclusion' exports and it does not
;; comply with the Org Manual section "13.9.9 Images in HTML export"
;; after `svg-inclusion' exports.
;;
;; See: 
https://list.orgmode.org/c1eef10be815748d2103cb81bce08...@posteo.net/

;; where Cristian Moe has proposed to embed SVG images in  tags.
;; Ihor Radchenko and Max Nikulin have insisted on the use of special
;; "#+ATTR_HTML:" attributes to control the export options.
;;
;; I prefer enabling `:svg-as-object' over enabling `:svg-inclusion'.
;;
;; Relevant W3C documentation:
;;
;; Loading an SVG image by an HTML ,  or  tag:
;; https://stackoverflow.com/a/12604286
;; https://svgwg.org/specs/integration/#referencing-modes
;; https://svgwg.org/specs/integration/#embedded-document-mode
;; https://svgwg.org/specs/integration/#dynamic-interactive-mode
;;
;; Four types of SVG document usage with their security implications:
;; https://www.w3.org/wiki/SVG_Security
#+end_src

#+begin_src org :tangle mwe.org
#+title: SVG and CSS MWE with svg4css backend using svg-as-object
#+HTML_DOCTYPE: html5
The files =doc8.svg= and =style8.css= come from 
[[https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_and_CSS][SVG 
and CSS (MDN)]].

Open =doc8.svg= and =mwe.html= in Firefox to compare hovering over the
flower.  The flower remains fully black in case of an M-non-WE.

#+ATTR_HTML: :svg-as-object t :title Does the flower work?
#+CAPTION: Is MWE with SVG export in an  tag instead of an  
tag.

[[./doc8.svg]]
# Note: the object tag requires to start the link with ./ to resolve it.
#+end_src

Best regards -- Gerard




Re: Is this proper time format?

2023-06-15 Thread Ihor Radchenko
David Masterson  writes:

>  To assist project planning, TODO items can be labeled with a date
> -and/or a time.  The specially formatted string carrying the date and
> +and/or a time purposes like when an event happens, a deadline for a
> +task, or tracking time spent on a task as described in later sections
> +of this chapter.  The specially formatted string carrying the date and
>  time information is called a /timestamp/ in Org mode.

What about:

To assist project planning, TODO items can be labeled with a date
and/or a time.  The specially formatted string carrying the date and
time information is called a /timestamp/ in Org mode.  This may be
a little confusing because timestamp is often used as indicating when
something was created or last changed.  However, in Org mode this term
is used in a much wider sense.

Timestamps can be used to plan appointments, schedule tasks, set
deadlines, track time, and more.  The following sections describe
the timestamp format and tooling that Org mode provides for common
use cases dealing with time and time intervals.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [POLL] [BUG] Inverse behavior from \ [9.6.4 (release_9.6.4-1-g76cf21 @ /Users/johnw/.emacs.d/lisp/org-mode/lisp/)]

2023-06-15 Thread Ihor Radchenko
John Wiegley  writes:

> Since the documentation also mentions that space means “any tag”, I guess now
> it’s a design question: Should  mean “no tags” or “any tag”? I feel
> like it should mean “no tag” only because you also use space to clear all tags
> in the agenda after pressing “:”.
>
> If the decision is “desired behavior”, then the muscle memory needed is
> ‘\ - ‘ rather than ‘\ ‘. Still feels odd for space to mean
> anything rather than nothing, though… I mean, space is empty, right? :)

Yeah. I checked the manual, and we have SPC being "any tag at all" since
the very beginning of the git history:

  #+findex: org-agenda-filter-by-tag
  Filter the agenda view with respect to a tag.  You are prompted for
  a tag selection letter; {{{kbd(SPC)}}} means any tag at all.

Upon seeing the manual, I am inclined to keep the current behaviour,
unless we have other voices supporting the change.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at