Quick WebC Tip

Whenever I think I shouldn’t post something because I’m covering something completely obvious, despite the fact that I missed it, I always find at least one other person who was also a bit slow in either remembering a basi…


This content originally appeared on Raymond Camden and was authored by Raymond Camden

Whenever I think I shouldn't post something because I'm covering something completely obvious, despite the fact that I missed it, I always find at least one other person who was also a bit slow in either remembering a basic tip or figuring out the simple stuff. So hey, that one person, good morning, and I hope this helps.

Alright, so if you are using Eleventy's new WebC feature, or starting to learn it, one of the first things you'll do is create a .webc file in your editor. However, you may notice you don't get the nice formatting you are used to in your editor. Here's a screenshot from Visual Studio Code:

Screenshot from VSC

I was playing around with WebC for a few weeks before it really clicked with me that I wasn't getting proper formatting, or code hinting. Luckily it's easy enough to fix. In Visual Studio Code, open up your File Association settings. And then add *.webc as an html file:

File association settings

After that - voila:

Properly styled webc file.

You also get your expected code hinting and such which is useful of course. While this particular example is for Visual Studio Code, any decent editor would support a similar configuration as well.


This content originally appeared on Raymond Camden and was authored by Raymond Camden


Print Share Comment Cite Upload Translate Updates
APA

Raymond Camden | Sciencx (2023-01-27T18:00:00+00:00) Quick WebC Tip. Retrieved from https://www.scien.cx/2023/01/27/quick-webc-tip/

MLA
" » Quick WebC Tip." Raymond Camden | Sciencx - Friday January 27, 2023, https://www.scien.cx/2023/01/27/quick-webc-tip/
HARVARD
Raymond Camden | Sciencx Friday January 27, 2023 » Quick WebC Tip., viewed ,<https://www.scien.cx/2023/01/27/quick-webc-tip/>
VANCOUVER
Raymond Camden | Sciencx - » Quick WebC Tip. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/01/27/quick-webc-tip/
CHICAGO
" » Quick WebC Tip." Raymond Camden | Sciencx - Accessed . https://www.scien.cx/2023/01/27/quick-webc-tip/
IEEE
" » Quick WebC Tip." Raymond Camden | Sciencx [Online]. Available: https://www.scien.cx/2023/01/27/quick-webc-tip/. [Accessed: ]
rf:citation
» Quick WebC Tip | Raymond Camden | Sciencx | https://www.scien.cx/2023/01/27/quick-webc-tip/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.