This Jetbrains plugin is currently somewhat experimental. What it does it allows you to turn an emmet expression into HTML, or XML. If your emmet expression starts at the beginning of the line (excluding typical white-space characters), then it will expand multiline, otherwise inline.
Currently you need to install xemmet on your system, it does not come bundled with the extension!
Xemmet is more or less a dialect of Emmet, which is a markup language for expanding CSS rules into HTML. (docs, cheatsheet)
How is Xemmet different from Emmet?
Perhaps most importantly, Xemmet does not - and likely will not - provide a lot of browser behaviour features that Emmet promises to provide, such as selection manipulation features, etc. Nor is it planned to provide features for writing .css files.
While it may change, Xemmet currently does not provide the implicit tag names feature.
Finally, it targets multiple formats. XML and HTML should be quite obvious, but there's also a specific one for using HTMX and Templ together. See the HTMX section below for details.
- Ctrl+Alt+H - Translate Xemmet expression to HTML.
- Ctrl+Alt+X - Translate Xemmet expression to XML.
- Ctrl+Alt+0 - Translate Xemmet expression to HTMX for Templ.
While the HTML and XML generation is likely straight-forward.
Xemmet and XemmetJB have two primary modes: inline and multiline. XemmetJB will try to guess which one to used based on the position of the Xemmet expression. XemmetJB will try to figure out if the template is itself multiline, or if the xemmet expression is the first thing (other than spaces and tabs) on the line. If either is true, the response will be multiline, otherwise inline.
The following would be considered inline, if xemmet was triggered with cursor being at the end of the line:
# This is an example a
If triggered with HTML target, it would turn into the following:
# This is an example <a href="#"></a>
Given an XML trigger, it would turn into the following:
# This is an example <a/>
Why? because if is not a recognized XML tag with standard properties.
If the target would HTMX, the result would look like this:
# This is an example <a/>
The following would be considered multiline, if xemmet was triggered with cursor being at the end of the line:
p>br
If triggered with HTML target, it would turn into the following:
<p>
<br>
</p>
Given an XML trigger, it would turn into the following:
<p>
<br />
</p>
If the target would HTMX, the result would be the same as for XML, because templ requires XML-like short tags to work properly.
- Create a new IntelliJ Platform Plugin Template project.
- Get familiar with the template documentation.
- Adjust the pluginGroup, plugin ID and sources package.
- Adjust the plugin description in
README
(see Tips) - Review the Legal Agreements.
- Publish a plugin manually for the first time.
- Set the
PLUGIN_ID
in the above README badges. - Set the Plugin Signing related secrets.
- Set the Deployment Token.
- Click the Watch button on the top of the IntelliJ Platform Plugin Template to be notified about releases containing new features and fixes.
This Fancy IntelliJ Platform Plugin is going to be your implementation of the brilliant ideas that you have.
This specific section is a source for the plugin.xml file which will be extracted by the Gradle during the build process.
To keep everything working, do not remove <!-- ... -->
sections.
-
Using the IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "xemmetjb" > Install
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
Plugin based on the IntelliJ Platform Plugin Template.