@@ -165,8 +165,8 @@ can be slightly different:
165165 }
166166
167167
168- Autodoc directive
169- -----------------
168+ Autodoc directives
169+ ------------------
170170
171171.. rst :directive :: .. lua:autoobject:: name
172172
@@ -175,57 +175,57 @@ Autodoc directive
175175 :rst:dir: `lua:autoobject ` supports same settings as other lua directives,
176176 as well as some additional ones:
177177
178- .. rst:directive:option:: members
178+ .. rst:directive:option:: members: [<name>, ...]
179179
180180 If enabled, autodoc will also document object's members. You can pass a list
181181 of comma-separated names to specify which members should be documented.
182182 Otherwise, this option will document all public non-special members
183183 which have a description.
184184
185- .. rst:directive:option:: undoc-members
185+ .. rst:directive:option:: undoc-members: [<name>, ...]
186186
187187 Include undocumented members to the object's description. By default,
188188 they are skipped even if :rst:dir:`members <lua:autoobject:members>` is passed.
189189
190190 Accepts a comma-separated list of names; if list is empty,
191191 adds all undoc members.
192192
193- .. rst:directive:option:: private-members
194- protected-members
195- package-members
193+ .. rst:directive:option:: private-members: [<name>, ...]
194+ protected-members: [<name>, ...]
195+ package-members: [<name>, ...]
196196
197197 Include non-public members to the object's description.
198198
199199 Accepts a comma-separated list of names; if list is empty,
200200 adds all non-public members.
201201
202- .. rst:directive:option:: special-members
202+ .. rst:directive:option:: special-members: [<name>, ...]
203203
204204 Include members whose names start with double underscore
205205 to the object's description.
206206
207207 Accepts a comma-separated list of names; if list is empty,
208208 adds all special members.
209209
210- .. rst:directive:option:: inherited-members
210+ .. rst:directive:option:: inherited-members: [<name>, ...]
211211
212212 For classes, include members inherited from base classes.
213213
214214 Accepts a comma-separated list of names; if list is empty,
215215 adds all inherited members.
216216
217- .. rst:directive:option:: exclude-members
217+ .. rst:directive:option:: exclude-members: [<name>, ...]
218218
219219 A comma-separated list of members that should not be documented.
220220
221- .. rst:directive:option:: globals
221+ .. rst:directive:option:: globals: [<name>, ...]
222222
223223 Will include global variables declared in the corresponding module.
224224
225225 Accepts a comma-separated list of names; if list is empty,
226226 adds all global variables.
227227
228- .. rst:directive:option:: class-doc-from
228+ .. rst:directive:option:: class-doc-from: class | ctor | both | separate
229229
230230 Specifies how to generate documentation for classes
231231 if :py:data:`class_default_function_name` is configured.
@@ -242,7 +242,7 @@ Autodoc directive
242242 - ``separate``: only use documentation from ``@class`` annotation,
243243 document class constructor as a separate method.
244244
245- .. rst:directive:option:: class-signature
245+ .. rst:directive:option:: class-signature: bases | ctor | both | minimal
246246
247247 Specifies how to generate signatures for classes
248248 if :py:data:`class_default_function_name` is configured.
@@ -302,7 +302,7 @@ Autodoc directive
302302 (see :py:data:`lua_ls_default_options` for info on ``+``
303303 and overriding defaults).
304304
305- .. rst:directive:option:: member-order
305+ .. rst:directive:option:: member-order: alphabetical | groupwise | bysource
306306
307307 Controls how members are sorted. There are three options available:
308308
@@ -314,11 +314,11 @@ Autodoc directive
314314 - ``bysource``: members are sorted in the same order as they appear in code.
315315 This is the default option.
316316
317- .. rst:directive:option:: module-member-order
317+ .. rst:directive:option:: module-member-order: alphabetical | groupwise | bysource
318318
319319 Overrides :rst:dir:`lua:autoobject:member-order` for modules.
320320
321- .. rst:directive:option:: title
321+ .. rst:directive:option:: title: <text>
322322
323323 For modules, controls whether a title is inserted between module description
324324 and documentation of its members.
@@ -327,15 +327,15 @@ Autodoc directive
327327
328328 Adds :rst:dir:`lua:autoindex` to the toplevel module.
329329
330- .. rst:directive:option:: index-title
330+ .. rst:directive:option:: index-title: <text>
331331
332332 Allows overriding title of the :rst:dir:`lua:autoindex` section.
333333
334334 .. rst:directive:option:: inherited-members-table
335335
336336 Adds :rst:dir:`lua:other-inherited-members` to all classes.
337337
338- .. rst:directive:option:: annotate-require
338+ .. rst:directive:option:: annotate-require: always | never | auto | force
339339
340340 Adds information about how to require a module.
341341
@@ -355,16 +355,51 @@ Autodoc directive
355355
356356 LuaLs only supports ``never`` and ``force``.
357357
358- .. rst:directive:option:: require-function-name
358+ .. rst:directive:option:: require-function-name: <name>
359359
360360 Allows overriding name of the `require` function
361361 for :rst:dir:`lua:autoobject:annotate-require`.
362362
363- .. rst:directive:option:: require-separator
363+ .. rst:directive:option:: require-separator: <str>
364364
365365 Allows overriding separator
366366 for :rst:dir:`lua:autoobject:annotate-require`.
367367
368+ .. rst :directive :: .. lua:auto*::
369+
370+ In addition to :rst:dir: `lua:autoobject `, there are ``lua:autodata ``,
371+ ``lua:autoattribute ``, ``lua:autoclass ``, and other ``lua:auto* `` directives.
372+
373+ They work like ``lua:autoobject ``, but apply their doctype to the documented object
374+ (if ``!doctype `` was :ref: `set in source code <doc_comments >`,
375+ it shouldn't conflict with the used directive).
376+
377+ They also allow overriding object's signature, which may be useful when
378+ automatically generated signature is too long:
379+
380+ .. tab-set ::
381+ :sync-group: lang
382+
383+ .. tab-item :: RST
384+ :sync: rst
385+
386+ .. code-block :: rst
387+
388+ .. lua:autofunction:: logging.getLogger(name: string?): logging.Logger
389+
390+ .. tab-item :: Markdown
391+ :sync: md
392+
393+ .. code-block :: myst
394+
395+ ```{lua:autofunction} logging.getLogger(name: string? = ...): logging.Logger
396+ ```
397+
398+ .. dropdown :: Example output
399+
400+ .. lua :autofunction :: logging.getLogger(name: string? = ...): logging.Logger
401+ :no-index:
402+
368403.. rst :directive :: .. lua:autoindex:: module-name
369404
370405 Creates a table that references all documented objects in the module ``module-name ``.
@@ -387,6 +422,7 @@ Autodoc directive
387422 If given, class name must be absolute, even if this directive appears after
388423 :rst:dir: `lua:module `.
389424
425+ .. _doc_comments :
390426
391427Controlling generation from code comments
392428-----------------------------------------
0 commit comments