~rsl

Denmark, Copenhagen

Trackers

~rsl/sphinxcontrib-cldomain

Last active 4 months ago

~rsl/cl-git

Last active 1 year, 6 months ago

#3 feedback? "missing lisp data" for cl:print and others 2 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

REPORTED RESOLVED FIXED

#3 feedback? "missing lisp data" for cl:print and others 2 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

Hey,

I have just pushed a new version 0.19.0, which encompasses all the fixes already mentioned plus one more.

"~vindarel" outgoing@sr.ht writes:

Oh my. I was so close and so far. I thought documenting cl:print was a safe test. I don't need the common-lisp package.

Yeah when I saw you had done this, I also thought that what you had done was reasonable. So it now will work.

To support this the cl:package directive will now load the symbols on evaluation rather than CLDomain loading them on initialisation. The directive will also work if you use an alias, like your example did (cl). So there is no longer any reason to list packages in the conf.py file.

I'll close this bug as fixed, if you have any other feedback, issues or need features let me know.

Thanks, Russell

#1 Class support 2 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

REPORTED RESOLVED FIXED

#1 Class support 2 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

RESOLVED CLOSED REPORTED

#2 Condition support 2 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

REPORTED RESOLVED FIXED

#2 Condition support 2 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

RESOLVED CLOSED REPORTED

#2 Condition support 2 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

this is basically done

REPORTED RESOLVED CLOSED

#1 Class support 2 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

this is basically done

REPORTED RESOLVED CLOSED

#3 feedback? "missing lisp data" for cl:print and others 3 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

"~vindarel" outgoing@sr.ht writes:

thanks for your proposal, I invited you on Github. I simplified the project and made it nearly self-contained, you'll have to clone a dependency (see TESTING-sphinx-cldomain.txt).

I cloned this earlier in the week and started looking into the bugs. Sorry it took a while

my cl_systems is

cl_systems = [{"name": "mito-admin",
               "path": dirname(realpath(__file__)),
               "packages": [
                   "mito-admin",
               ]
               }]

Yep this looks good

Exception occurred: File "/home/vince/projets/openbookstore/openbookstore/src/web/mito-admin/env/lib/python3.8/site-packages/sphinxcontrib/cldomain/cldomain.py", line 908, in cl_handle_signature raise RuntimeError( RuntimeError: Error while trying to find details of exported symbol print

OK, so this error. It's explaining that the print symbol can't be found. I struggled to read the message myself. I have adjusted these to now print the symbol in a quoted form, and include the package, so it's clear what symbol it's looking for. In retrospect this error should also try to explain what to do, so I'll look at adding documentation and directing the user to it.

When I looked at your index.rst file, it was declaring a symbol from the common-lisp package

Test:

.. cl:package:: cl

.. cl:function:: print

This is the symbol it's struggling to load. If I remove these 2 lines, then I get the next error.

RuntimeError: Error while trying to find details of exported symbol print-slot

This error is because it can't find the documentation string for the symbol print-slot print, slot is not exported from the package mito-admin so that can be fixed by adding it.

After these 2 changes everything generates.

Now, the alternative way to fix this is to enable the COMMON-LISP package. Which I have done previously, when I was messing about trying to see if I could improve that documentation.

To enable it is a bit janky, removing the cl_packages way of declaring packages.

               "packages": [
                   "mito-admin",
                   "common-lisp",
               ]

:/ yeah so I'M not happy about that, I'll have think a bit more about how to solve that one.

Anyway, if I do enable it then I get a lisp error

Unhandled TYPE-ERROR in thread #<SB-THREAD:THREAD tid=14046 "main thread" RUNNING
                                  {10012B00A3}>:
  The value
    #<STANDARD-CLASS IT.BESE.ARNESI:STREAM-LOG-APPENDER>
  is not of type
    SYMBOL
  when binding SYMBOL

Backtrace for: #<SB-THREAD:THREAD tid=14046 "main thread" RUNNING {10012B00A3}>
0: (SYMBOL-PACKAGE #<STANDARD-CLASS IT.BESE.ARNESI:STREAM-LOG-APPENDER>) [external]
1: (ENCODE-SYMBOL #<STANDARD-CLASS IT.BESE.ARNESI:STREAM-LOG-APPENDER> "~a")
2: (SPHINXCONTRIB.CLDOMAIN::ENCODE-SPECIALIZER #<SB-MOP:EQL-SPECIALIZER #<STANDARD-CLASS IT.BESE.ARNESI:STREAM-LOG-APPENDER>>)
3: (SPHINXCONTRIB.CLDOMAIN::ENCODE-METHODS #<STANDARD-GENERIC-FUNCTION COMMON-LISP:MAKE-INSTANCE (3)>)
4: ((:METHOD SPHINXCONTRIB.CLDOMAIN::ENCODE-FUNCTION-DOCUMENTATION (T (EQL (QUOTE GENERIC-FUNCTION)))) MAKE-INSTANCE GENERIC-FUNCTION) [fast-method]

This one I'm not so sure about. I'll have to do some fixes to the lisp side, it shouldn't error. I'll see what I can do about it on the weekend.

I have attached the changes I described above as a patch for clarity.

Thanks, Russell

#3 feedback? "missing lisp data" for cl:print and others 4 months ago

Comment by ~rsl on ~rsl/sphinxcontrib-cldomain

"~vindarel" outgoing@sr.ht writes:

I am seeking some feedback on the errors I am getting. Now I'm blocked on:

/home/vince/projets/openbookstore/openbookstore/src/web/mito-admin/index.rst:7: WARNING: Missing lisp data for package cl, name print, objtype function

So this should indicate that the package information was not available within the python environment.

I would be looking back at your log, when the sphinxcontrib-cldomain is generated, you'll see the messages like this. It should indicate that the documentation strings were loaded for the system/package you expected.

Running Sphinx v7.0.1
making output directory... done
Collecting Lisp docstrings from sphinxcontrib.cldomain.doc...
To load "sphinxcontrib.cldomain.doc":
  Load 1 ASDF system:
    sphinxcontrib.cldomain.doc
; Loading "sphinxcontrib.cldomain.doc"

The lines like Collecting Lisp docstrings from sphinxcontrib.cldomain.doc... indicate that it actually tried to load data for your requested system.

That is the crux of what I think you should be looking for.

If you can't see it, you need to configure the loading of your systems/packages.

This is the new syntax for configuring what ASDF systems to load and what packages to read documentation strings from.

cl_systems = [
    {
        "name": "sphinxcontrib.cldomain.doc",
        "path": path.dirname(path.realpath(__file__)),
        "packages": [
            "sphinxcontrib.cldomain.doc",
            "sphinxcontrib.cldomain.doc-alt",
        ],
    }
]

This is the old syntax that cl-git is using to declare it's packages. I should probably update it, but I would first try the newer syntax if you can, it should be more flexible.

cl_packages = {"cl-git": join(dirname(realpath(__file__)), "../")}

ERROR: Unknown directive type "autosummary".

for this error i think you need to add it to your extensions list

extensions = [
    'sphinx.ext.autosummary',   # Like this
    'sphinx.ext.intersphinx',
    'sphinxcontrib.cldomain',
    'sphinxcontrib.hyperspec'
]

I can probably google the "unexpected unindent" type, but I'll take any suggestion of yours with great consideration.

That all being said, I'm happy to help debug this further on your project if you can push a branch somewhere?

Cheers, Russell