Skip to content

Commit 97847e5

Browse files
committed
Version 1.1.0, adding favored links
Fixes #17. Fixes small formatting issues.
1 parent 97e11ba commit 97847e5

File tree

4 files changed

+30
-17
lines changed

4 files changed

+30
-17
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# Version 1.1.0 - 2020-10-29
2+
3+
Git tag: `v1.1.0`.
4+
5+
- Added favored links: by default, `https` link from `docs.rs` will be
6+
transformed to their intra-doc links version. `intraconv` will assume such
7+
links point to dependencies and as such can be safely transformed to
8+
intra-doc links. If this is not the desired behaviour, see the `-f` flag.
9+
- Added `--no-favored` (`-f`) to disable the behaviour described above.
10+
111
# Version 1.0.1
212

313
Git tag: `v1.0.1`.

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cargo-intraconv"
3-
version = "1.0.1"
3+
version = "1.1.0"
44
authors = ["Alexis Bourget <alexis.bourget@gmail.com>"]
55
edition = "2018"
66
description = "A simple helper to transform Markdown links to intra-doc links in Rust projects when appropriate."
@@ -10,6 +10,7 @@ homepage = "https://github.com/poliorcetics/cargo-intraconv"
1010
repository = "https://github.com/poliorcetics/cargo-intraconv"
1111
readme = "README.md"
1212
keywords = ["intra-doc-links", "documentation"]
13+
# See https://crates.io/category_slugs.
1314
categories = ["command-line-utilities", "development-tools", "development-tools::cargo-plugins"]
1415

1516
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

src/transform/tests.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ mod regexes {
5858
let string = "/// [name 1]: https://docs.rs/name_2-3/1.2.3/name_2_3/struct.Test.html\n";
5959
assert!(HTTP_LINK.is_match(string));
6060

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

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

70-
let string = "[name 1]: https://docs.rs/name_2-3/1.2.3/name_2_3/module/struct.Test.html\n";
71+
let string =
72+
"[name 1]: https://docs.rs/name_2-3/1.2.3/name_2_3/module/struct.Test.html\n";
7173
assert!(HTTP_LINK.is_match(string));
7274
}
7375
}
@@ -349,7 +351,7 @@ fn new() {
349351
assert_ne!(Context::new("name".into(), true, true), ctx);
350352
assert_ne!(Context::new("name".into(), true, false), ctx);
351353
assert_ne!(Context::new("name".into(), false, false), ctx);
352-
354+
353355
assert_ne!(Context::new("not_name".into(), true, true), ctx);
354356
assert_ne!(Context::new("not_name".into(), true, false), ctx);
355357
assert_ne!(Context::new("not_name".into(), false, true), ctx);
@@ -1804,7 +1806,7 @@ mod transform_anchor {
18041806
#[test]
18051807
fn matching_anchors() {
18061808
let none_ctx = Context::new("my_crate_none".into(), true, false);
1807-
let mut some_ctx = Context::new("my_crate_some".into(), true, false);
1809+
let mut some_ctx = Context::new("my_crate_some".into(), true, false);
18081810

18091811
some_ctx.curr_type_block = Some("Type".into());
18101812
some_ctx.end_type_block = "}".into();
@@ -1998,7 +2000,7 @@ mod transform_line {
19982000
#[test]
19992001
fn matching_lines_anchor() {
20002002
let mut none_ctx = Context::new("my_crate_none".into(), true, false);
2001-
let mut some_ctx = Context::new("my_crate_some".into(), true, false);
2003+
let mut some_ctx = Context::new("my_crate_some".into(), true, false);
20022004

20032005
some_ctx.curr_type_block = Some("Type".into());
20042006
some_ctx.end_type_block = "}".into();

0 commit comments

Comments
 (0)