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

exporting hfuns #894

Closed
ghost opened this issue Oct 2, 2021 · 2 comments
Closed

exporting hfuns #894

ghost opened this issue Oct 2, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 2, 2021

why doesn't franklin pick up these hfuns defined in an external module?

function export_hfuncs(mod)
    for sym in names(@__MODULE__; all=true)
        if startswith(string(sym), "hfun_")
            @eval $mod, export $sym
        end
    end
end
@tlienart
Copy link
Owner

tlienart commented Oct 2, 2021

you'll need to help me out a bit more here; what are you trying to do? do you want to define your hfun* in a module that is defined somewhere in your site folder?

(my intuition this far is that the limitation is not on the Franklin side; there's nothing specific in Franklin that blocks access to specific modules etc, likely this is more a Julia question).

@ghost
Copy link
Author

ghost commented Oct 2, 2021

likely this is more a Julia question).

mmh probably.
I was trying to use functions from an external module. That snippet works if the module is top level, but if it is a submodule, such that it is loaded from within the top module, i just have to import the submodule like using Mod.Sub.
Sorry for the issue

@ghost ghost closed this as completed Oct 2, 2021
This issue was closed.
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

1 participant