Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: convert [Foo] to a link to the docs #70

Open
dzfranklin opened this issue May 17, 2021 · 3 comments
Open

feature request: convert [Foo] to a link to the docs #70

dzfranklin opened this issue May 17, 2021 · 3 comments

Comments

@dzfranklin
Copy link

dzfranklin commented May 17, 2021

I link to doc entries to document the entrypoints of my crate with [`Foo`], and rustdoc transforms them to links. It would be awesome if these were transformed to links to docs.rs.

@dzfranklin dzfranklin changed the title feature request: convert [Foo] to a link to the docs feature request: convert ``[Foo]`` to a link to the docs May 17, 2021
@dzfranklin dzfranklin changed the title feature request: convert ``[Foo]`` to a link to the docs feature request: convert [Foo] to a link to the docs May 17, 2021
@oconnor663
Copy link

Making them an actual link would be fabulous. I would also be happy with just stripping the surrounding []. Does anyone know of a workaround for this in the meantime, to avoid needing to manually remove [] after generation?

@survived
Copy link

survived commented Aug 9, 2021

Looks like duplicate of #55

@dajoha
Copy link

dajoha commented Aug 29, 2021

I would also be happy with just stripping the surrounding []. Does anyone know of a workaround for this in the meantime, to avoid needing to manually remove [] after generation?

You can do it with this command:

sed -i 's/\[\(`[^`]*`\)]/\1/g' README.md

To do it more quickly, you can use this tiny Makefile:

.PHONY: readme

readme: README.md

README.md: src/lib.rs
	@ cargo readme > README.md
	@ sed -i 's/\[\(`[^`]*`\)]/\1/g' README.md

Just in case you don't know make: put the Makefile file at your project's root, then run make readme when you want to update your README.md file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants