Markdown produces nicer output where supported, so use that instead of custom ASCII formatting.
32 lines
1.2 KiB
Markdown
32 lines
1.2 KiB
Markdown
## Creating a New Extension
|
|
|
|
To create a new extension, add a subdirectory in extensions.
|
|
Then create a Makefile.am like the one in example, replacing
|
|
the EXTENSION_ID with the basename of your extension, which
|
|
must match the UUID in metadata.json.
|
|
If you need additional files, add them to EXTENSION_EXTRA.
|
|
|
|
Then modify extensions/Makefile.am and configure.ac. It should
|
|
be pretty self-explanatory.
|
|
|
|
Don't forget to add any translatable file to po/POTFILES.in, and
|
|
then you're done.
|
|
The Gettext domain you should choose is gnome-shell-extensions,
|
|
not gnome-shell, unless you're sure there is the string you
|
|
need in gnome-shell.
|
|
|
|
## Coding Style
|
|
|
|
Generally, we follow [GJS coding style][coding-style], which in short is:
|
|
indent 4 spaces, no tabs, space after comma, no space after function call.
|
|
|
|
The Emacs mode line for this
|
|
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
|
|
Imports should be at the top, in two groups, one for standard
|
|
imports (like imports.lang or imports.dbus) and introspection,
|
|
the other for Shell API. Within the same group, put everything
|
|
in alphabetic order.
|
|
|
|
[coding-style]: https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Style_Guide.md
|