@@ -157,9 +157,25 @@ Calls `CodeTools.getmodule(args...)`, but returns `Main` instead of `nothing` in
157
157
"""
158
158
getmodule (args... ) = (m = CodeTools. getmodule (args... )) === nothing ? Main : m
159
159
160
+ """
161
+ getmethods(mod::Module, word::AbstractString)
162
+ getmethods(mod::AbstractString, word::AbstractString)
163
+
164
+ Returns the [`MethodList`](@ref) for `word`, which is bound within `mod` module.
165
+ """
160
166
getmethods (mod:: Module , word:: AbstractString ) = methods (CodeTools. getthing (mod, word))
161
167
getmethods (mod:: AbstractString , word:: AbstractString ) = getmethods (getmodule (mod), word)
162
168
169
+ """
170
+ getdocs(mod::Module, word::AbstractString, fallbackmod::Module = Main)
171
+ getdocs(mod::AbstractString, word::AbstractString, fallbackmod::Module = Main)
172
+
173
+ Retrieves docs for `mod.word` with [`@doc`](@ref) macro. If `@doc` is not available
174
+ within `mod` module, `@doc` will be evaluated in `fallbackmod` module if possible.
175
+
176
+ !!! note
177
+ You may want to run [`cangetdocs`](@ref) in advance.
178
+ """
163
179
getdocs (mod:: Module , word:: AbstractString , fallbackmod:: Module = Main) = begin
164
180
md = if Symbol (word) in keys (Docs. keywords)
165
181
Core. eval (Main, :(@doc ($ (Symbol (word)))))
179
195
getdocs (mod:: AbstractString , word:: AbstractString , fallbackmod:: Module = Main) =
180
196
getdocs (getmodule (mod), word, fallbackmod)
181
197
198
+ """
199
+ cangetdocs(mod::Module, word::Symbol)
200
+ cangetdocs(mod::Module, word::AbstractString)
201
+ cangetdocs(mod::AbstractString, word::Union{Symbol, AbstractString})
202
+
203
+ Checks if the documentation bindings for `mod.word` is resolved and `mod.word`
204
+ is not deprecated.
205
+ """
182
206
cangetdocs (mod:: Module , word:: Symbol ) =
183
207
Base. isbindingresolved (mod, word) &&
184
208
! Base. isdeprecated (mod, word)
0 commit comments