evancz/elm-lang.org — pull request #27 by madscoaducom (2013-05-06 22:04:54+00:00)
Title: Editor - inline/built-in documentation

Hi Evan,
so I think built-in documentation for the elm-lang.org editor is now ready for it's first pull request. This changeset contains:

- add type-info bar below editor window. Shows type-info from docs.json when found for keyword under cursor. Activate/de-activate under "options", activated by default and selection is persistent.
- lookup docs for keyword under cursor. Use "Ctrl+K" or click [?].
- open main documentation in new tab/window. Use "Ctrl+Shift+K" or click link in type-info bar. (Not all links work - but this seems to be because documentation is work in progress for elm-lang.org)
- update Website/Docs.elm, to add "tag"s to function sections to allow for direct linking using #anchors
- docs.json is served from installed elm package.
- update codemirror to latest version (3.12), rename codemirror folder to reflect this.
- currently markdown-to-html is handled client side using https://github.com/coreyti/showdown - this can later be refactored to be generated serverside using pandoc.
- minor refactoring of Editor.hs and editor.js

The documentation lookup is based on CodeMirrors tokenizer, and does not do anything fancy. It does narrow the search if token has a prefixed qualifier. Note that syntax elements ("keyword" types in CodeMirror speak) are treated as if part of a special "Syntax" module, just to lower special case handling and still get easy link to Syntax.elm page.

There is plenty of room for improvement but let's first see how this will be used and what (new-) users will want. If you have any problems or get problem reports related to this feature, feel free to just forward it and I will gladly investigate.

Mads