Add Blueprint language (#8001) · github-linguist/linguist@50bf308 · GitHub
Skip to content

Commit 50bf308

Browse files
kaypeslildudeAlhadis
authored
Add Blueprint language (#8001)
* Add Blueprint language - Register Blueprint in languages.yml (language_id: 765545512) - Add blueprint-grammar submodule (source.blueprint-gtk) - Add grammars.yml entry - Add 2 sample .blp files - Aliases: blueprint, blp - Extension: .blp - Color: #3584E4 (Adwaita default) * Update vendor/README.md with Blueprint grammar entry * Add license cache for il-assembly-grammar submodule * Update Blueprint grammar to fix license issue Swapped the LGPL grammar for a new custom MIT one. * Change Blueprint tm_scope to source.blueprint Updated languages.yml to match the cleaner scope of the new custom grammar. * Apply suggestion from @lildude * Fix Blueprint submodule alphabetical position * Add ace_mode to Blueprint lang * Update Blueprint grammar repository reference * Update git_submodule * Obliterate all traces of the current submodule * Register grammar properly using `add-grammar` script --------- Co-authored-by: Colin Seymour <colin@github.com> Co-authored-by: Alhadis <gardnerjohng@gmail.com>
1 parent 3d6f1a5 commit 50bf308

8 files changed

Lines changed: 158 additions & 0 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions

grammars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ vendor/grammars/bikeshed:
298298
- source.csswg
299299
vendor/grammars/blitzmax:
300300
- source.blitzmax
301+
vendor/grammars/blueprint-grammar:
302+
- source.blueprint
301303
vendor/grammars/boogie-vscode:
302304
- source.boogie
303305
vendor/grammars/bqn-vscode:

lib/linguist/languages.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,16 @@ BlitzMax:
719719
tm_scope: source.blitzmax
720720
ace_mode: text
721721
language_id: 35
722+
Blueprint:
723+
type: markup
724+
color: "#3584E4"
725+
extensions:
726+
- ".blp"
727+
aliases:
728+
- blp
729+
tm_scope: source.blueprint
730+
ace_mode: text
731+
language_id: 765545512
722732
Bluespec:
723733
type: programming
724734
color: "#12223c"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
using Gtk 4.0;
2+
using Adw 1;
3+
4+
template $CounterWindow : Adw.ApplicationWindow {
5+
default-width: 400;
6+
default-height: 400;
7+
width-request: 300;
8+
title: _("Counter Example");
9+
10+
Adw.ToolbarView {
11+
12+
[top]
13+
Adw.HeaderBar {
14+
// Empty HeaderBar, just for window dragging
15+
}
16+
17+
Gtk.Box {
18+
orientation: vertical;
19+
halign: center;
20+
valign: center;
21+
spacing: 48;
22+
23+
Gtk.Frame {
24+
width-request: 220;
25+
height-request: 180;
26+
27+
Gtk.Label counter_label {
28+
use-markup: true;
29+
label: "<span font=\"80\" weight=\"bold\">0 ×</span>";
30+
31+
halign: center;
32+
valign: center;
33+
}
34+
}
35+
36+
Gtk.Box {
37+
orientation: horizontal;
38+
halign: center;
39+
spacing: 16;
40+
41+
Gtk.Button decrement_button {
42+
icon-name: "list-remove-symbolic";
43+
tooltip-text: _("Decrease");
44+
styles ["circular"]
45+
clicked => $on_decrement_clicked();
46+
}
47+
48+
Gtk.Button increment_button {
49+
icon-name: "list-add-symbolic";
50+
tooltip-text: _("Increase");
51+
styles ["circular", "suggested-action"]
52+
clicked => $on_increment_clicked();
53+
}
54+
}
55+
}
56+
}
57+
}

samples/Blueprint/sign_in.blp

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using Gtk 4.0;
2+
using Adw 1;
3+
4+
template $Login : Adw.ApplicationWindow {
5+
default-width: 450;
6+
default-height: 550;
7+
width-request: 360;
8+
title: _("Tabella");
9+
10+
Adw.ToastOverlay toast_overlay {
11+
12+
Adw.ToolbarView {
13+
14+
[top]
15+
Adw.HeaderBar {
16+
// Empty HeaderBar, just for window dragging
17+
}
18+
19+
Adw.StatusPage {
20+
title: _("Welcome Back");
21+
description: _("Sign in to your account");
22+
icon-name: "avatar-default-symbolic";
23+
24+
Adw.Clamp {
25+
maximum-size: 320;
26+
27+
Gtk.Box {
28+
orientation: vertical;
29+
spacing: 24;
30+
31+
Adw.PreferencesGroup {
32+
title: _("Credentials");
33+
34+
Adw.EntryRow username_entry {
35+
title: _("Username");
36+
}
37+
38+
Adw.PasswordEntryRow password_entry {
39+
title: _("Password");
40+
}
41+
}
42+
43+
Gtk.Button login_button {
44+
label: _("Sign In");
45+
styles ["suggested-action", "pill"]
46+
clicked => $on_login_clicked();
47+
}
48+
}
49+
}
50+
}
51+
}
52+
}
53+
}

vendor/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
6969
- **Blade:** [jawee/language-blade](https://github.com/jawee/language-blade)
7070
- **BlitzBasic:** [textmate/blitzmax.tmbundle](https://github.com/textmate/blitzmax.tmbundle)
7171
- **BlitzMax:** [textmate/blitzmax.tmbundle](https://github.com/textmate/blitzmax.tmbundle)
72+
- **Blueprint:** [kaypes/blueprint-grammar](https://github.com/kaypes/blueprint-grammar)
7273
- **Bluespec:** [thotypous/sublime-bsv](https://github.com/thotypous/sublime-bsv)
7374
- **Bluespec BH:** [B-Lang-org/language-bh](https://github.com/B-Lang-org/language-bh)
7475
- **Boo:** [drslump/sublime-boo](https://github.com/drslump/sublime-boo)

vendor/grammars/blueprint-grammar

Submodule blueprint-grammar added at e116f22
Lines changed: 31 additions & 0 deletions

0 commit comments

Comments
 (0)