Skip to content

Commit

Permalink
Version 1.1.0, adding favored links
Browse files Browse the repository at this point in the history
Fixes #17.
Fixes small formatting issues.
  • Loading branch information
poliorcetics committed Oct 29, 2020
1 parent 97e11ba commit 97847e5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Version 1.1.0 - 2020-10-29

Git tag: `v1.1.0`.

- Added favored links: by default, `https` link from `docs.rs` will be
transformed to their intra-doc links version. `intraconv` will assume such
links point to dependencies and as such can be safely transformed to
intra-doc links. If this is not the desired behaviour, see the `-f` flag.
- Added `--no-favored` (`-f`) to disable the behaviour described above.

# Version 1.0.1

Git tag: `v1.0.1`.
Expand Down
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-intraconv"
version = "1.0.1"
version = "1.1.0"
authors = ["Alexis Bourget <[email protected]>"]
edition = "2018"
description = "A simple helper to transform Markdown links to intra-doc links in Rust projects when appropriate."
Expand All @@ -10,6 +10,7 @@ homepage = "https://github.com/poliorcetics/cargo-intraconv"
repository = "https://github.com/poliorcetics/cargo-intraconv"
readme = "README.md"
keywords = ["intra-doc-links", "documentation"]
# See https://crates.io/category_slugs.
categories = ["command-line-utilities", "development-tools", "development-tools::cargo-plugins"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
12 changes: 7 additions & 5 deletions src/transform/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ mod regexes {
let string = "/// [name 1]: https://docs.rs/name_2-3/1.2.3/name_2_3/struct.Test.html\n";
assert!(HTTP_LINK.is_match(string));

let string = "/// [name 1]: https://docs.rs/name_2-3/1.2.3/name_2_3/module/struct.Test.html\n";
let string =
"/// [name 1]: https://docs.rs/name_2-3/1.2.3/name_2_3/module/struct.Test.html\n";
assert!(HTTP_LINK.is_match(string));

let string = "[`name 1`]: https://docs.rs/name-1/293-fdsf/name_1/index.html\n";
Expand All @@ -67,7 +68,8 @@ mod regexes {
let string = "[name 1]: https://docs.rs/name_2-3/1.2.3/name_2_3/struct.Test.html\n";
assert!(HTTP_LINK.is_match(string));

let string = "[name 1]: https://docs.rs/name_2-3/1.2.3/name_2_3/module/struct.Test.html\n";
let string =
"[name 1]: https://docs.rs/name_2-3/1.2.3/name_2_3/module/struct.Test.html\n";
assert!(HTTP_LINK.is_match(string));
}
}
Expand Down Expand Up @@ -349,7 +351,7 @@ fn new() {
assert_ne!(Context::new("name".into(), true, true), ctx);
assert_ne!(Context::new("name".into(), true, false), ctx);
assert_ne!(Context::new("name".into(), false, false), ctx);

assert_ne!(Context::new("not_name".into(), true, true), ctx);
assert_ne!(Context::new("not_name".into(), true, false), ctx);
assert_ne!(Context::new("not_name".into(), false, true), ctx);
Expand Down Expand Up @@ -1804,7 +1806,7 @@ mod transform_anchor {
#[test]
fn matching_anchors() {
let none_ctx = Context::new("my_crate_none".into(), true, false);
let mut some_ctx = Context::new("my_crate_some".into(), true, false);
let mut some_ctx = Context::new("my_crate_some".into(), true, false);

some_ctx.curr_type_block = Some("Type".into());
some_ctx.end_type_block = "}".into();
Expand Down Expand Up @@ -1998,7 +2000,7 @@ mod transform_line {
#[test]
fn matching_lines_anchor() {
let mut none_ctx = Context::new("my_crate_none".into(), true, false);
let mut some_ctx = Context::new("my_crate_some".into(), true, false);
let mut some_ctx = Context::new("my_crate_some".into(), true, false);

some_ctx.curr_type_block = Some("Type".into());
some_ctx.end_type_block = "}".into();
Expand Down

0 comments on commit 97847e5

Please sign in to comment.