dash-docs icon indicating copy to clipboard operation
dash-docs copied to clipboard

Unofficial docsets are not loading

Open agzam opened this issue 11 months ago • 1 comments

(dash-docs-unofficial-docsets) points to the broken url "https://dashes-to-dashes.herokuapp.com/docsets/contrib"

Maybe better to try to load them from https://github.com/Kapeli/Dash-User-Contributions?

agzam avatar Aug 25 '23 23:08 agzam

I was able to (I think at least partially) fix the issue, doing this:

(defun dash-docs-unofficial-docsets ()
  "Return a list of lists with docsets contributed by users.
The first element is the docset's name second the docset's archive url."
  (let ((user-docs (assoc-default 'docsets
                                  (dash-docs-read-json-from-url
                                   "https://kapeli.com/feeds/zzz/user_contributed/build/index.json"))))
    (mapcar (lambda (docset)
              (list
               (assoc-default 'name docset)
               (car docset)
               (assoc-default 'archive docset)))
            user-docs)))

(defun dash-docs-install-user-docset ()
  "Download an unofficial docset with specified DOCSET-NAME and move its stuff to docsets-path."
  (interactive)
  (let* ((docsets (dash-docs-unofficial-docsets))
         (docset-name (dash-docs-read-docset
                       "Install docset"
                       (mapcar 'car docsets)))
         (docset (assoc-default docset-name docsets)))
    (when (dash-docs--ensure-created-docsets-path (dash-docs-docsets-path))
      (let ((url 
             (format "https://kapeli.com/feeds/zzz/user_contributed/build/%s/%s"
                     (car docset)
                     (cadr docset))))
        (dash-docs--install-docset url (car docset))))))

But I can't make every docset to work. Maybe it's a weird issue with docset itself.

agzam avatar Aug 26 '23 00:08 agzam