Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Resolve #194: show documentation of class members
Browse files Browse the repository at this point in the history
  • Loading branch information
camilstaps committed Jul 11, 2018
1 parent 866f8e7 commit fc6e090
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion backend/Cloogle
8 changes: 4 additions & 4 deletions backend/Makefile
Expand Up @@ -4,10 +4,10 @@ DB=types.json
MAN:=builddb.1 # Others don't have --help/--version # $(addsuffix .1,$(BIN))
CLM:=clm
CLMFLAGS:=-h 250M -nr -nortsopts\
-I $$CLEAN_HOME/lib/ArgEnv\
-I $$CLEAN_HOME/lib/TCPIP\
-I $$CLEAN_HOME/lib/Platform\
-I $$CLEAN_HOME/lib/Platform/Deprecated/StdLib\
-IL TCPIP\
-IL Platform\
-IL Platform/Deprecated/ArgEnv\
-IL Platform/Deprecated/StdLib\
-I Cloogle\
-I Cloogle/libcloogle\
-I Cloogle/CleanPrettyPrint\
Expand Down
20 changes: 12 additions & 8 deletions frontend/api.js
Expand Up @@ -642,14 +642,18 @@ function getResults(str, libs, include_builtins, include_core, include_apps, pag
makeInstanceTable(extra['class_instances'], 'type'),
pluralise(extra['class_instances'].length, 'instance')]);

var html = highlightClean(
'class ' + extra['class_heading'] +
(extra['class_funs'].length > 0 ? ' where' : ''),
highlightCallback) + '\n';
for (var i in extra['class_funs'])
html += highlightClean(
'\n ' + extra['class_funs'][i].replace(/\n/g, '\n '),
highlightCallback, 'macro');
var code = 'class ' + extra['class_heading'] +
(extra['class_funs'].length > 0 ? '\nwhere\n' : '');
for (var i in extra['class_funs']) {
if ('class_fun_doc' in extra &&
extra['class_fun_doc'].length > i &&
extra['class_fun_doc'][i].length == 2)
code += '\t' + extra['class_fun_doc'][i][1].replace(/\n/g, '\n\t') + '\n';
code += '\t' + extra['class_funs'][i].replace(/\n/g, '\n\t');
if (i < extra['class_funs'].length - 1)
code += '\n\n';
}
var html = highlightClean(code, highlightCallback);

return makeGenericResultHTML(basic, meta, hidden, html);

Expand Down

0 comments on commit fc6e090

Please sign in to comment.