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

Can we avoid needing #[docify::export]? #17

Open
jsdw opened this issue Oct 27, 2023 · 2 comments
Open

Can we avoid needing #[docify::export]? #17

jsdw opened this issue Oct 27, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jsdw
Copy link

jsdw commented Oct 27, 2023

#[docify::export] has some nice elements, like allowing us to give nice aliases for eg impl blocks (which otherwise might be hard to "name"), but it also requires that the docify crate be added as a dependency of any crates we'd like to document (I think; I couldn't see a way to make it a dev-dependency and still have doc generation work, and separately I wonder whether you have any thoughts on the best way to do this?).

Anyway, perhaps we can avoid the macro by parsing the rust source ourselves when importing code to document, finding the items named, and taking the relevant item? This would avoid the dependency entirely (and I expect there could be some clever syntax added for eg targeting impl blocks or whatever :))

@sam0x17 sam0x17 self-assigned this Oct 27, 2023
@sam0x17 sam0x17 added the enhancement New feature or request label Oct 27, 2023
@sam0x17
Copy link
Owner

sam0x17 commented Oct 27, 2023

Yes I have very much wanted to implement this for some time and this is one of my next targets. Thank you for putting it into an issue because I apparently hadn't made one yet for this

Another thing that could go along with this is proper parsing of paths instead of all items colliding in a global namespace at the file level

@sam0x17
Copy link
Owner

sam0x17 commented Oct 27, 2023

Side note on the dev dependency thing, that actually will suddenly work if we opt for the new syntax suggested in #4. Main reason it doesn't/can't right now is it is illegal to use cfg gates in #[doc = X] position, but "outer attributes" aren't subject to this constraint at all. If I go that route I will just add it as an additional syntax and continue to support the old syntax

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

No branches or pull requests

2 participants