Getting docs in C embedding

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:

  1. Why aren’t the methods of doc imported?
  2. Is there a more native way to retrieve the documentation than using Base.Docs.doc in embeded code?
  3. Is there a more native way to import standard modules instead using “using” or “import” in jl_toplevel_eval?

Thanks, but I didn’t find jl_get_docstring in julia.h or in all source codes (v.1.11.3). Can you tell me where this function should be declared and what is its signature?

The necessary methods are defined in the REPL module.

import REPL

solves the problems.