moe icon indicating copy to clipboard operation
moe copied to clipboard

Integrate offline API documentation browser (Docsets)

Open tobimensch opened this issue 3 years ago • 0 comments

I want to preface this feature request by stating, that this is clearly an advanced feature, that should be of low priority at the current stage of moe. Yet, due to the fact that moe is primarily an editor geared towards coders, I think this feature would separate moe strongly from the competition, and it's a feature I always wanted to have in other editors, too.

The GUI application zeal does exactly what I'd like this feature to do. You can install offline documentation for i.e. Nim or Boost using a dialog, and then browse those catalogs using a search box.

For reference: Zeal

The great thing is that Zeal is using a format called Docsets, that is open and well documented. So moe doesn't have to invent a new format or to create API documentation, all that moe would have to understand for this feature to work, is how to read, present and search Docsets.

Docsets in a nutshell are HTML pages describing an API and a SQLite based Index for them. Since you can't render HTML easily in a terminal, for this to work moe would've to use a HTML2markdown converter or something to that effect, to make it readable.

This could also serve as an extension of the manpage feature which is bound to the key K in vim. For example when're over a certain identifier and press K, moe could search inside all the Docset indexes (Docsets are basically simple SQLite databases, so this should be relatively easy to implement), and then present the user with documentation, if any was found. Alternatively instead of converting those HTML pages to markdown(or another terminal renderable format), the documentation could also be opened in a webbrowser.

Of course, when and if we implement this advanced feature, moe should also have support for classic manpages, like vim.

tobimensch avatar Jul 13 '20 17:07 tobimensch