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.
Related
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.
If I have an html file somewhere in the same folder as a markdown document, is there any way to embed the entire file inside a markdown document, so that the html will be rendered correctly (not just the code displayed)?
Markdown doesn't support includes out-of-the-box. You need to use one of the existing flavors or static site generators that support markdown or/and HTML inclusions. For example, DocFX
You can't include other Markdown files in Readme (Readme is usually Markdown file). You can use the "Quote" (See example below)
This is Quote
> This is Quote
You can see my Markdown guide here
For most of my project's documentation I prefer a standard sphinx layout. However for the landing page I would prefer to use custom HTML/CSS/JS without any of the layout, TOC, or sidebars of the normal sphinx site. Is there a way to include a raw HTML standalone page in a sphinx-generated website in a way that completely disregards the normal layout of the rest of the site?
As a counter example I know that I can include raw HTML bits into a page using the following (see also this question)
.. raw:: html
:file: myfile-html
However this just embeds a file within the normal layout. I would like to have a completely standalone HTML page.
I just ran into this problem myself, and the way I solved it was to simply include the html file in my source/_static folder, then refer to it with a relative link.
So if source/_static/my_standalone.htm is the path where I have my non-generated HTML file, and the .rst file where I want to type my link is at source/otherfolder/index.rst, I write it like this in my rst:
Link to my non-Sphinx HTML file
===============================
To get to my standalone, non-generated HTML file,
just `click here <../_static/my_standalone.html>`_ now!
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'm using github pages for my site.
I generate my pages from markdown to html using the built in Jekyll support.
The built in markdown renderer rdiscount does handle tripple backtick codeblocks.
but it just applies the language as a css class on the <pre>
What should I do to get Jekyll to highlight code on page generation?
I've also tried to copy all stuff from octopress, but whith no luck, the codeblocks still come out with a css class only.