The link to the SVG spec in the comments points to SVG 2, but the types are based on SVG 1.1
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 179
- Forks
- 63
- Avg merge
- 5h
- Merged PRs (30d)
- 22
Description
The SVG types are said ( https://github.com/ocsigen/tyxml/blob/master/lib/svg_types.mli#L26 ) to be based on http://www.w3.org/TR/SVG/ I guess that this URL used to point to the specification of SVG 1.1, but it now points to SVG 2.
In the case of the definition of paint, the difference is large.
Here is what it appears in SVG 2 ( https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint )
<paint> := none | <color> | <url> [none | <color>? | context-fill | context-stroke
And in SVG 1.1 ( https://www.w3.org/TR/SVG11/painting.html#SpecifyingPaint )
<paint> := none | currentColor | <color> [<icccolor>] | <funciri> [ none | currentColor | <color> [<icccolor>] ] | inherit
Here is what it appears in https://github.com/ocsigen/tyxml/blob/master/lib/svg_types.mli#L287
type color = string
type icccolor = string
type paint_whitout_icc =
[ `None | `CurrentColor
| `Color of (color * icccolor option)
]
type paint =
[ paint_whitout_icc
| `Icc of (iri * paint_whitout_icc option) ]
This implementation is close to the one of SVG 1.1, but it differs a lot from the SVG 2. This confused me as I tried to compare to make it match to SVG 2's concepts. I still feel that I'm missing the url(#gradient) value, but I'm not used to ICC so I might just have misunderstand.
It's completely fine to stay with SVG 1.1, but maybe it would be nice to help the reader accustomed to SVG 2:
- by replacing http://www.w3.org/TR/SVG/ by http://www.w3.org/TR/SVG11/
- possibly also by citing the appendix https://www.w3.org/TR/SVG/changes.html#color
- by adding some brief comments to the parts that significantly changed to understand the concept.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open lib/svg_types.mli around lines 26 and 287, and compare the referenced SVG specifications. Update the specification link so it matches the types, and consider the issue's suggested explanatory comments for SVG 2 readers. Done means the documentation no longer directs readers to a conflicting specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100