sphinx-lua-ls 0.0.4__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. sphinx_lua_ls-1.1.0/CHANGELOG.md +18 -0
  2. {sphinx_lua_ls-0.0.4/sphinx_lua_ls.egg-info → sphinx_lua_ls-1.1.0}/PKG-INFO +2 -1
  3. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/docs/source/index.rst +74 -22
  4. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/pyproject.toml +1 -0
  5. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls/_version.py +2 -2
  6. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls/autodoc.py +163 -152
  7. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls/doctree.py +117 -7
  8. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls/domain.py +3 -2
  9. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0/sphinx_lua_ls.egg-info}/PKG-INFO +2 -1
  10. sphinx_lua_ls-1.1.0/sphinx_lua_ls.egg-info/SOURCES.txt +47 -0
  11. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/mod.lua +6 -0
  12. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/src/refs.rst +2 -0
  13. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/test_regression/autodoc.html +43 -0
  14. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/test_regression/refs.html +11 -0
  15. sphinx_lua_ls-0.0.4/sphinx_lua_ls.egg-info/SOURCES.txt +0 -85
  16. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/doctrees/environment.pickle +0 -0
  17. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/doctrees/index.doctree +0 -0
  18. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/doctrees/src/annotations.doctree +0 -0
  19. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/doctrees/src/autodoc.doctree +0 -0
  20. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/doctrees/src/directives.doctree +0 -0
  21. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/doctrees/src/modules.doctree +0 -0
  22. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/doctrees/src/refs.doctree +0 -0
  23. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/.buildinfo +0 -4
  24. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_sources/index.rst.txt +0 -12
  25. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_sources/src/annotations.rst.txt +0 -16
  26. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_sources/src/autodoc.rst.txt +0 -7
  27. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_sources/src/directives.rst.txt +0 -132
  28. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_sources/src/modules.rst.txt +0 -22
  29. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_sources/src/refs.rst.txt +0 -68
  30. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/alabaster.css +0 -663
  31. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/basic.css +0 -906
  32. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/custom.css +0 -1
  33. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/doctools.js +0 -149
  34. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/documentation_options.js +0 -13
  35. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/file.png +0 -0
  36. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/github-banner.svg +0 -5
  37. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/language_data.js +0 -191
  38. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/minus.png +0 -0
  39. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/plus.png +0 -0
  40. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/pygments.css +0 -84
  41. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/searchtools.js +0 -635
  42. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/_static/sphinx_highlight.js +0 -154
  43. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/genindex.html +0 -356
  44. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/index.html +0 -127
  45. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/lua-modindex.html +0 -148
  46. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/objects.inv +0 -0
  47. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/py-modindex.html +0 -125
  48. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/search.html +0 -125
  49. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/searchindex.js +0 -1
  50. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/src/annotations.html +0 -123
  51. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/src/autodoc.html +0 -228
  52. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/src/directives.html +0 -333
  53. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/src/modules.html +0 -142
  54. sphinx_lua_ls-0.0.4/test/roots/test-doc/_build/html/src/refs.html +0 -190
  55. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/.github/workflows/ci.yaml +0 -0
  56. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/.gitignore +0 -0
  57. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/.pre-commit-config.yaml +0 -0
  58. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/.vscode/settings.json +0 -0
  59. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/CONTRIBUTING.md +0 -0
  60. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/LICENSE +0 -0
  61. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/README.md +0 -0
  62. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/conftest.py +0 -0
  63. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/docs/Makefile +0 -0
  64. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/docs/example/logging.lua +0 -0
  65. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/docs/make.bat +0 -0
  66. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/docs/source/_extra/robots.txt +0 -0
  67. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/docs/source/conf.py +0 -0
  68. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/setup.cfg +0 -0
  69. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls/__init__.py +0 -0
  70. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls/intersphinx.py +0 -0
  71. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls/lua_ls.py +0 -0
  72. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls/py.typed +0 -0
  73. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls.egg-info/dependency_links.txt +0 -0
  74. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls.egg-info/requires.txt +0 -0
  75. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/sphinx_lua_ls.egg-info/top_level.txt +0 -0
  76. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/conftest.py +0 -0
  77. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/Makefile +0 -0
  78. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/conf.py +0 -0
  79. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/index.rst +0 -0
  80. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/make.bat +0 -0
  81. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/src/annotations.rst +0 -0
  82. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/src/autodoc.rst +0 -0
  83. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/src/directives.rst +0 -0
  84. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/roots/test-doc/src/modules.rst +0 -0
  85. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/test_parse.py +0 -0
  86. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/test_regression/annotations.html +0 -0
  87. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/test_regression/directives.html +0 -0
  88. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/test_regression/modules.html +0 -0
  89. {sphinx_lua_ls-0.0.4 → sphinx_lua_ls-1.1.0}/test/test_regression.py +0 -0
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ ## v1.1.0
4
+
5
+ - Added support for `!doc` and `!doctype` comments.
6
+ - Added `:include-protected:` and `:include-package:` options for `lua:autoobject`.
7
+ - Allowed referring `lua:const` objects from `lua:attr` role.
8
+ - Fixed a bug when default options would not properly propagate
9
+ when using `lua:autoobject` with `:recurse:`.
10
+ - Fixed a bug when `lua:autoobject` would deduce incorrect module paths
11
+ when applied to non-toplevel modules.
12
+ - Fixed a bug when docstring for a class would be used for undocumented function
13
+ parameters that have this class as their type.
14
+ - Fixed types when `lua:autoobject` would infer incorrect types for `data`.
15
+
16
+ ## v1.0.0
17
+
18
+ Initial release.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sphinx-lua-ls
3
- Version: 0.0.4
3
+ Version: 1.1.0
4
4
  Summary: Automatic documentation generation via LuaLS
5
5
  Author-email: Tamika Nomara <taminomara@gmail.com>
6
6
  License: MIT License
@@ -28,6 +28,7 @@ License: MIT License
28
28
  Project-URL: Documentation, https://taminomara.github.io/sphinx-lua-ls/
29
29
  Project-URL: Issues, https://github.com/taminomara/sphinx-lua-ls/issues
30
30
  Project-URL: Source, https://github.com/taminomara/sphinx-lua-ls/
31
+ Project-URL: Changelog, https://github.com/taminomara/sphinx-lua-ls/blob/main/CHANGELOG.md
31
32
  Classifier: Development Status :: 5 - Production/Stable
32
33
  Classifier: Programming Language :: Python :: 3 :: Only
33
34
  Classifier: Programming Language :: Python :: 3
@@ -127,6 +127,10 @@ and specify the location of your Lua project:
127
127
  # relative to the directory with `conf.py`.
128
128
  lua_ls_project_root = "../"
129
129
 
130
+ If you plan to use Markdown in code comments, install the `MySt`_ plugin for Sphinx.
131
+
132
+ .. _MySt: https://myst-parser.readthedocs.io/en/latest/index.html
133
+
130
134
  Quickstart
131
135
  ----------
132
136
 
@@ -447,36 +451,49 @@ Autodoc directive
447
451
  You can automatically generate documentation for any object by invoking
448
452
  the :rst:dir:`lua:autoobject` directive.
449
453
 
450
- .. note::
454
+ Tables are exported as :rst:dir:`data` by default, meaning that their contents
455
+ are not documented.
451
456
 
452
- Autodoc will parse object comments as ReStructured Text, not as MarkDown.
457
+ To enable documentation within a table, document is as a class.
458
+ If you inherit it from `table`, autodoc will treat it as a module.
459
+ Thus, a typical Lua module will look like this:
453
460
 
454
- .. note::
461
+ .. code-block:: lua
455
462
 
456
- Tables are exported as :rst:dir:`data` by default, meaning that their contents
457
- are not documented.
463
+ --- This is a module. Notice that we've declared it as a class
464
+ --- inherited from :lua:obj:`table`.
465
+ ---
466
+ --- @class library: table
467
+ local library = {}
458
468
 
459
- To enable documentation within a table, document is as a class.
460
- If you inherit it from `table`, autodoc will treat it as a module.
461
- Thus, a typical Lua module will look like this:
469
+ --- Submodules should also be declared as classes.
470
+ ---
471
+ --- @class library.submodule: table
472
+ library.submodule = {}
462
473
 
463
- .. code-block:: lua
474
+ --- Other objects are documented as usual.
475
+ function library.foo() end
464
476
 
465
- --- This is a module. Notice that we've declared it as a class
466
- --- inherited from `table`.
467
- ---
468
- --- @class library: table
469
- local library = {}
477
+ return library
470
478
 
471
- --- Submodules should also be declared as classes.
472
- ---
473
- --- @class library.submodule: table
474
- library.submodule = {}
479
+ .. note::
480
+
481
+ By default, autodoc will parse object comments as ReStructured Text,
482
+ not as MarkDown. If you plan to use Markdown in code comments,
483
+ install the `MySt`_ plugin for Sphinx and invoke include
484
+ :rst:dir:`lua:autoobject` from a markdown file.
485
+
486
+ Make sure you separate separate comment markers from documentation by a space.
487
+ Otherwise, autodoc will not be able to tell your comments apart from content
488
+ automatically generated by Lua Language Server:
489
+
490
+ .. code-block:: lua
475
491
 
476
- --- Other objects are documented as usual.
477
- function library.foo() end
492
+ --- This is OK: separated by a space.
493
+ local x = 0;
478
494
 
479
- return library
495
+ ---This is NOT OK: no separation.
496
+ local x = 0;
480
497
 
481
498
  .. warning::
482
499
 
@@ -487,7 +504,7 @@ Autodoc directive
487
504
 
488
505
  2. ``@deprecated`` markers do not add any note to the documentation.
489
506
  We recommend providing an explicit message
490
- with the :rst:dir:`deprecated` directive.
507
+ with the `deprecated` directive.
491
508
 
492
509
  3. ``@nodiscard`` and ``@operator`` markers are not exported.
493
510
 
@@ -522,6 +539,8 @@ Autodoc directive
522
539
  they are skipped even if :rst:dir:`members` is passed.
523
540
 
524
541
  .. rst:directive:option:: private-members
542
+ protected-members
543
+ package-members
525
544
 
526
545
  Include non-public members to the object's description.
527
546
 
@@ -566,6 +585,39 @@ Autodoc directive
566
585
  for enums (``@enum``). If ordering by source, enums will be placed
567
586
  at the end of the documentation.
568
587
 
588
+
589
+ Controlling generation from code comments
590
+ -----------------------------------------
591
+
592
+ When using :rst:dir:`lua:autoobject` in recursive mode, it is sometimes necessary
593
+ to override its options for some objects. To do this, you can include specially
594
+ formatted comments to your documentation.
595
+
596
+ To override any :rst:dir:`lua:autoobject` setting for a particular object,
597
+ use ``!doc`` comments. For example, here we enable :rst:dir:`lua:autoobject:special-members`
598
+ and exclude ``__tostring`` for class ``Foo``:
599
+
600
+ .. code-block:: lua
601
+
602
+ --- Some class documentation...
603
+ ---
604
+ --- !doc special-members
605
+ --- !doc exclude-members: __tostring
606
+ --- @class Foo
607
+
608
+ You can also specify which type of object is being documented by using
609
+ a ``!doctype`` comment. For example, here we use ``!doctype const`` to indicate
610
+ that a certain variable should be documented as :rst:dir:`lua:const`:
611
+
612
+ .. code-block:: lua
613
+
614
+ --- Some const documentation...
615
+ ---
616
+ --- !doctype const
617
+ --- @type string
618
+ foo = "bar!"
619
+
620
+
569
621
  Settings
570
622
  --------
571
623
 
@@ -55,6 +55,7 @@ doc = [
55
55
  Documentation = "https://taminomara.github.io/sphinx-lua-ls/"
56
56
  Issues = "https://github.com/taminomara/sphinx-lua-ls/issues"
57
57
  Source = "https://github.com/taminomara/sphinx-lua-ls/"
58
+ Changelog = "https://github.com/taminomara/sphinx-lua-ls/blob/main/CHANGELOG.md"
58
59
 
59
60
  [build-system]
60
61
  requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel>=0.40"]
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.0.4'
21
- __version_tuple__ = version_tuple = (0, 0, 4)
20
+ __version__ = version = '1.1.0'
21
+ __version_tuple__ = version_tuple = (1, 1, 0)