Bug 332717 - Include way to look up help for specific languages
Summary: Include way to look up help for specific languages
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 3.11.5
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-27 22:51 UTC by Kevin Coonan
Modified: 2016-09-05 12:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Coonan 2014-03-27 22:51:37 UTC
Please add "man page for [bash command]","Javadoc for [Java class/library]","R documentation for [R package]","MySQL documentation for [chapter/function/etc.]"  and so on to the help menu.

Documentation is installed on most systems in a range of locations.  Being able to look up the syntax and other documentation is a common need, and would greatly enhance Kate's utility.

It should be fairly easy to create a basic "lookup(keyword|REGEX) in (command|URI) using (filter)  with(index filter)" part which people could then customize using simple configuration files.

Upon selection/loading of the plug it, it checks to see if the index has been built, and to see if the index build date is after the last update of the target resource.  If index is out of date or doesn't exist, the plug-in generates an up-to-date index for that resource.

The help menu would then have an entry for the reference(s) tied to the specific mode/highlight syntax.  In addition, a tab at the bottom (e.g. where the XML Checker Output, Terminal, etc. live) would have a box to type a keyword, with an optional box to type in a REGEX.  The rest of the tab would be the results or resource entry.

Since each resource (man pages, Javadoc, etc.) has different structure, a filter will be needed both for generation of the index (which maps resource-specific parameters to the lookup plugin index metadata/keyword/synonym entry), and for conversion of results from the target resource into a standard format (I would suggest that the standard format be defined in a standard Kate highlighting definition so users could futz with it to fit their particular aesthetics).

Reproducible: Didn't try

Steps to Reproduce:
1.  Realize there is something you don't know about what you are doing
2.  Figure out what you need to look up
3.  Go to Kate's Help menu
Actual Results:  
Nothing in the help menu

Expected Results:  
Have a simple look up function specific to the type of file being edited

Each resource would have a single config file that defines which index filter and resource filter to use, and which highlighting text style it would bind to. 

A resource filter defines the location and mechanism to query, retrieve and transform the output of some information source.  It also indicates if the resource is via network connection, and allows defining proxy server information.  These would include man pages, info pages,  and web sites.  

It would also allow indicating how to merge two (or more) resources into a single virtual one (by mapping the fields of additional resources into the particular one specified by the resource filter using those resources specific index filters/resource filters).  E.g. so you can query info and man pages together.

It would define how to parse results of look ups from the target resource into a standard pick list, and how to convert the user selection back into a request for the specific information.

The index filter would define how to send a keyword, search term, and/or REGEX to a web site or local resource (including any switches/options needed).  In addition, it would allow creation of a Kate-specific index for those resources which don't include query capability (e.g. if someone wanted to make a plug-in that let you search C/C++ header files to let you look up the comments for a specific function in some library, or even just have a set of text files as the resource) by specifying index entry metadata, keywords, and any additional text terms/synonyms.  

In addition, some provision for a hierarchical search should be provided which would allow one to request a listing of defined children (subsections, specific functions or parameter specific options, etc.) for those resources which are structured this way (such as WikiPedia's mobile site does).  

You would probably need an additional set up file that let you indicate which specific source(s) were used to build specific indexes.  This would allow reuse of filters, as well as allowing one to create virtual resources (where >1 resource would need to be processed to create an index, and a given actual resources could show up in more than one virtual resource).  It would effectively be a tuple:

source of indexable material|index filter|index.

You might define the various index entries like:
CREATE TABLE `index_description` (
  `index_name` varchar(255) NOT NULL,
  `resource_name` varchar(255) NOT NULL,
  `index_type` enum('website','output','internal') NOT NULL DEFAULT 'internal' COMMENT 'local = kate specific index created for this purpose, website = website which allows query by keyword and/or text phrase (optional: REGEX), output = index is provided by application which generates the resource content in response to inputing keyword or text phrase',
  `source_of_keywords` enum('flatfile','parsed_markup','none','output','local') NOT NULL DEFAULT 'local' COMMENT 'flatfile = one keyword per line, with comma-separated synonyms or search terms following; parsed markup = HTML. XML. troff, TeX, WikiText, etc. resource where the markup identifies the keywords (optional text phrases); output = keywords are generated from application when provided specific input',
  `keyword_lookup` varchar(1024) NOT NULL DEFAULT '''kate_reference_db.index_db.keyword''' COMMENT 'path/URI to query for %keyword',
  `keyword_lookup_return` enum('uuid','uri','oid','string','url') NOT NULL DEFAULT 'uuid' COMMENT 'format of identifier returned from keyword lookup',
  `allows_regex_search` tinyint(1) NOT NULL COMMENT 'indicates whether or not the index wills upport regex searches',
  `regex_query_method` enum('submit','local','file') NOT NULL DEFAULT 'local' COMMENT 'submit = REGEX is parameter for query of some applicatino or web site; local uses internal database containing the searchable (plain) text of resource; file is a delmited text file which contains the searchable text.  Each line contains the keyword, followed by the associated full text used for searching',
  `regex_input_location` varchar(1024) DEFAULT '''kate_reference_db.fulltext_db.fulltext''' COMMENT 'path/URI used to query for %regexp for the keywords of entries.  Defult is the local index',
  `allows_synonym_search` tinyint(1) NOT NULL COMMENT 'indicates wheter the index will support simple text (e.g. synonym) searches',
  `synonym_lookup` varchar(1024) DEFAULT '''kate_reference_db.index_db.synonym_set''' COMMENT 'path/URI to query %text (alternative text /phrase / synomym)',
  `allows_full_text_search` tinyint(1) NOT NULL,
  `fulltext_input_location` varchar(1024) DEFAULT '''kate_reference_db.fulltext_db.fulltext''' COMMENT 'path/URI used to query for %fulltext',
  `index_access_method` enum('http','ftp','webdav','https','ftps','sftp','ssh_local_file','sshfs','local','application') NOT NULL DEFAULT 'local' COMMENT 'how to connect to the index application/web site, or ''local'' if internal db used',
  `index_user_id` varchar(64) DEFAULT NULL,
  `index_user_pw` varchar(64) DEFAULT NULL,
  `index_proxy_url` varchar(255) DEFAULT NULL,
  `index_proxy_user_id` varchar(64) DEFAULT NULL,
  `index_proxy_user_pw` varchar(64) DEFAULT NULL,
  `keyfile` varchar(255) DEFAULT NULL COMMENT 'path to X.509 certificate needed for connection',
  `port` int(11) DEFAULT NULL COMMENT 'non-standard port used to connect to index',
  PRIMARY KEY (`index_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
Comment 1 Alex Turbov 2014-04-22 21:43:37 UTC
how do you suppose kate will display search results? i.e. when I've asked smth from indexed docs kate can display some list of results, and if I click on some item what should happened?
for example I've got a kdelib (or any other library) HTML docs installed (w/ not trivial HTML/JS content) -- kate is not a browser (!), yeah it can have a toolview w/ `konqueror` inside (like terminal plugin has `konsole` kpart) -- but it is too small to read docs? don't you think so?
Comment 2 Christoph Cullmann 2016-09-05 12:06:59 UTC
Dear user, this wish list item is now closed, as it wasn't touched in the last two years and no contributor stepped up to implement it.

The Kate/KTextEditor team is very small and we can just try to keep up with fixing bugs. Therefore wishs that show no activity for two years or more will be closed from now on to keep at least a bit overview about 'current' wishs of the users. If you want your feature to be implemented, please step up to provide some patch for it.

If you think it is really needed, you can reopen your request, but keep in mind, if no new good arguments are made and no people get attracted to help out to implement it, it will expire in two years again.

We have a nice website kate-editor.org that provides all the information needed to contribute, please make use of it. For highlighting improvements our user manual shows how to write syntax definition files. Greetings Christoph