Hello everyone!
I am trying to extract documentation from module items. I am trying to use the doc function to do this:
jl_module_t *m = jl_new_module(jl_symbol(name), nullptr);
jl_module_using(m, jl_base_module);
jl_module_using(m, jl_core_module);
const char* s = "using Base.Docs: doc"
jl_value_t *ast = jl_parse_input_line(s, strlen(s), "none", 4);
jl_toplevel_eval((jl_module_t*)m, ast);
const char* printme = "x -> println(methods(x))"
ast = jl_parse_input_line(printme, strlen(printme), "none", 4);
jl_value_t *ms = jl_toplevel_eval((jl_module_t*)m, ast);
...
jl_call((jl_function_t*)ms, jl_args, args_count);
and I receive
# 0 methods for generic function "doc" from Base.Docs
I have some questions:
- Why aren’t the methods of doc imported?
- Is there a more native way to retrieve the documentation than using Base.Docs.doc in embeded code?
- Is there a more native way to import standard modules instead using “using” or “import” in jl_toplevel_eval?