Files
atom/extensions/docs/docs.coffee
Chris Wanstrath bc6e2597b0 docs extension
Only works for TomDoc'd CoffeeScript right now.

Needs to work for all languages.

I had to modify handlebars to satisfy 'use strict'

Also had to modify the path stuff in tdoc, which works
in node but not atom. We need some way to install npm packages
or something similar maybe?
2011-11-13 22:22:41 -08:00

24 lines
430 B
CoffeeScript

fs = require 'fs'
tdoc = require 'docs/tdoc'
Browser = require 'browser'
module.exports =
class Docs extends Browser
window.resourceTypes.push this
running: true
constructor: ->
atom.keybinder.load require.resolve "docs/key-bindings.coffee"
open: (url) ->
return false if not url
if match = url.match /^docs:\/\/(.+)/
@url = url
code = fs.read match[1]
@show tdoc.html code
true