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

Name returned by which(...) includes internal module #41

Open
frankier opened this issue Mar 22, 2022 · 2 comments
Open

Name returned by which(...) includes internal module #41

frankier opened this issue Mar 22, 2022 · 2 comments

Comments

@frankier
Copy link

See JuliaDocs/Documenter.jl#1781 . I wonder whether there is some way to work around this in FromFile.jl or whether this is reasonable? There doesn't seem an obvious way, but I am cross-posting this issue here anyway.

@patrick-kidger
Copy link
Collaborator

patrick-kidger commented Mar 22, 2022

I remember discussing this with with @MilesCranmer and concluding that this was a limitation of Documenter.jl. As you say, it's very common for a public interface not to be the same as the internal structure of the code.

FWIW I've run into similar issues with Python documentation-generation tooling before. There my solution was to monkey-patch the autodoc to do what I want. (You could also look at offering a PR for Documenter.jl -- open source projects usually get features because of community contributors!)

@MilesCranmer
Copy link
Contributor

MilesCranmer commented Mar 22, 2022

One hacky way to solve this in the short term is to perform text pre-processing on the entire source code, switching, e.g., @from "File.jl" import foo, bar with import File: foo, bar, and then inserting module File ... end inside File.jl. Do this for every file, add the include("File.jl") at the top-level, and then call Documenter.jl at the end - it should generate non-mangled names (I think).

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

3 participants