dependents / Dependents

Navigate front-end codebases in Sublime Text 2/3
Other
41 stars 5 forks source link

Dependents support for html/hugo template partials. #114

Open dkebler opened 9 years ago

dkebler commented 9 years ago

I use a static site builder/templater engine called Hugo. http://gohugo.io/

VERY like sass hugo uses a partial import. I have my html template directory structure set up in best practices like sass but lack the cool way to navigate them in sublime.

The syntax instead of @import uses double moustache codes

        {{ partial "body/main.html" . }}

So how hard is it to add another language with it's partial syntax?

In this case Dependents would be looking at .html files for that moustache code {{ partial parsing out the path/file just like it does in the @import.

not sure about other builders but I bet it is similar so whatever is done could be easily extended to other html templating like rails, Jekyll, etc.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

mrjoelkemp commented 9 years ago

Hey @dkebler. Thanks for the feature suggestion.

For the Jump to Dependency feature, this might work right out of the box – barring any (incorrect) assumptions on file extensions.

For Find Dependents (i.e., finding which files depend on "body/main.html", a custom detective would be necessary to extract the partial keyword's value. Check out https://github.com/mrjoelkemp/node-detective-sass for a similar implementation. This custom detective could be called node-detective-hugo unless that name is associated with other import styles.

Once the detective is there, it'll need to be registered in https://github.com/mrjoelkemp/node-precinct under the sass type.

Let me know if you're interested in tackling the custom detective and its integration.