atom-goto-definition
atom-goto-definition copied to clipboard
Support for Pug and HTML
It'd be great to jump around and to HTML/Pug (formerly Jade) source files, especially with a template-heavy web framework like Knockout.
Samples IDs:
<div id="my-id"></div>
And Pug:
div#my-id
Cheers.
It looks like support for HTML is in config.js. Here's a possible Pug definition:
PugTemplate: {
word: /[$0-9a-zA-Z_-]+/,
regexes: [
/^\s*{word}\#{word}(\s|\(|$|\.)/
//^^ presumes ^ is beginning of a line (not the file)
],
files: ['*.pug'],
dependencies: ['JavaScript', 'CoffeeScript', 'TypeScript']
/* Not sure what these are for ^^^ */
}
Some examples of valid pug:
template#id
template#id_2(attribute=xyz)
template#id_3
custom-tag#id-with-dash
template#id_with_class.some-class