From 8da233540bb93168815ed50f79ecf845fbb244a5 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 3 Jan 2025 16:37:01 +0700 Subject: [PATCH] Update README and CHANGELOG to be closer to typical Linebender (#42) --- CHANGELOG.md | 178 +++++++++++++++++++++++++++++++++++++++------------ README.md | 83 +++++++++++++++++------- 2 files changed, 196 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b2b420..ca30fc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,100 +1,148 @@ -# Change Log -All notable changes to this project will be documented in this file. +# Changelog -The format is based on [Keep a Changelog](http://keepachangelog.com/) -and this project adheres to [Semantic Versioning](http://semver.org/). + + +The latest published SVG Types release is [0.15.2](#0151-2024-08-20) which was released on 2024-08-20. +You can find its changes [documented below](#0151-2024-08-20). ## [Unreleased] -## [0.15.2] - 2024-08-20 +This release has an [MSRV][] of 1.65. + +This is the first release under the stewardship of [Linebender][], who is now responsible for maintenance of this crate. +Many thanks to Yevhenii Reizner for the years of hard work that he has poured into this and other crates. + +### Added + +- Support floating point hue in `hsl()` and `hsla()`. ([#31][] by [@erxclau][]) + ### Fixed + +- Round hues in HSL to RGB conversion. ([#34][] by [@erxclau][]) +- Correct rounding of alpha. ([#35][] by [@waywardmonkeys][]) + +### Changed + +- Set the MSRV in `Cargo.toml` and updated the edition to 2021. ([#40][] by [@tomcur][]) + +## [0.15.2][] (2024-08-20) + +### Fixed + - Path parsing with `S` or `T` segments after `A`. Was broken since v0.12 -## [0.15.1] - 2024-05-07 +## [0.15.1][] (2024-05-07) + ### Fixed + - Allow double quotes in FuncIRI. -## [0.15.0] - 2024-04-03 +## [0.15.0][] (2024-04-03) + ### Changed + - Bump `kurbo` and `siphasher` -## [0.14.0] - 2024-02-05 +## [0.14.0][] (2024-02-05) + ### Added -- `font-family` parsing. - [@LaurenzV](https://github.com/LaurenzV) -- `font` shorthand parsing. - [@LaurenzV](https://github.com/LaurenzV) -## [0.13.0] - 2023-12-03 +- `font-family` parsing. ([#20][] by [@LaurenzV][]) +- `font` shorthand parsing. ([#21][] by [@LaurenzV][]) + +## [0.13.0][] (2023-12-03) + ### Added -- `Paint::ContextFill` and `Paint::ContextStroke`. - [@LaurenzV](https://github.com/LaurenzV) -- `transform-origin` parsing. - [@LaurenzV](https://github.com/LaurenzV) -## [0.12.0] - 2023-10-01 +- `Paint::ContextFill` and `Paint::ContextStroke`. ([#17][] by [@LaurenzV][]) +- `transform-origin` parsing. ([#18][] by [@LaurenzV][]) + +## [0.12.0][] (2023-10-01) + ### Added + - Allow parsing of float RGB values from CSS Color 4 draft like `rgb(3.14, 110, 201)`. - The values itself would still be stored as `u8`. - [@yisibl](https://github.com/yisibl) -- Allow quotes in FuncIRI. - [@romanzes](https://github.com/romanzes) + The values itself would still be stored as `u8`. ([#14][] by [@yisibl][]) +- Allow quotes in FuncIRI. ([#15][] by [@romanzes][]) + +## [0.11.0][] (2023-03-25) -## [0.11.0] - 2023-03-25 ### Added + - `SimplifyingPathParser` handles implicit MoveTo commands after ClosePath now. Previously, `M 10 20 L 30 40 Z L 50 60` would have been parsed as is, but now it will be parsed as `M 10 20 L 30 40 Z M 10 20 L 50 60`. -## [0.10.0] - 2023-02-04 +## [0.10.0][] (2023-02-04) + ### Changed + - Bump `kurbo` - Bump MSRV to 1.65 (because of `kurbo`) -## [0.9.0] - 2022-12-25 +## [0.9.0][] (2022-12-25) + ### Added + - `SimplifyingPathParser` that allows parsing an already simplified Path Data. -## [0.8.2] - 2022-10-23 +## [0.8.2][] (2022-10-23) + ### Added + - `paint-order` -## [0.8.1] - 2022-06-11 +## [0.8.1][] (2022-06-11) + ### Added -- Support #RRGGBBAA and #RGBA color notation as per CSS Color 4. - [@demurgos](https://github.com/demurgos) -## [0.8.0] - 2021-09-12 +- Support #RRGGBBAA and #RGBA color notation as per CSS Color 4. ([#13][] by [@demurgos]] + +## [0.8.0][] (2021-09-12) + ### Added + - `EnableBackground` - `Number`. Previously accessible via `Steam::parse_number`. - `IRI`. Previously accessible via `Steam::parse_iri`. - `FuncIRI`. Previously accessible via `Steam::parse_func_iri`. ### Changed + - `Stream` is now private. -## [0.7.0] - 2021-09-04 +## [0.7.0][] (2021-09-04) **Breaking**: Almost a complete rewrite. This crate is strictly a parser from now. ### Added + - [``](https://www.w3.org/TR/filter-effects-1/#typedef-filter-value-list) parsing using `FilterValueListParser`. - `ViewBoxError` ### Removed + - Writing support. - Container types. Only stack allocated types and pull-based parsers are available. - `FuzzyEq` and `FuzzyZero`. -## [0.6.0] - 2021-08-22 +## [0.6.0][] (2021-08-22) + ### Added + - CSS3 colors support (`rgba`, `hsl`, `hsla`, `transparent`). - `turn` angle unit. - `Angle::to_degrees`. ### Changed + - Move to Rust 2018 edition. - Rename `Stream::skip_string` into `Stream::consume_string`. - Rename `Color::new` into `Color::new_rgb`. @@ -102,82 +150,130 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Rename `Angle::num` into `Angle::number`. - Rename `Length::num` into `Length::number`. -## [0.5.0] - 2019-08-12 +## [0.5.0][] (2019-08-12) + ### Added + - Implement `Default` for `Length`, `LengthList`, `NumberList`, `Points` and `Path`. ### Changed + - The minimum Rust version is 1.31 ### Removed + - `PathBuilder`. Use `Path::push_*` instead. - `Style` parser. Use an external CSS parser instead, like `simplecss`. - `ElementId` and `AttributeId`. - `phf` dependency. Only `siphasher` is used now. -## [0.4.4] - 2019-06-11 +## [0.4.4][] (2019-06-11) + - Update `float-cmp`. -## [0.4.3] - 2019-06-10 +## [0.4.3][] (2019-06-10) + ### Added + - `Transform::prepend`. - Implement `FuzzyEq` and `FuzzyZero` for `f32`. - Parsing of `Color`, `Paint`, `ElementId` and `AttributeId` can be disabled now. -## [0.4.2] - 2019-03-15 +## [0.4.2][] (2019-03-15) + ### Changed + - The `XmlByteExt` trait is private now. -## [0.4.1] - 2019-01-06 +## [0.4.1][] (2019-01-06) + ### Fixed + - Style with comments parsing. -## [0.4.0] - 2019-01-02 +## [0.4.0][] (2019-01-02) + ### Added + - An [`angle`](https://www.w3.org/TR/SVG11/types.html#DataTypeAngle) value type. ### Changed + - `Length::from_str` will return an error if an input string has trailing data. So length like `1mmx` was previously parsed without errors. -## [0.3.0] - 2018-12-13 +## [0.3.0][] (2018-12-13) + ### Changed + - `PathParser` will return `Result` instead of `PathSegment` from now. - `Error` was rewritten. ### Removed + - `FromSpan` trait. Use `FromStr`. - `StrSpan`. All strings are `&str` now. - `TextPos`. All errors have position in characters now. - `xmlparser` dependency. - `log` dependency. -## [0.2.0] - 2018-09-12 +## [0.2.0][] (2018-09-12) + ### Added + - `black`, `white`, `gray`, `red`, `green` and `blue` constructors to the `Color` struct. ### Changed + - `StyleParser` will return `(StrSpan, StrSpan)` and not `StyleToken` from now. - `StyleParser` requires entity references to be resolved before parsing from now. ### Removed + - `failure` dependency. - `StyleToken`. - `Error::InvalidEntityRef`. -## [0.1.1] - 2018-05-23 +## [0.1.1][](2018-05-23) + ### Added + - `encoding` and `standalone` to AttributeId. - `new_translate`, `new_scale`, `new_rotate`, `new_rotate_at`, `new_skew_x`, `new_skew_y` and `rotate_at` methods to the `Transform`. ### Changed + - `StreamExt::parse_iri` and `StreamExt::parse_func_iri` will parse not only well-formed data now. ### Fixed + - `Paint::from_span` poor performance. +[MSRV]: README.md#minimum-supported-rust-version-msrv +[Linebender]: https://github.com/linebender + +[#13]: https://github.com/linebender/svgtypes/pull/13 +[#14]: https://github.com/linebender/svgtypes/pull/14 +[#15]: https://github.com/linebender/svgtypes/pull/15 +[#17]: https://github.com/linebender/svgtypes/pull/17 +[#18]: https://github.com/linebender/svgtypes/pull/18 +[#20]: https://github.com/linebender/svgtypes/pull/20 +[#21]: https://github.com/linebender/svgtypes/pull/21 +[#31]: https://github.com/linebender/svgtypes/pull/31 +[#34]: https://github.com/linebender/svgtypes/pull/34 +[#35]: https://github.com/linebender/svgtypes/pull/35 +[#40]: https://github.com/linebender/svgtypes/pull/40 + +[@demurgos]: https://github.com/demurgos +[@erxclau]: https://github.com/erxclau +[@Laurenzv]: https://github.com/LaurenzV +[@romanzes]: https://github.com/romanzes +[@tomcur]: https://github.com/tomcur +[@waywardmonkeys]: https://github.com/waywardmonkeys +[@yisibl]: https://github.com/yisibl + [Unreleased]: https://github.com/RazrFalcon/svgtypes/compare/v0.15.2...HEAD [0.15.2]: https://github.com/RazrFalcon/svgtypes/compare/v0.15.1...v0.15.2 [0.15.1]: https://github.com/RazrFalcon/svgtypes/compare/v0.15.0...v0.15.1 diff --git a/README.md b/README.md index 7b88b55..9dcd98b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,20 @@ -## svgtypes -![Build Status](https://github.com/RazrFalcon/svgtypes/workflows/svgtypes/badge.svg) +
+ +# SVG Types + +**A collection of parsers for [SVG](https://www.w3.org/TR/SVG2/) types.** + +[![Linebender Zulip, #resvg channel](https://img.shields.io/badge/Linebender-%23resvg-blue?logo=Zulip)](https://xi.zulipchat.com/#narrow/channel/465085-resvg) +[![dependency status](https://deps.rs/repo/github/linebender/svgtypes/status.svg)](https://deps.rs/repo/github/linebender/svgtypes) +[![Apache 2.0 or MIT license.](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg)](#license) +[![Build status](https://github.com/linebender/svgtypes/workflows/CI/badge.svg)](https://github.com/linebender/svgtypes/actions) [![Crates.io](https://img.shields.io/crates/v/svgtypes.svg)](https://crates.io/crates/svgtypes) -[![Documentation](https://docs.rs/svgtypes/badge.svg)](https://docs.rs/svgtypes) -[![Rust 1.65+](https://img.shields.io/badge/rust-1.65+-orange.svg)](https://www.rust-lang.org) +[![Docs](https://docs.rs/svgtypes/badge.svg)](https://docs.rs/svgtypes) ![](https://img.shields.io/badge/unsafe-forbidden-brightgreen.svg) -*svgtypes* is a collection of parsers for [SVG](https://www.w3.org/TR/SVG2/) types. +
-### Supported SVG types +## Supported SVG types - [``](https://www.w3.org/TR/css-color-3/) - [``](https://www.w3.org/TR/SVG2/types.html#InterfaceSVGNumber) @@ -30,45 +37,73 @@ - [``](https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-family-prop) - [`font`](https://www.w3.org/TR/css-fonts-3/#font-prop) -### Features +## Features - Complete support of paths, so data like `M10-20A5.5.3-4 110-.1` will be parsed correctly. - Implicit path commands will be automatically converted into explicit one. - Some SVG2 data types support. - Pretty fast. -### Limitations +## Limitations -- Accepts only [normalized](https://www.w3.org/TR/REC-xml/#AVNormalize) values, - e.g. an input text should not contain ` ` or `&data;`. +- Accepts only [normalized](https://www.w3.org/TR/REC-xml/#AVNormalize) values, e.g. an input text should not contain ` ` or `&data;`. - All keywords must be lowercase. Case-insensitive parsing is supported only for colors (requires allocation for named colors). -- The `` followed by the `` is not supported. As the `` itself. -- [System colors](https://www.w3.org/TR/css3-color/#css2-system), like `fill="AppWorkspace"`, - are not supported. They were deprecated anyway. +- The `` followed by the `` is not supported. + As the `` itself. +- [System colors](https://www.w3.org/TR/css3-color/#css2-system), like `fill="AppWorkspace"`, are not supported. + They were deprecated anyway. -### Safety +## Safety - The library should not panic. Any panic considered as a critical bug and should be reported. - The library forbids unsafe code. -### Alternatives +## Alternatives None. -### License +## Minimum supported Rust Version (MSRV) + +This version of SVG Types has been verified to compile with **Rust 1.65** and later. + +Future versions of SVG Types might increase the Rust version requirement. +It will not be treated as a breaking change and as such can even happen with small patch releases. + +
+Click here if compiling fails. + +As time has passed, some of SVG Types's dependencies could have released versions with a higher Rust requirement. +If you encounter a compilation issue due to a dependency and don't want to upgrade your Rust toolchain, then you could downgrade the dependency. + +```sh +# Use the problematic dependency's name and version +cargo update -p package_name --precise 0.1.1 +``` +
+ +## Community + +[![Linebender Zulip, #resvg channel](https://img.shields.io/badge/Linebender-%23resvg-blue?logo=Zulip)](https://xi.zulipchat.com/#narrow/channel/465085-resvg) + +Discussion of SVG Types development happens in the Linebender Zulip at , specifically the [#resvg channel](https://xi.zulipchat.com/#narrow/channel/465085-resvg). +All public content can be read without logging in. + +## License Licensed under either of -- Apache License, Version 2.0 - ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) -- MIT license - ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) +- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or ) +- MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. -### Contribution +## Contribution + +Contributions are welcome by pull request. The [Rust code of conduct] applies. +Please feel free to add your name to the [AUTHORS] file in any substantive pull request. + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions. -Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in the work by you, as defined in the Apache-2.0 license, shall be -dual licensed as above, without any additional terms or conditions. +[Rust Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct +[AUTHORS]: ./AUTHORS