Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialnfs
35,526 PointsI don't get it, How do I get a boilerplate code from the snippets?
I tried the snippet in the sublime text but found something I didn't understand. If you need it then I post it for you.
<snippet>
<content><![CDATA[
Hello, ${1:this} is a ${2:snippet}.
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- <tabTrigger>hello</tabTrigger> -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
2 Answers
NiKole Maxwell
11,083 PointsIts the teachers notes for the video. The Sublime snippet is listed as: *Update - scratch this note, see below for update *
<snippet>
<content><![CDATA[Type your snippet here]]></content>
<!-- Optional: Tab trigger to activate the snippet -->
<tabTrigger>xyzzy</tabTrigger>
<!-- Optional: Scope the tab trigger will be active in -->
<scope>source.python</scope>
<!-- Optional: Description to show in the menu -->
<description>My Fancy Snippet</description>
</snippet>
I'd say check your content against the rules listed below the snippet syntax for the desired result and tinker with it a little. I prefer Visual Studio Code and the snippets there are bit simpler.
nfs
35,526 PointsHey, thanks a lot for your effort NiKole Maxwell, I really appreciate it...
NiKole Maxwell
11,083 PointsNiKole Maxwell
11,083 PointsGot it - needed to rewatch the video to understand where your question was stemming from.
To add the generic html snippet from Sublime do the following:
fileName.html
.html
then press TAB immediately after.The editor will render the following code to get you rolling.:
You fill in the rest. For clarification, this is same as it is in VS Code. The method you posted above is how you would create a snippet of your own. This helps if you've created a piece of code and reuse it frequently and would work in the same way. Hope this helps to clear it up a little.
If not add more info and someone else can assist. Have fun!