After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771975 - Integrate Emmet
Integrate Emmet
Status: RESOLVED OBSOLETE
Product: gnome-builder
Classification: Other
Component: html
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-26 05:40 UTC by wb9688
Modified: 2018-01-11 10:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
HTML snippets (13.82 KB, patch)
2016-09-28 17:16 UTC, wb9688
none Details | Review
HTML snippets v2 (13.08 KB, patch)
2016-09-29 15:32 UTC, wb9688
needs-work Details | Review

Description wb9688 2016-09-26 05:40:52 UTC
Hi, I'm a webdev and I enjoy using GNOME Builder.

I'd love it, when [Emmet](http://emmet.io/) was integrated into GNOME Builder's HTML editor, because it allows me to write my HTML faster.

Thanks!
Comment 1 Alexandre Franke 2016-09-26 07:48:05 UTC
Builder already has code completion and a snippet system that works for any language, not just HTML/CSS. I don't really see what Emmet would bring that we can't already do. The issue is that we don't have HTML or CSS snippets.

Would you be interest in writing some?
Comment 2 sébastien lafargue 2016-09-26 07:59:28 UTC
We also want to add a snippets editor to ease snippets creation and management
Comment 3 wb9688 2016-09-26 10:13:45 UTC
(In reply to Alexandre Franke from comment #1)
> Builder already has code completion and a snippet system that works for any
> language, not just HTML/CSS. I don't really see what Emmet would bring that
> we can't already do. The issue is that we don't have HTML or CSS snippets.
> 
> Would you be interest in writing some?

With Emmet you can do something like `.row>.col-md-3*4`, which isn't possible with normal snippets AFAIK. Yes, I'm interested in writing snippets for both HTML and CSS, but is there any documentation about writing snippets?
Comment 4 sébastien lafargue 2016-09-26 10:33:16 UTC
not really, just take a look at existing ones

links that can help;

https://git.gnome.org/browse/gnome-builder/tree/data/snippets

https://wiki.gnome.org/Apps/Builder/Planning/Snippets
Comment 5 wb9688 2016-09-28 11:15:24 UTC
(In reply to sébastien lafargue from comment #4)
> not really, just take a look at existing ones
> 
> links that can help;
> 
> https://git.gnome.org/browse/gnome-builder/tree/data/snippets
> 
> https://wiki.gnome.org/Apps/Builder/Planning/Snippets

OK, so I made snippets for HTML closely matching Emmet's snippets. How can I get them into GNOME Builder? You can view my HTML snippets [here](http://pastebin.com/TJ8ifzDN).
Comment 6 sébastien lafargue 2016-09-28 14:58:25 UTC
to get them into builder you need to use git and do a patch
Comment 7 sébastien lafargue 2016-09-28 15:03:43 UTC
If it looks complicated to you, i can do it this time.
But at least can you attach the file in 'Attachments' here please,so i could easily review it.
Comment 8 wb9688 2016-09-28 15:06:40 UTC
(In reply to sébastien lafargue from comment #6)
> to get them into builder you need to use git and do a patch

OK, I'm new to GNOME's source, so how'd I do that? I know how to use Git. Do I need to make an account somewhere? Does GNOME work with pull requests or something?

(In reply to sébastien lafargue from comment #7)
> If it looks complicated to you, i can do it this time.
> But at least can you attach the file in 'Attachments' here please,so i could
> easily review it.

Thanks, but I wanna learn how to do it myself…
Comment 9 sébastien lafargue 2016-09-28 15:16:44 UTC
You need to install the master branch of builder with either jhbuild or by cloning the git repo ( https://git.gnome.org/browse/gnome-builder )

In this case ( a snippet file), you don't even need to build anything, it's just a file dropped into the snippet directory
(https://git.gnome.org/browse/gnome-builder/tree/data/snippets)

then : 

git format-patch --keep-subject HEAD~1

you can also use git-bz (https://blog.fishsoup.net/2008/11/16/git-bz-bugzilla-subcommand-for-git/) to attach the patch or doing it man ually.

some infos here:

https://wiki.gnome.org/Newcomers/CodeContributionWorkflow

A gnome git ssh account is needed only for pushing back your accepted changes but we can do it for you
Comment 10 sébastien lafargue 2016-09-28 15:18:37 UTC
oh, like here: https://git.gnome.org/browse/gnome-builder/commit/?id=1979e97e1ae77a1de13071d731610bd54e06feb9

you need the add the snippet file to libide/resources/libide.gresource.xml
Comment 11 wb9688 2016-09-28 17:16:05 UTC
Created attachment 336460 [details] [review]
HTML snippets
Comment 12 wb9688 2016-09-28 17:17:34 UTC
(In reply to sébastien lafargue from comment #9)
> You need to install the master branch of builder with either jhbuild or by
> cloning the git repo ( https://git.gnome.org/browse/gnome-builder )
> 
> In this case ( a snippet file), you don't even need to build anything, it's
> just a file dropped into the snippet directory
> (https://git.gnome.org/browse/gnome-builder/tree/data/snippets)
> 
> then : 
> 
> git format-patch --keep-subject HEAD~1
> 
> you can also use git-bz
> (https://blog.fishsoup.net/2008/11/16/git-bz-bugzilla-subcommand-for-git/)
> to attach the patch or doing it man ually.
> 
> some infos here:
> 
> https://wiki.gnome.org/Newcomers/CodeContributionWorkflow
> 
> A gnome git ssh account is needed only for pushing back your accepted
> changes but we can do it for you

OK, I've added a patch containing the HTML snippets…
Comment 13 Alexandre Franke 2016-09-28 17:59:53 UTC
Review of attachment 336460 [details] [review]:

::: data/snippets/html.snippets
@@ +567,3 @@
+snippet cmd
+- scope html
+	<command>$0

No closing tag? Also command is obsolete and menuitem should be used instead.
Comment 14 wb9688 2016-09-28 18:09:28 UTC
(In reply to Alexandre Franke from comment #13)
> Review of attachment 336460 [details] [review] [review]:
> 
> ::: data/snippets/html.snippets
> @@ +567,3 @@
> +snippet cmd
> +- scope html
> +	<command>$0
> 
> No closing tag? Also command is obsolete and menuitem should be used instead.

A <command> tag doesn't need a closing tag, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/command. Btw I know it's obsolete in favor of <menuitem>, but I just used Emmet's snippets, which is still containing <command>, I can remove it if you want…
Comment 15 Alexandre Franke 2016-09-28 18:33:12 UTC
(In reply to wb9688 from comment #14)
> which is still containing <command>, I can remove it if you want…

In Builder we try to promote current best practices and discourage use of obsolete technology. So please do remove it and if you can try to implement menuitem.

I only looked briefly at the patch, so I don't know if there's any other instances of such obsolete tags. If you know of any, please try to replace them with their newer counterparts.
Comment 16 wb9688 2016-09-29 15:32:36 UTC
Created attachment 336529 [details] [review]
HTML snippets v2
Comment 17 wb9688 2016-09-29 15:33:12 UTC
(In reply to Alexandre Franke from comment #15)
> (In reply to wb9688 from comment #14)
> > which is still containing <command>, I can remove it if you want…
> 
> In Builder we try to promote current best practices and discourage use of
> obsolete technology. So please do remove it and if you can try to implement
> menuitem.
> 
> I only looked briefly at the patch, so I don't know if there's any other
> instances of such obsolete tags. If you know of any, please try to replace
> them with their newer counterparts.

OK, I've attached a new patch where I've removed every deprecated an obsolete tag. I've manually checked every tag on MDN.
Comment 18 Alexandre Franke 2016-09-29 20:08:51 UTC
Review of attachment 336529 [details] [review]:

::: data/snippets/html.snippets
@@ +367,3 @@
+- scope html
+	<button type="submit">$0</button>
+snippet button:s

The "button:submit" snippet will appear as a suggestion when you type "button:s", so what's the point of having a "button:s" snippet that does the same thing? That will only add one more entry in the suggestion list and potentially confuse the user. Unless I'm missing something?

There is a bunch of others, like button:r, button:d…

@@ +442,3 @@
+- scope html
+	<colgroup>$0</colgroup>
+snippet optg

Same as for the button:? snippets.

@@ +454,3 @@
+- scope html
+	<legend>$0</legend>
+snippet sect

Here too.

@@ +460,3 @@
+- scope html
+	<section>$0</section>
+snippet art

Here too.

@@ +496,3 @@
+- scope html
+	<strong>$0</strong>
+snippet prog

Here too.

@@ +508,3 @@
+- scope html
+	<main>$0</main>
+snippet tem

Here too.

@@ +520,3 @@
+- scope html
+	<datalist>$0</datalist>
+snippet out

Here too.

@@ +526,3 @@
+- scope html
+	<output>$0</output>
+snippet det

Here too.
Comment 19 wb9688 2016-09-30 04:34:53 UTC
(In reply to Alexandre Franke from comment #18)
> Review of attachment 336529 [details] [review] [review]:
> 
> ::: data/snippets/html.snippets
> @@ +367,3 @@
> +- scope html
> +	<button type="submit">$0</button>
> +snippet button:s
> 
> The "button:submit" snippet will appear as a suggestion when you type
> "button:s", so what's the point of having a "button:s" snippet that does the
> same thing? That will only add one more entry in the suggestion list and
> potentially confuse the user. Unless I'm missing something?
> 
> There is a bunch of others, like button:r, button:d…
> 
> @@ +442,3 @@
> +- scope html
> +	<colgroup>$0</colgroup>
> +snippet optg
> 
> Same as for the button:? snippets.
> 
> @@ +454,3 @@
> +- scope html
> +	<legend>$0</legend>
> +snippet sect
> 
> Here too.
> 
> @@ +460,3 @@
> +- scope html
> +	<section>$0</section>
> +snippet art
> 
> Here too.
> 
> @@ +496,3 @@
> +- scope html
> +	<strong>$0</strong>
> +snippet prog
> 
> Here too.
> 
> @@ +508,3 @@
> +- scope html
> +	<main>$0</main>
> +snippet tem
> 
> Here too.
> 
> @@ +520,3 @@
> +- scope html
> +	<datalist>$0</datalist>
> +snippet out
> 
> Here too.
> 
> @@ +526,3 @@
> +- scope html
> +	<output>$0</output>
> +snippet det
> 
> Here too.

OK, I'll remove the duplicates, but what should I do with `input` and `inp`? They aren't exactly the same…
Comment 20 Alexandre Franke 2016-09-30 08:35:40 UTC
Oh it slipped my attention. You should keep both, as they indeed don't do the same thing.

I'm a bit worried though about how the user will choose the appropriate snippet.
Comment 21 Alexandre Franke 2017-01-19 10:46:18 UTC
Any chance of an updated patch?
Comment 22 GNOME Infrastructure Team 2018-01-11 10:11:10 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-builder/issues/144.