Skip to content
This repository has been archived by the owner on Oct 30, 2021. It is now read-only.

keep Doctype-Declaration #156

Open
JoKalliauer opened this issue May 20, 2018 · 6 comments
Open

keep Doctype-Declaration #156

JoKalliauer opened this issue May 20, 2018 · 6 comments

Comments

@JoKalliauer
Copy link
Contributor

I know some decline Doctype-Declaration (DTD): https://jwatt.org/svg/authoring/#doctype-declaration

But I personally prefer Doctype-Declaration, because https://validator.w3.org/ has a different Check for SVGs with DTD, and it does not display any warning. Is there an option to keep DTD?

scour keeps it and for svgo is an option for keeping DTD:

$ svgo -i input.svg -o output.svg --disable=removeDoctype

Or you might can convince me that SVGs should not have DTD.

@RazrFalcon
Copy link
Owner

It's not possible. I can create a new one if you need.

@JoKalliauer
Copy link
Contributor Author

I would like such option because I always reinsert it manually, also I think options should kept at a minimal level to be clear for new users.

@RazrFalcon
Copy link
Owner

options should kept at a minimal level

What do you mean?

@JoKalliauer
Copy link
Contributor Author

Nothing important.
I mean that

svgcleaner.exe --help

svgcleaner could help you to clean up your SVG files from the unnecessary data.

A complete documentation can be found here: https://github.com/RazrFalcon/svgcleaner/blob/master/docs/svgcleaner.adoc

USAGE:
    svgcleaner [FLAGS] [OPTIONS] <in-file> <out-file>

    <FLAG> can contain values: true, false, yes, no, y, n

EXAMPLES:
    clean a file with default options:
    svgcleaner in.svg out.svg

    clean a file with custom options:
    svgcleaner --indent=2 --paths-coordinates-precision=5 --join-arcto-flags=yes in.svg out.svg

    clean a file without default options:
    svgcleaner --no-defaults --remove-comments=yes in.svg out.svg

    clean a stream using UNIX pipes:
    cat in.svg | svgcleaner -c - > out.svg

FLAGS:
    -h, --help                              Print help information
    -V, --version                           Print version information
    -c, --stdout                            Print result to the standard output
        --no-defaults                       Reset default flags to 'no'
        --multipass                         Clean a file multiple times
        --allow-bigger-file                 Allow bigger file
        --copy-on-error                     Copy an original file to the destination on error
        --quiet                             Show only warnings and errors

OPTIONS:
Elements:
    --remove-comments <FLAG>                Remove XML comments [default: yes]
    --remove-declarations <FLAG>            Remove XML declarations [default: yes]
    --remove-nonsvg-elements <FLAG>         Remove non-SVG elements [default: yes]
    --remove-unused-defs <FLAG>             Remove unused referenced elements [default: yes]
    --convert-shapes <FLAG>                 Convert basic shapes into paths [default: yes]
    --remove-title <FLAG>                   Remove 'title' element [default: yes]
    --remove-desc <FLAG>                    Remove 'desc' element [default: yes]
    --remove-metadata <FLAG>                Remove 'metadata' element [default: yes]
    --remove-dupl-lineargradient <FLAG>     Remove duplicated 'linearGradient' elements [default: yes]
    --remove-dupl-radialgradient <FLAG>     Remove duplicated 'radialGradient' elements [default: yes]
    --remove-dupl-fegaussianblur <FLAG>     Remove duplicated 'feGaussianBlur' elements [default: yes]
    --ungroup-groups <FLAG>                 Ungroup groups [default: yes]
    --ungroup-defs <FLAG>                   Ungroup 'defs' element [default: yes]
    --group-by-style <FLAG>                 Group elements by equal styles [default: yes]
    --merge-gradients <FLAG>                Merge gradients [default: yes]
    --regroup-gradient-stops <FLAG>         Regroup gradient 'stop' elements [default: yes]
    --remove-invalid-stops <FLAG>           Remove invalid 'stop' elements [default: yes]
    --remove-invisible-elements <FLAG>      Remove invisible elements [default: yes]
    --resolve-use <FLAG>                    Resolve 'use' elements [default: yes]

Attributes:
    --remove-version <FLAG>                 Remove 'version' and 'baseProfile' attributes [default: yes]
    --remove-nonsvg-attributes <FLAG>       Remove non-SVG attributes [default: yes]
    --remove-unreferenced-ids <FLAG>        Remove unreferenced 'id' attributes [default: yes]
    --trim-ids <FLAG>                       Trim 'id' attributes [default: yes]
    --remove-text-attributes <FLAG>         Remove text-related attributes if there is no text [default: yes]
    --remove-unused-coordinates <FLAG>      Remove unused coordinate attributes [default: yes]
    --remove-default-attributes <FLAG>      Remove attributes with default values [default: yes]
    --remove-xmlns-xlink-attribute <FLAG>   Remove an unused 'xmlns:xlink' attribute [default: yes]
    --remove-needless-attributes <FLAG>     Remove attributes that doesn't belong to this element [default: yes]
    --remove-gradient-attributes <FLAG>     Remove inheritable gradient attributes [default: no]
    --join-style-attributes <VALUE>         Join presentational attributes [values: no, some, all] [default: some]
    --apply-transform-to-gradients <FLAG>   Apply transformations to gradients [default: yes]
    --apply-transform-to-shapes <FLAG>      Apply transformations to shapes [default: yes]
    --remove-unresolved-classes <FLAG>      Remove unresolved classes from 'class' attributes [default: yes]

Paths:
    --paths-to-relative <FLAG>              Convert path segments into relative ones [default: yes]
    --remove-unused-segments <FLAG>         Remove unused path segments [default: yes]
    --convert-segments <FLAG>               Convert path segments into shorter ones [default: yes]
    --apply-transform-to-paths <FLAG>       Apply transformations to paths [default: no]
    --trim-paths <FLAG>                     Use compact notation for paths [default: yes]
    --join-arcto-flags <FLAG>               Join ArcTo flags [default: no]
    --remove-dupl-cmd-in-paths <FLAG>       Remove subsequent segments command from paths [default: yes]
    --use-implicit-cmds <FLAG>              Use implicit LineTo commands [default: yes]

Output:
    --trim-colors <FLAG>                    Use #RGB notation [default: yes]
    --simplify-transforms <FLAG>            Simplify transform matrices [default: yes]
    --coordinates-precision <NUM>           Set coordinates numeric precision (1..12) [default: 6]
    --properties-precision <NUM>            Set properties numeric precision (1..12) [default: 6]
    --transforms-precision <NUM>            Set transform values numeric precision (1..12) [default: 8]
    --paths-coordinates-precision <NUM>     Set path's coordinates numeric precision (1..12) [default: 8]
    --list-separator <SEPARATOR>            Set number list separator [values: space, comma, comma-space] [default: s                                                                                                                                                          pace]
    --indent <INDENT>                       Set XML nodes indent [values: none, 0, 1, 2, 3, 4, tabs] [default: none]

ARGS:
    <in-file>                               Input file
    <out-file>                              Output file

is quite long (which is perfect for advanced users, like me), but for new users it is not easy to not find the function the users is searching for, especially if he/she does not have the knowledge to understand the explanations. (But that's not critics, that is just that you maybe have to do a tradeoff.)

But If you ask me: I would like the option --removeDoctype no (or keepDTD or insertDTD, or something similar)

@RazrFalcon
Copy link
Owner

Ok. I will add it.

for new users it is not easy to not find the function

That's why the GUI exists. I don't plan to simplify the help output for now.

@JoKalliauer
Copy link
Contributor Author

Just for Information:

Since some weeks
https://validator.w3.org/check
only checks SVGs with Doctype (or you have to specify it manually before the check)

See f.e. :https://validator.w3.org/check?uri=https%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FSpecial%3AFilepath%2FSVG_example_path.svg&ss=1#source

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants