docs: Add Setup page

This commit is contained in:
James Westman 2021-10-27 12:59:48 -05:00
parent c443009261
commit c576fdf211
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
2 changed files with 57 additions and 6 deletions

View file

@ -1,14 +1,12 @@
gtk-blueprint-tool
==================
Overview
========
.. title:: Overview
gtk-blueprint-tool is a markup language and compiler for GTK 4 user interfaces.
.. toctree::
:hidden:
:maxdepth: 1
:caption: Contents:
setup
examples
gtk-blueprint-tool is a markup language and compiler for GTK user interfaces.

53
docs/setup.rst Normal file
View file

@ -0,0 +1,53 @@
=====
Setup
=====
Use gtk-blueprint-tool in your project
--------------------------------------
gtk-blueprint-tool works as a meson subproject.
#. Save the following file as ``subprojects/gtk-blueprint-tool.wrap``:
.. code-block:: cfg
[wrap-git]
directory = gtk-blueprint-tool
url = https://gitlab.gnome.org/jwestman/gtk-blueprint-tool.git
revision = main
depth = 1
[provide]
program_names = gtk-blueprint-tool
#. Add this to your ``.gitignore``:
.. code-block::
/subprojects/gtk-blueprint-tool
#. Add this to the ``meson.build`` file where you build your GResources:
.. code-block:: meson.build
blueprints = custom_target('blueprints',
input: files(
# LIST YOUR BLUEPRINT FILES HERE
),
output: '.',
command: [find_program('gtk-blueprint-tool'), 'batch-compile', '@OUTPUT@', '@INPUT@'],
)
#. In the same ``meson.build`` file, add this argument to your ``gnome.compile_resources`` command:
.. code-block:: meson.build
dependencies: blueprints,
#. Convert your .ui XML files to blueprint format. In the future, an automatic
porting tool is planned.
.. warning::
The blueprint compiler flattens the directory structure of the resulting XML
files. You may need to update your ``.gresource.xml`` file to match.