Forum Archive

Dash API Docsets for Pythonista and Editorial?

leesavide

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!

Phuket2

@leesavide , I don't know. But would love to know if you get it. I use Dash.

leesavide

I'll see if there's something I can do to make it work. Otherwise, it'd have to be up to those with access to the source code for both apps to create it.

Phuket2

@leesavide , I did read about the doc set creation sometime ago. Was interesting, but I think it didn't get my heart racing. Dash on iOS is so disappointing to me compared to Mac OS. No notes, no ability to download stackflow database. It's ok, but just ok....it's a shame, on Mac OS it's a great product, on iOS just another so so reference tool. But still I will not kick,it out of bed if it had the Pythonista doc set ๐Ÿ˜€

leesavide

@Phuket2 I can agree with you about it being a "meh" app for iOS. But on the other hand: LovelyDocs on Android is even MORE "meh" than that, with no way to even add custom docsets from other sources. Aside from its limitations, there's no other documentation browser I know of for iOS that can be worked with in this way, especially since you could also just strip out the embedded Python, matplotlib, numpy, etc. docs in Pythonista's documentation, given that Dash already has those available as separate docsets... Unless there's specific changes to the versions that Pythonista uses.

Phuket2

@leesavide , but I would alove a copy of the docs if you do get them done. Are you on the beta or 1.5? The beta you get access to the source. I think but am not sure , it maybe hidden away in a folder on 1.5 also. I am not sure why you need the source of dash though. Again, I haven't had time to go back and review the dash doc building requirements.

I think I will write to the authors and ask them if they have plans to add more of the Mac app features. The thing I am missing the most on iOS is a nice database knowledge base style app. I want to store things like links to stackflow/other website answers to specific things I have looked up, code snippets(not just for pasting), but little pieces of code I see around that look really nice, but I know I will forget we're I seen it and how it was done) storing the syntax for adding Dropbox pictures into forum here (just get these mental blanks sometimes) so a system I guess that just supports tagging and is able store various types of media intelligently. I have just started using NoteSuite, it seems pretty good, but still a notes system rather than a knowledge base system. If you have any recommendations, would love to hear them

ccc

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.

aanchal

LEO PRIVACY GUARD 3.0.How to protect our app from being uninstalled by other people?
Please go to AppLock page, enable "Advanced Protection" in AppLock Settings.
Step: AppLock--

leesavide

@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. :)

Phuket2

@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

Tizzy

As soon as someone figures this out please share.

JonB

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']
leesavide

@JonB that is what we're looking for! :D

leesavide

โŠ‚(___โŠ‚) 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.

Phuket2

@leesavide , Lol. Does that mean you can do it?

leesavide

@Phuket2 Yes, I'll do it as soon as I'm able to.

Phuket2

@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

omz

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.

leesavide

@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.

leesavide

@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.

leesavide

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.

omz

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.

Tizzy

@leesavide Are you going to contribute this to the User contributed docsets in Dash? Would be awesome :) thanks.

Tizzy

I totally thought my mind was playing a trick on me when I found this...but:

https://github.com/omz/Dash-Plugin-for-Xcode#readme

Phuket2

@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

leesavide

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.

leesavide

@Tizzy I was originally planning to just host them on my user page, but your idea is MUCH better, so I'll do that :D

Tizzy

@leesavide https://github.com/Kapeli/Dash-User-Contributions#contribute-a-new-docset

I''m sure you're already there :) I'm excited. thanks.

leesavide

I've made a pull request for the User contributed docsets, but seeing as the Pythonista docset is just under 70 MB alone, it might be better to host it separately. As for Editorial, it's significantly smaller, so that shouldn't be a big problem.

As a backup plan, I've also made GitHub repos for both Pythonista and Editorial; that way even if they aren't accepted into the user contributed docsets for being too large of uploads, they'll still be available for people to build on their own and install locally. Any contributions for bugs (broken links, missing files, etc.) are welcome and encouraged.

EDIT: When I initially generated the docset on Windows, it seems the script skipped over files it had errors on, resulting in a smaller size docset. On Mac or Linux, though, no errors are produced, and the docsets generate as normal...making the Pythonista docset 141 MB, not 70. (ยดโ—โ–ฝโ— `) Because GitHub has a 100 MB file limit, I would stick to building these locally.

ccc

Perhaps a different approach... Instead of posting the docs online, could we post the Python script that builds the docs?

That way we could post and download far less than 70MB and anyone who had Pythonista and the script could generate their own docs for the version of Pythonista that they are running.

Tizzy

That would be a great additional option... but it would be super convenient to just be able to download into dash and call it a day..

JonB

It seems like at least half of the doc size is from mayplotlib/numpy, which have a ton of large images... maybe you should strip out matplotlib?

Tizzy

great Idea JonB. Especially since you can get the documentation for matplotlib in Dash independently anyways.

leesavide

Seems they'll take the docs into the User contributed docsets, I just need to reissue the pull request. Part of the mistake was accidentally checking out with core.autocrlf set. I'll reissue it and keep you all up to date. (โ—โ–ฝโ— )

I may have spoke too quickly and fumbled over my words:
- The Pythonista docset uncompressed is 141 MB. Compressed in a tgz it is 70 MB.
- The Editorial docset uncompressed is about ~40 MB. Compressed in a tgz it is about ~7 MB.

leesavide

The docsets have been published successfully to the user contributed repository :D

Tizzy

Wonderful! I've downloaded it. Thank yOU!

screenshot

I have one issue:
the pythonista docset you uploaded has a minimum width that's pretty wide, necessitating sideways scrolling sometimes, unlike most dockets which are responsive and can be very narrow.

Also would be great to have updated docs for 1.6beta/2.0.

Regardless, I'm thrilled to have Pythonista in dash.

leesavide

I'll see if there's possibly a way to manipulate sphinx's html docs to do this. However, I don't understand why you'd have a viewport issue with the docs when they were originally built with the intention of being viewed on an iPhone. By default, most of the HTML documents in the docset are configured to have a dynamic viewport so they'll fit in the screen no matter what device you use to view them. Can you show a screenshot of what's happening with your copy?

Tizzy

@leesavide It's a minor inconvenience at worst, far outweighed by the benefit of having them available. But here is a screenshot:
Screenshot of text behavior
EDIT: Try this link?
alternative link

PS - is there a way to post a photo in the forum inline rather than through a link?

leesavide

I think you might need to try reuploading the image, as I'm getting a 403 on that link :< Imgur

As for the 1.6 beta / 2.0, I'd need invites to the TestFlight for either version, as I can't get documents for apps I don't have access to :3

Sadly, for images, you have to post them as links to content hosted elsewhere. :x

leesavide

I'm seeing the issue you mean now, they end up with pages that are far too wide for the screen, forcing zooming in to even read what's on some pages.

I have 3 ideas for fixes:

  1. I have to ask @omz to change the styling he uses for the Sphinx build so they'll show all the pages in a mobile-aware setting.

  2. Turn your phone or iPad sideways for landscape mode so the pages fill more of the screen while you're reading. :P

  3. Make the app's font size smaller. This is part of the Dash app to accommodate pages that break the page flow and might be displayed incorrectly.

The biggest issue with handling documentation is that when you want it in a certain format, sometimes its just easier to deal with what you have than have to shoot yourself in the foot, repeatedly, to get something to work a certain way. If there's anything I've learned from college and software developement, that's the best lesson I've learned thus far.

Tizzy

@leesavide hmm weird. The link seems to be working for me still. but I added another one just in case. Previously i got the direct url to the dropbox image, the second link is the one they provide with "share link" formatted in their html.

Like i said, I'm just grateful to have something in dash.

As far as 2.0/1.6 beta would be great but I'm sure it'll come eventually. I wonder how 2.0 review is doing "=fingers crossed.= there's a link to a form to join the beta floating around this forum.

leesavide

Hot diggity dayum, its time to update the docs :D

leesavide

Attempted to update via the User contributed docs, but they've disabled Git LFS on the repo, so that will have to wait for now. In the meantime, I've got the docsets hosted on Github here for Pythonista, and here for Editorial. If ever theres a hiccup in getting the docsets integrated with the official Dash Docsets, I'll keep the Github releases available as a backup.