diff --git a/docs/index.rst b/docs/index.rst index e277add..06547c2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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; diff --git a/docs/packaging.rst b/docs/packaging.rst index 4f248e6..78bb2c2 100644 --- a/docs/packaging.rst +++ b/docs/packaging.rst @@ -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; diff --git a/docs/reference/diagnostics.rst b/docs/reference/diagnostics.rst index b8fee83..2c0af59 100644 --- a/docs/reference/diagnostics.rst +++ b/docs/reference/diagnostics.rst @@ -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; diff --git a/docs/reference/document_root.rst b/docs/reference/document_root.rst index af5357d..13dea58 100644 --- a/docs/reference/document_root.rst +++ b/docs/reference/document_root.rst @@ -17,7 +17,7 @@ A blueprint document consists of a :ref:`GTK declaration`, 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; diff --git a/docs/reference/expressions.rst b/docs/reference/expressions.rst index 042aec7..1ba50ee 100644 --- a/docs/reference/expressions.rst +++ b/docs/reference/expressions.rst @@ -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 \ No newline at end of file diff --git a/docs/reference/extensions.rst b/docs/reference/extensions.rst index fb5a46b..9675038 100644 --- a/docs/reference/extensions.rst +++ b/docs/reference/extensions.rst @@ -78,7 +78,7 @@ Valid in `Adw.MessageDialog `_ 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 `_. 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 `_. 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 `_. 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 `_. 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 `_. 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 `_. 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] diff --git a/docs/reference/menus.rst b/docs/reference/menus.rst index 525458b..2d7bfea 100644 --- a/docs/reference/menus.rst +++ b/docs/reference/menus.rst @@ -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") diff --git a/docs/reference/objects.rst b/docs/reference/objects.rst index fe4d1a7..699db49 100644 --- a/docs/reference/objects.rst +++ b/docs/reference/objects.rst @@ -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] diff --git a/docs/reference/templates.rst b/docs/reference/templates.rst index fa4c264..180979f 100644 --- a/docs/reference/templates.rst +++ b/docs/reference/templates.rst @@ -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; diff --git a/docs/reference/values.rst b/docs/reference/values.rst index 035408f..a50293d 100644 --- a/docs/reference/values.rst +++ b/docs/reference/values.rst @@ -45,7 +45,7 @@ The type of a ``typeof<>`` literal is `GType ; @@ -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 */ diff --git a/docs/translations.rst b/docs/translations.rst index b143d36..7ebf929 100644 --- a/docs/translations.rst +++ b/docs/translations.rst @@ -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")