orium / cargo-rdme

Cargo command to create the README.md from your crate's documentation
Mozilla Public License 2.0
126 stars 5 forks source link

Support intralinks for `impl` items such as methods #166

Closed smoelius closed 1 year ago

smoelius commented 1 year ago

An intralink test involving a method does not seem to work for me.

Glancing here, the SymbolType for a method would appear to be Fn: https://github.com/orium/cargo-rdme/blob/ca21a84ef9353f82767de8d1546200418a6c2ade/src/transform/intralinks/mod.rs#L261-L273

But when I try that by modifying one of the crate's existing tests, the generated URL doesn't appear to have the proper form.

Am I correct to infer that intralinks for methods are not yet supported?

orium commented 1 year ago

Yes, we never supported methods but since it is a common use case I started looking into it. It's not just methods, I also want to implement support for const and type items inside impl blocks.

I should be able to implement it when I have a few hours this week.

smoelius commented 1 year ago

That would be great. Thank you. :pray:

orium commented 1 year ago

Opened #169 to cover other similar intralink limitations cases.

smoelius commented 1 year ago

Thanks very much for looking into this, @orium.

orium commented 1 year ago

Implemented in c278f705d8c1ebaab7687db17cfd01af5883356c. Opened #170 to signal an annoying limitation.

smoelius commented 1 year ago

Thank you very much, @orium. For my use case, this works perfectly.