how can I turn on snippets and html code formater in .tpl files? I will using Vscode to edit PrestaShop files where is a lot of html code inside .tpl files.
Format html code inside .tpl file
You can try these steps:-
First check for any extension available in vscode market place. If it is available then you can proceed with it.
The second option, which is manually configuring Visual Studio Code to handle ".tpl" files, can be done by following these steps:
Go to Settings editor, search for "files.associations" and click on the Edit in settings.json link.
In the settings.json file, add the following line of code: "* .tpl": "html"
This tells Visual Studio Code to associate the ".tpl" file type with the "html" language mode.
You can edit the file extension to .html to work with the html code formatter.
Related
I'm working on a project(IntelliJ + Grav) which all base files are *.md, I have the need to just write HTML code in one of this MD files but I can find an option to change the syntax highlight or intellisense to trigger(emmet, tags, ...).
In VS Code you can change the language mode no matter which file extension you have open.
Q: Is there a way to make IntelliJ highlight HTML code in a MD file.
PS: Don't tell me to change the file extension or open the file in VS Code, as I'm currently doing it.
You can add the file name to the HTML file type list of files/extensions and IntelliJ IDEA will treat it as HTML file instead of Markdown file.
I did XSL transformation in eclipse and the html output from transformation is not formated like every html file which I added manualy in to eclipse. Does anybody know where is the problem?
It looks like you have opened the HTML using the plain text editor.
Right click on the file in Package Explorer and choose 'Open With > HTML Editor'.
Eclipse remembers which editor you used for a file so you should only have to do this once.
So, I recently started working with EJS files within VSCode. Anyway, when I added the EJS extension, I lost all of HTML emmet functionality in my EJS files. However without the EJS extension HTML works fine but I obviously lose the JS syntax highlighting. Is there any work around for this?
What is the best set-up for working with EJS files in VSCode?
Any help would be greatly appreciated.
Guess you already made it work, but I'm gonna leave this here for future reference.
Add this to your Settings:
{
...,
...,
"emmet.includeLanguages": {
"ejs": "html"
}
}
The VS-Code docs tell us how to configure emmet for any file
In the settings.json file ... within the .vscode folder in the root of your project put this:
{
// ... your other settings if you have them ...
"files.associations": {
// This will enable html vscode autocompletion in EJS files
"*.ejs": "html"
}
}
It will make your ejs files to autocomplete with html tags from vscode.
General advice for Web Development is that it is better to have ClientSite-JS in different JS files and ServerSide-JS in Express js files/routers.
You can use pret .prettierignore
Create .prettierignore file and add certain file extension what you want to ignore.
# all ejs files
*.ejs
I have a .erb
Which means that I have HTML syntax inline.
File association for .erb is .erb using Ruby Extension and Simple Ruby Extension, I also have the HTML Snippets extension installed
What I want is to provide HTML snippets within the .erb file - but it seems I can only have one of the other.
HTML Snippets gives if I add *.erb: "html" then I lose the .erb snippets
"files.associations": {
// extension name : html
"*.ejs": "html",
"*.js": "html"
}
Any help appreciated.
This GitHub issue may help you out: HTML snippets in other languages. According to this link, you'll need to add some extra lines to the package.json file that comes with the snippet extension.
I am compiling one chm file with set of html files. In one html file i am using iframe tag and viewing text file throught 'src' attribute. I am able to see the contents of text file inside iframe when opening that HTML file in a browser. But when viewing that file in a chm file i don't see text file content. It is showing 'This page can’t be displayed' error in iframe.
This is the tag i'm using:
<iframe src="./mytextfile.txt" style="width: 100%; height: 300px;border:none"></iframe>
Is there anything to add to view that file. Please help me.
As you can see - your problem is reproducible (here on a German Windows10 machine).
You must ensure that the text file is either in the same directory as the project (.hhp) file or in a subdirectory of that directory.
You also have to add the *.txt file extension or filename to the [FILES] list in the .hhp file, as this ensures that the text file will be compiled into the .chm file. Best way is to do this by a text editor like shown below:
Save the *.hhp file and compile all content to your *.chm file.
Done!
BTW - here are some hints to another problem may be targeted:
Microsoft introduced some security restrictions many years ago that disable functionality in HTML Help files that are accessed over a network, so what you're seeing is almost certainly by design. There are two possible solutions: move the help file to your local drive, or implement some changes in the Windows registry so that you can view the contents of remote help files.
Microsoft's summary of the problem: http://support.microsoft.com/kb/896054
You may try following workaround that lets you explicitly 'unblock' a CHM help file coming from a network drive or internet download. To do this:
Open Windows Explorer
Find your CHM file
Right click and select Propertie
Click the Unblock button on the General tab
For information on how to make the registry changes, see this page:
http://www.grainge.org/pages/authoring/chm_mspatch/896358.htm
Or more straightforwardly, use the free HHReg utility available from the page below to make the required changes.
http://www.ec-software.com/products_hhreg.html