docs: Use correct lexer name for code blocks

This commit is contained in:
James Westman 2023-08-31 14:58:29 -05:00
parent a8512d83f3
commit 0f5be1b051
11 changed files with 37 additions and 37 deletions

View file

@ -22,7 +22,7 @@ Blueprint is a markup language and compiler for GTK 4 user interfaces.
packaging
.. code-block::
.. code-block:: blueprint
using Gtk 4.0;

View file

@ -13,7 +13,7 @@ GObject Introspection
Blueprint files can import GObject Introspection namespaces like this:
.. code-block::
.. code-block:: blueprint
using Gtk 4.0;
using Adw 1;

View file

@ -166,14 +166,14 @@ version_conflict
----------------
This error occurs when two versions of a namespace are imported (possibly transitively) in the same file. For example, this will cause a version conflict:
.. code-block:: blueprintui
.. code-block:: blueprint
using Gtk 4.0;
using Gtk 3.0;
But so will this:
.. code-block:: blueprintui
.. code-block:: blueprint
using Gtk 4.0;
using Handy 1;

View file

@ -17,7 +17,7 @@ A blueprint document consists of a :ref:`GTK declaration<Syntax GtkDecl>`, one s
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
// Gtk Declaration
using Gtk 4.0;
@ -43,7 +43,7 @@ Every blueprint file begins with the line ``using Gtk 4.0;``, which declares the
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
using Gtk 4.0;
@ -68,7 +68,7 @@ The compiler requires typelib files for these libraries to be installed. They ar
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
// Import libadwaita
using Adw 1;

View file

@ -6,7 +6,7 @@ Expressions make your user interface code *reactive*. This means when your
application's data changes, the user interface reacts to the change
automatically.
.. code-block:: blueprintui
.. code-block:: blueprint
label: bind MyAppWindow.account.username;
/* ^ ^ ^
@ -81,7 +81,7 @@ Cast Expressions
Cast expressions allow Blueprint to know the type of an expression when it can't otherwise determine it.
.. code-block:: blueprintui
.. code-block:: blueprint
// Cast the result of the closure so blueprint knows it's a string
label: bind $my_closure() as <string>

View file

@ -78,7 +78,7 @@ Valid in `Adw.MessageDialog <https://gnome.pages.gitlab.gnome.org/libadwaita/doc
The ``responses`` block defines the buttons that will be added to the dialog. The ``destructive`` or ``suggested`` flag sets the appearance of the button, and the ``disabled`` flag can be used to disable the button.
.. code-block:: blueprintui
.. code-block:: blueprint
using Adw 1;
@ -106,7 +106,7 @@ Valid in `Gtk.ComboBoxText <https://docs.gtk.org/gtk4/class.ComboBoxText.html>`_
The ``items`` block defines the items that will be added to the combo box. The optional ID can be used to refer to the item rather than its label.
.. code-block:: blueprintui
.. code-block:: blueprint
ComboBoxText {
items [
@ -133,7 +133,7 @@ Valid in `Gtk.FileFilter <https://docs.gtk.org/gtk4/class.FileFilter.html>`_.
The ``mime-types``, ``patterns``, and ``suffixes`` blocks define the items that will be added to the file filter. The ``mime-types`` block accepts mime types (including wildcards for subtypes, such as ``image/*``). The ``patterns`` block accepts glob patterns, and the ``suffixes`` block accepts file extensions.
.. code-block:: blueprintui
.. code-block:: blueprint
FileFilter {
mime-types [ "text/plain", "image/*" ]
@ -156,7 +156,7 @@ Valid in `Gtk.Widget <https://docs.gtk.org/gtk4/class.Widget.html>`_.
The ``layout`` block describes how the widget should be positioned within its parent. The available properties depend on the parent widget's layout manager.
.. code-block:: blueprintui
.. code-block:: blueprint
Grid {
Button {
@ -196,7 +196,7 @@ The ``template`` block defines the template that will be used to create list ite
The template type must be `Gtk.ListItem <https://docs.gtk.org/gtk4/class.ListItem.html>`_. The template object can be referenced with the ``template`` keyword.
.. code-block:: blueprintui
.. code-block:: blueprint
ListView {
factory: BuilderListItemFactory {
@ -244,7 +244,7 @@ Valid in `Gtk.SizeGroup <https://docs.gtk.org/gtk4/class.SizeGroup.html>`_.
The ``widgets`` block defines the widgets that will be added to the size group.
.. code-block:: blueprintui
.. code-block:: blueprint
Box {
Button button1 {}
@ -270,7 +270,7 @@ Valid in `Gtk.StringList <https://docs.gtk.org/gtk4/class.StringList.html>`_.
The ``strings`` block defines the strings in the string list.
.. code-block:: blueprintui
.. code-block:: blueprint
StringList {
strings ["violin", "guitar", _("harp")]
@ -291,7 +291,7 @@ Valid in any `Gtk.Widget <https://docs.gtk.org/gtk4/class.Widget.html>`_.
The ``styles`` block defines CSS classes that will be added to the widget.
.. code-block:: blueprintui
.. code-block:: blueprint
Button {
styles ["suggested-action"]
@ -327,7 +327,7 @@ The ``action response`` extension sets the ``action`` child type for the child a
No more than one child of a dialog or infobar may have the ``default`` flag.
.. code-block:: blueprintui
.. code-block:: blueprint
Dialog {
[action response=ok default]

View file

@ -21,7 +21,7 @@ Menus, such as the application menu, are defined using the ``menu`` keyword. Men
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
menu my_menu {
submenu {
@ -53,7 +53,7 @@ The most common menu attributes are ``label``, ``action``, and ``icon``. Because
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
menu {
item ("label")

View file

@ -24,7 +24,7 @@ Optionally, objects may have an ID to provide a handle for other parts of the bl
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
Label label1 {
label: "Hello, world!";
@ -69,7 +69,7 @@ A property's value can be another object, either inline or referenced by ID.
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
Label {
label: "text";
@ -102,7 +102,7 @@ Optionally, you can provide an object ID to use when connecting the signal.
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
Button {
clicked => $on_button_clicked();
@ -141,7 +141,7 @@ Examples
Add children to a container
+++++++++++++++++++++++++++
.. code-block:: blueprintui
.. code-block:: blueprint
Button {
Image {}
@ -150,7 +150,7 @@ Add children to a container
Child types
+++++++++++
.. code-block:: blueprintui
.. code-block:: blueprint
HeaderBar {
[start]
@ -165,7 +165,7 @@ Child types
Child extensions
++++++++++++++++
.. code-block:: blueprintui
.. code-block:: blueprint
Dialog {
// Here, a child extension annotation defines the button's response.
@ -176,7 +176,7 @@ Child extensions
Internal children
+++++++++++++++++
.. code-block:: blueprintui
.. code-block:: blueprint
Dialog {
[internal-child content_area]

View file

@ -15,7 +15,7 @@ Widget subclassing is one of the primary techniques for structuring an applicati
You could implement this with the following blueprint:
.. code-block:: blueprintui
.. code-block:: blueprint
using Gtk 4.0;
@ -39,7 +39,7 @@ We can solve these problems by giving each widget its own blueprint file, which
For this to work, we need to specify in the blueprint which object is the one being instantiated. We do this with a template block:
.. code-block:: blueprintui
.. code-block:: blueprint
using Gtk 4.0;
@ -56,7 +56,7 @@ This blueprint can only be used by the ``MapsHeaderBar`` constructor. Instantiat
This ``MapsHeaderBar`` class, along with its blueprint template, can then be referenced in another blueprint:
.. code-block:: blueprintui
.. code-block:: blueprint
using Gtk 4.0;

View file

@ -45,7 +45,7 @@ The type of a ``typeof<>`` literal is `GType <https://docs.gtk.org/gobject/alias
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
Gio.ListStore {
item-type: typeof<GObject.Object>;
@ -66,7 +66,7 @@ Flags are used to specify a set of options. One or more of the available flag va
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
Adw.TabView {
shortcuts: control_tab | control_shift_tab;
@ -85,7 +85,7 @@ Translated Strings
Use ``_("...")`` to mark strings as translatable. You can put a comment for translators on the line above if needed.
.. code-block:: blueprintui
.. code-block:: blueprint
Gtk.Label label {
/* Translators: This is the main text of the welcome screen */
@ -94,7 +94,7 @@ Use ``_("...")`` to mark strings as translatable. You can put a comment for tran
Use ``C_("context", "...")`` to add a *message context* to a string to disambiguate it, in case the same string appears in different places. Remember, two strings might be the same in one language but different in another depending on context.
.. code-block:: blueprintui
.. code-block:: blueprint
Gtk.Label label {
/* Translators: This is a section in the preferences window */
@ -118,7 +118,7 @@ The simplest bindings connect to a property of another object in the blueprint.
Example
~~~~~~~
.. code-block:: blueprintui
.. code-block:: blueprint
/* Use bindings to show a label when a switch
* is active, without any application code */

View file

@ -5,7 +5,7 @@ Translations
Blueprint files can be translated with xgettext. To mark a string as translated,
use the following syntax:
.. code-block::
.. code-block:: blueprint
_("translated string")
@ -34,7 +34,7 @@ conflicts. Two strings that are the same in English, but appear in different
contexts, might be different in another language! To disambiguate, use ``C_``
instead of ``_`` and add a context string as the first argument:
.. code-block::
.. code-block:: blueprint
C_("shortcuts window", "Quit")