bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to skip default css format lines in html output


From: Gavin Smith
Subject: Re: how to skip default css format lines in html output
Date: Sun, 2 May 2021 10:49:37 +0100
User-agent: Mutt/1.9.4 (2018-02-28)

On Sat, May 01, 2021 at 07:07:28PM -0700, Per Bothner wrote:
> It seems wrong to include inline css in generated html files,
> especially when using the --ccs-ref or -C INFO_JS_DIR options.
> The documentation is complicated. The advice to use !important
> to override the default style rules feels quite wrong-headed.
> 
> However, looking at  _default_format_css_lines in HTML.pm
> I don't see a clean/clear way to skip the default rules.
> NO_CSS has other effects.  I don't understand this test:
>   return if (!@{$self->{'css_import_lines'}} and !@{$self->{'css_rule_lines'}}
>              and !keys(%{$self->{'css_map'}}) and !@$css_refs);

It means to exit the function if none of the arrays or hashes referred to
have anything in them.

> One simple and clean idea would be for a --css-ref option to cause the
> default rules to be skipped - but it would break backward compatibility.
> I don't know how seriously.

That's not a good idea as some CSS rules would be missing.

> One option is to piggy0back on the -ccs-include option.
> For example --css-include=NONE or --css-include=no-defaults
> would skip the default rules.  Or an entirely new option.

Could you test the following and see if it works okay for using NO_CSS
with --css-ref?

diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index abb57b23d0..b11cb7b0ba 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -5393,8 +5393,6 @@ sub _prepare_css($)
 {
   my $self = shift;
   
-  return if ($self->get_conf('NO_CSS'));
-
   my @css_import_lines;
   my @css_rule_lines;
 
@@ -7827,7 +7825,7 @@ sub _attribute_class($$$;$)
   my $class = shift;
   my $extra_classes = shift;
 
-  if (!defined($class) or $class eq '' or $self->get_conf('NO_CSS')) {
+  if (!defined($class) or $class eq '') {
     if ($element eq 'span') {
       return '';
     } else {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]