Dash API Docsets for Pythonista and Editorial?
-
I've tried to run doc2dash on a mirror of the docs for Pythonista and Editorial, but it seems that script requires access to the source documentation to be built correctly. Is there any chance this can be done? It'd be much easier to read the documentation if it were available this way. Any help is greatly appreciated. Thanks!
-
The Dash docs mention a process for converting an HTML doc tree into Dash. https://github.com/cclauss/Ten-lines-or-less/blob/master/pythonista_docs.py shows you how to get to the Pythonista HTML docs embedded in the app (works in the Beta but not sure if it works on 1.5). Or you could take the HTML doc tree starting at http://omz-software.com/pythonista/docs/index.html for the Pythonista v1.5 docs.
There are some differences between the Python Standard Lib docs and the embedded version. For instance, check out the docs for the
webbrowser
module.
-
This post is deleted!last edited by
-
@Phuket2 I am not currently on the beta. As for being able to access the source code, I actually would only need access to the documentation; I don't really need access to the source code at all. If the project has a branch specifically for the documentation, I'd only need access to that alone. And I agree about Dash being able to have snippets support, its not that much to ask for.
@ccc I do know about the HTML doc tree method for Dash API docs, but unfortunately it's also a long process of ensuring that all the links in every file lead to a location relative to the resources within the docset itself, which is something I'm not able to do just yet, mainly due to my schedule. :x I knew there were changes to the standard Python libraries so iOS architecture could use them, I just figured it could just be easier to make an errata of differences between documentation sets, rather than reinvent the wheel. :)
-
@leesavide , as I say, I am not passionate about it. So I also don't want to spend too much time on it. But in the next few days I will look into again. I remember when I looked into before, it just looked to hard for me. But I wil look with new eyes ๐
I did run @ccc code, but it was sitting there forever to return a result. Internet here is crap today. I am guessing that was the reason
-
As soon as someone figures this out please share.
-
I have been only following this thread peripherally, but you guys know that the Documentation folder ( a few up from the pylib that contains the built in scripts) has the genindex files, and also a sphinx sources folder(which has .txt files of the docs)? Is that what you are looking for?
>>> os.listdir(os.path.join(os.path.split(os.__file__)[0],'../../../Documentation')) ['.buildinfo', '_images', '_sources', '_static', 'about.html', 'bugs.html', 'completion_index.json', 'contents.html', 'copyright.html', 'download.html', 'faq', 'genindex-A.html', 'genindex-B.html', 'genindex-C.html', 'genindex-D.html', 'genindex-E.html', 'genindex-F.html', 'genindex-G.html', 'genindex-H.html', 'genindex-I.html', 'genindex-J.html', 'genindex-K.html', 'genindex-L.html', 'genindex-M.html', 'genindex-N.html', 'genindex-O.html', 'genindex-P.html', 'genindex-Q.html', 'genindex-R.html', 'genindex-S.html', 'genindex-Symbols.html', 'genindex-T.html', 'genindex-U.html', 'genindex-V.html', 'genindex-W.html', 'genindex-X.html', 'genindex-Y.html', 'genindex-Z.html', 'genindex-_.html', 'genindex-all.html', 'genindex.html', 'glossary.html', 'howto', 'index.html', 'ios', 'library', 'license.html', 'matplotlib', 'numpy', 'objects.inv', 'objects_min.inv', 'objects_py.inv', 'py-modindex.html', 'reference', 'search.html', 'searchindex.js', 'sympy', 'tutorial', 'whatsnew'] >>> os.listdir(os.path.join(os.path.split(os.__file__)[0],'../../../Documentation/_sources')) ['about.txt', 'bugs.txt', 'contents.txt', 'copyright.txt', 'faq', 'glossary.txt', 'howto', 'ios', 'library', 'license.txt', 'reference', 'tutorial', 'whatsnew']
-
This post is deleted!last edited by
-
โ(___โ) I kinda feel dumb now. Just copy the IPA file and unzip it to a folder, look for the doc sources there. Then cd to it and run the doc2dash command as you see fit.
I had forgotten I did the same thing when I wanted to recreate the ePubs to all the O'Reilly Media ebook apps, when they were available.
-
@leesavide , Lol. Does that mean you can do it?
-
@Phuket2 Yes, I'll do it as soon as I'm able to.
-
@leesavide , ok perfect. I understand you have time constraints. I thought your comment was saying that you could. Was just checking. But good we have a conversation about it. Amazing the things that can come out a a simple conversation
-
I've tried this a while ago because I thought it would be nice to offer downloadable DocSets for Dash. As far as I remember, it didn't work completely because of the way I combine the Pythonista "core" documentation, and the ones for NumPy/matplotlib/SymPy.
I had some trouble combining them into one Sphinx project (don't remember the details), so I wrote a script that builds them separately, and combines the indexes I need for the in-app search afterwards.
Apparently, this confuses the docset2dash tool, and the result only contained the "core" docs, and not NumPy/matplotlib/SymPy โ which may actually not be such a big problem because I think separate docsets are available for these packages.
-
@omz That make sense - doc2dash isn't a recursive tool. I kind of figured itd have to be a scripted job to generate a Dash docset, I just didn't know if it was already being done or not.
-
@omz it seems both of us may be wrong: I ran the tool today and was given all of the documentation. NumPy, Matplotlib, and SymPy were added along with them; I did not need to rerun the tool on any additional subproject. I do not know if it worked; I will have to determine that when I'm able to get on my Mac. I did notice that the SQLite3 database took longer than normal to generate, and I did happen to run the script on Editorial's documentation earlier, but I'll have to test that later, as well.
-
GOOD NEWS
I got the docsets to work and they do include all the documentation of their respective subprojects, and any custom documentation, for both Editorial and Pythonista.
BAD NEWS
I don't know how to make the docsets start on the index.html page. (ยดโโฝโ `) They both seem to want to start on the modules index page instead. If anyone can tell me how to fix that, I'd be more than willing to post the files on a GitHub Pages site, given I have @omz's permission to.
-
Sure, go ahead. Don't know how to fix the index.html issue, and I don't think it would bother me much โ I mostly just use Dash for searching anyway.
-
@leesavide Are you going to contribute this to the User contributed docsets in Dash? Would be awesome :) thanks.
-
I totally thought my mind was playing a trick on me when I found this...but:
-
@leesavide , I am the same. I just use it for searching. Doesn't matter were it starts. I understand for completeness I would be good to get it
-
In that case, I'll post it later today :) I'm kinda glad that for once I didn't have to jump through a bunch of hoops to get a solution, which is phenomenally rare.