[gtk/ebassi/gidocgen: 2/3] Generate GTK API reference(s) with gi-docgen




commit 0298274811162f81ca13e303ad7de6311a71240f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Feb 10 13:41:53 2021 +0000

    Generate GTK API reference(s) with gi-docgen
    
    Stop using gtk-doc, and switch to gi-docgen.
    
    The gi-docgen tool generates API references through the introspection
    data, which has various benefits:
    
     - it does not parse C code
     - it does not generate and run C code to introspect types at build time
     - it does not present a different API from the one we're exporting
    
    Additionally, gi-docgen:
    
     - does not generate DocBook XML in order to generate HTML
     - does not go through xsltproc
     - parses proper Markdown
    
    Which makes it markedly faster than gtk-doc has ever been.

 docs/reference/gdk/meson.build |  25 ---
 docs/reference/gsk/meson.build |  28 ----
 docs/reference/gtk/gtk.toml    | 224 +++++++++++++++++++++++++
 docs/reference/gtk/meson.build | 369 ++---------------------------------------
 docs/reference/meson.build     |   2 +
 meson.build                    |   7 +-
 6 files changed, 242 insertions(+), 413 deletions(-)
---
diff --git a/docs/reference/gdk/meson.build b/docs/reference/gdk/meson.build
index cdd018def9..36b7e97003 100644
--- a/docs/reference/gdk/meson.build
+++ b/docs/reference/gdk/meson.build
@@ -162,29 +162,4 @@ if wayland_enabled
 endif
 
 if get_option('gtk_doc')
-  configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
-
-  gnome.gtkdoc('gdk4',
-    mode: 'none',
-    main_xml: 'gdk4-docs.xml',
-    src_dir: src_dir,
-    dependencies: libgtk_dep,
-    gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk4.types'),
-    scan_args: [
-      '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
-      '--ignore-headers=' + ' '.join(private_headers),
-    ],
-    mkdb_args: [
-      '--ignore-files=' + ' '.join(private_headers),
-    ],
-    fixxref_args: [
-      '--html-dir=@0@'.format(docpath),
-      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
-      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
-      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
-      '--extra-dir=@0@'.format(cairo_docpath),
-    ],
-    html_assets: images,
-    install: true,
-  )
 endif
diff --git a/docs/reference/gsk/meson.build b/docs/reference/gsk/meson.build
index bf54aa1dcb..bdabb494c9 100644
--- a/docs/reference/gsk/meson.build
+++ b/docs/reference/gsk/meson.build
@@ -60,32 +60,4 @@ images = [
 ]
 
 if get_option('gtk_doc')
-  configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
-
-  gnome.gtkdoc('gsk4',
-    mode: 'none',
-    main_xml: 'gsk4-docs.xml',
-    src_dir: [
-      gskinc,
-    ],
-    dependencies: libgtk_dep,
-    gobject_typesfile: join_paths(meson.current_source_dir(), 'gsk4.types'),
-    scan_args: [
-      '--ignore-decorators=_GDK_EXTERN',
-      '--ignore-headers=' + ' '.join(private_headers),
-    ],
-    mkdb_args: [
-      '--ignore-files=' + ' '.join(private_headers),
-    ],
-    fixxref_args: [
-      '--html-dir=@0@'.format(docpath),
-      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
-      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
-      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
-      '--extra-dir=@0@'.format(cairo_docpath),
-      '--extra-dir=../gdk',
-    ],
-    html_assets: images,
-    install: true,
-  )
 endif
diff --git a/docs/reference/gtk/gtk.toml b/docs/reference/gtk/gtk.toml
new file mode 100644
index 0000000000..262ad2ac68
--- /dev/null
+++ b/docs/reference/gtk/gtk.toml
@@ -0,0 +1,224 @@
+[library]
+namespace = "Gtk"
+version = "4.0"
+browse_url = "https://gitlab.gnome.org/GNOME/gtk/";
+repository_url = "https://gitlab.gnome.org/GNOME/gtk.git";
+website_url = "https://www.gtk.org";
+authors = "GTK Development Team"
+logo_url = "https://www.gtk.org/";
+license = "GPL-2.1-or-later"
+description = "The GTK toolkit"
+dependencies = [ "GObject-2.0", "Graphene-1.0", "Pango-1.0", "Gdk-4.0", "Gsk-4.0" ]
+
+  [dependencies."GObject-2.0"]
+  name = "GObject"
+  description = "The base type system library"
+  docs_url = "https://developer.gnome.org/gobject/stable";
+
+  [dependencies."Graphene-1.0"]
+  name = "Graphene"
+  description = "A thin layer of mathematical types for 3D libraries"
+  docs_url = "https://ebassi.github.io/graphene/docs";
+
+  [dependencies."Pango-1.0"]
+  name = "Pango"
+  description = "Text shaping and rendering"
+  docs_url = "https://developer.gnome.org/pango/stable";
+
+  [dependencies."Gdk-4.0"]
+  name = "GDK"
+  description = "The GTK windowing system abstraction"
+  docs_url = "../../Gdk/4.0/"
+
+  [dependencies."Gsk-4.0"]
+  name = "GSK"
+  description = "The GTK rendering abstraction"
+  docs_url = "../../Gsk/4.0/"
+
+[theme]
+name = "basic"
+
+[source-location]
+base_url = "https://gitlab.gnome.org/GNOME/gtk/-/blob/master/";
+
+[extra]
+# The same order will be used when generating the index
+content_files = [
+  "getting_started.md",
+  "building.md",
+  "compiling.md",
+  "running.md",
+  "question_index.md",
+  "resources.md",
+  "actions.md",
+  "input-handling.md",
+  "drawing-model.md",
+  "css-overview.md",
+  "css-properties.md",
+  "section-accessibility.md",
+  "section-list-widget.md",
+  "section-text-widget.md",
+  "section-tree-widget.md",
+  "migrating-2to4.md",
+  "migrating-3to4.md",
+  "broadway.md",
+  "osx.md",
+  "wayland.md",
+  "windows.md",
+  "x11.md",
+]
+content_images = [
+  'images/aboutdialog.png',
+  'images/action-bar.png',
+  'images/appchooserbutton.png',
+  'images/appchooserdialog.png',
+  'images/arrows.png',
+  'images/assistant.png',
+  'images/background.png',
+  'images/bloatpad-gnome.png',
+  'images/bloatpad-osx.png',
+  'images/bloatpad-xfce.png',
+  'images/border1.png',
+  'images/border2.png',
+  'images/border3.png',
+  'images/box.png',
+  'images/box-expand.png',
+  'images/box-packing.png',
+  'images/builder-shortcuts.png',
+  'images/button.png',
+  'images/calendar.png',
+  'images/capture-bubble.png',
+  'images/centerbox.png',
+  'images/check-button.png',
+  'images/checks.png',
+  'images/clocks-shortcuts.png',
+  'images/color-button.png',
+  'images/colorchooser.png',
+  'images/combo-box-entry.png',
+  'images/combo-box.png',
+  'images/combo-box-text.png',
+  'images/down-center.png',
+  'images/down-end.png',
+  'images/down-start.png',
+  'images/drop-down.png',
+  'images/drawing.png',
+  'images/drawingarea.png',
+  'images/ease-in-out.png',
+  'images/ease-in.png',
+  'images/ease-out.png',
+  'images/ease.png',
+  'images/editable-label.png',
+  'images/emojichooser.png',
+  'images/entry.png',
+  'images/exampleapp.png',
+  'images/expanders.png',
+  'images/expander.png',
+  'images/extensions.png',
+  'images/figure-hierarchical-drawing.png',
+  'images/figure-windowed-label.png',
+  'images/file-button.png',
+  'images/filechooser.png',
+  'images/flow-box.png',
+  'images/focus.png',
+  'images/font-button.png',
+  'images/fontchooser.png',
+  'images/frame-gap.png',
+  'images/frame.png',
+  'images/frames.png',
+  'images/gedit-shortcuts.png',
+  'images/getting-started-app10.png',
+  'images/getting-started-app1.png',
+  'images/getting-started-app2.png',
+  'images/getting-started-app3.png',
+  'images/getting-started-app4.png',
+  'images/getting-started-app6.png',
+  'images/getting-started-app7.png',
+  'images/getting-started-app8.png',
+  'images/getting-started-app9.png',
+  'images/glarea.png',
+  'images/gradient1.png',
+  'images/gradient2.png',
+  'images/gradient3.png',
+  'images/gradient4.png',
+  'images/grid.png',
+  'images/grid-packing.png',
+  'images/handles.png',
+  'images/headerbar.png',
+  'images/hello-world.png',
+  'images/icon-view.png',
+  'images/image.png',
+  'images/info-bar.png',
+  'images/inspector.png',
+  'images/label.png',
+  'images/layout-btlr.png',
+  'images/layout-btrl.png',
+  'images/layout-lrbt.png',
+  'images/layout-lrtb.png',
+  'images/layout-rlbt.png',
+  'images/layout-rltb.png',
+  'images/layout-tblr.png',
+  'images/layout-tbrl.png',
+  'images/left-center.png',
+  'images/left-end.png',
+  'images/left-start.png',
+  'images/levelbar.png',
+  'images/linear.png',
+  'images/link-button.png',
+  'images/list-and-tree.png',
+  'images/list-box.png',
+  'images/lockbutton-locked.png',
+  'images/lock-button.png',
+  'images/lockbutton.png',
+  'images/lockbutton-sorry.png',
+  'images/lockbutton-unlocked.png',
+  'images/media-controls.png',
+  'images/menu.png',
+  'images/menubar.png',
+  'images/menu-button.png',
+  'images/messagedialog.png',
+  'images/multiline-text.png',
+  'images/notebook.png',
+  'images/options.png',
+  'images/overlay.png',
+  'images/pagesetupdialog.png',
+  'images/panes.png',
+  'images/password-entry.png',
+  'images/picture.png',
+  'images/popover.png',
+  'images/printdialog.png',
+  'images/progressbar.png',
+  'images/right-center.png',
+  'images/right-end.png',
+  'images/right-start.png',
+  'images/scales.png',
+  'images/scrollbar.png',
+  'images/scrolledwindow.png',
+  'images/search-bar.png',
+  'images/search-entry.png',
+  'images/separator.png',
+  'images/shortcuts-window.png',
+  'images/sidebar.png',
+  'images/slices.png',
+  'images/sliders.png',
+  'images/spinbutton.png',
+  'images/spinner.png',
+  'images/stack.png',
+  'images/stackswitcher.png',
+  'images/statusbar.png',
+  'images/switch.png',
+  'images/toggle-button.png',
+  'images/toolbar.png',
+  'images/tree-view-coordinates.png',
+  'images/up-center.png',
+  'images/up-end.png',
+  'images/up-start.png',
+  'images/video.png',
+  'images/volumebutton.png',
+  'images/widget-hvalign.png',
+  'images/windowcontrols.png',
+  'images/window-default.png',
+  'images/window.png',
+  'images/rich-list.png',
+  'images/data-table.png',
+  'images/navigation-sidebar.png',
+]
diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build
index a2e28b586f..a87f8054d2 100644
--- a/docs/reference/gtk/meson.build
+++ b/docs/reference/gtk/meson.build
@@ -1,300 +1,3 @@
-fs = import('fs')
-
-private_headers = [
-  'gtkaccelgroupprivate.h',
-  'gtkaccelmapprivate.h',
-  'gtkaccessibleattributesetprivate.h',
-  'gtkaccessibleattributevalueprivate.h',
-  'gtkaccessibleprivate.h',
-  'gtkaccessiblevalueprivate.h',
-  'gtkactionhelperprivate.h',
-  'gtkactionmuxerprivate.h',
-  'gtkactionobservableprivate.h',
-  'gtkactionobserverprivate.h',
-  'gtkadjustmentprivate.h',
-  'gtkallocatedbitmaskprivate.h',
-  'gtkappchooserprivate.h',
-  'gtkapplicationaccelsprivate.h',
-  'gtkapplicationprivate.h',
-  'gtkatcontextprivate.h',
-  'gtkbindingsprivate.h',
-  'gtkbitmaskprivateimpl.h',
-  'gtkbitmaskprivate.h',
-  'gtkbuildableprivate.h',
-  'gtkbuilderprivate.h',
-  'gtkbuilderscopeprivate.h',
-  'gtkbuiltiniconprivate.h',
-  'gtkbuttonprivate.h',
-  'gtkcellareaboxcontextprivate.h',
-  'gtkcheckbuttonprivate.h',
-  'gtkcolorchooserprivate.h',
-  'gtkcoloreditorprivate.h',
-  'gtkcolorpickerkwinprivate.h',
-  'gtkcolorpickerportalprivate.h',
-  'gtkcolorpickerprivate.h',
-  'gtkcolorpickershellprivate.h',
-  'gtkcolorplaneprivate.h',
-  'gtkcolorscaleprivate.h',
-  'gtkcolorswatchprivate.h',
-  'gtkcolumnlistitemfactoryprivate.h',
-  'gtkcolumnviewcellprivate.h',
-  'gtkcolumnviewcolumnprivate.h',
-  'gtkcolumnviewlayoutprivate.h',
-  'gtkcolumnviewprivate.h',
-  'gtkcolumnviewsorterprivate.h',
-  'gtkcolumnviewtitleprivate.h',
-  'gtkcomboboxprivate.h',
-  'gtkcomposetable.h',
-  'gtkconstraintexpressionprivate.h',
-  'gtkconstraintguideprivate.h',
-  'gtkconstraintlayoutprivate.h',
-  'gtkconstraintprivate.h',
-  'gtkconstraintsolverprivate.h',
-  'gtkconstrainttypesprivate.h',
-  'gtkconstraintvflparserprivate.h',
-  'gtkcountingbloomfilterprivate.h',
-  'gtkcssanimatedstyleprivate.h',
-  'gtkcssanimationprivate.h',
-  'gtkcssarrayvalueprivate.h',
-  'gtkcssbgsizevalueprivate.h',
-  'gtkcssbordervalueprivate.h',
-  'gtkcssboxesimplprivate.h',
-  'gtkcssboxesprivate.h',
-  'gtkcsscalcvalueprivate.h',
-  'gtkcsscolorvalueprivate.h',
-  'gtkcsscornervalueprivate.h',
-  'gtkcssdataurlprivate.h',
-  'gtkcssdimensionvalueprivate.h',
-  'gtkcssdynamicprivate.h',
-  'gtkcsseasevalueprivate.h',
-  'gtkcssenumvalueprivate.h',
-  'gtkcssfiltervalueprivate.h',
-  'gtkcssfontfeaturesvalueprivate.h',
-  'gtkcssfontvariationsvalueprivate.h',
-  'gtkcssiconthemevalueprivate.h',
-  'gtkcssimageconicprivate.h',
-  'gtkcssimagecrossfadeprivate.h',
-  'gtkcssimagefallbackprivate.h',
-  'gtkcssimageiconthemeprivate.h',
-  'gtkcssimageinvalidprivate.h',
-  'gtkcssimagelinearprivate.h',
-  'gtkcssimagepaintableprivate.h',
-  'gtkcssimageprivate.h',
-  'gtkcssimageradialprivate.h',
-  'gtkcssimagerecolorprivate.h',
-  'gtkcssimagescaledprivate.h',
-  'gtkcssimageurlprivate.h',
-  'gtkcssimagevalueprivate.h',
-  'gtkcssimagewin32private.h',
-  'gtkcssinheritvalueprivate.h',
-  'gtkcssinitialvalueprivate.h',
-  'gtkcsskeyframesprivate.h',
-  'gtkcsslocationprivate.h',
-  'gtkcsslookupprivate.h',
-  'gtkcssmatcherprivate.h',
-  'gtkcssnodedeclarationprivate.h',
-  'gtkcssnodeprivate.h',
-  'gtkcssnodestylecacheprivate.h',
-  'gtkcssnumbervalueprivate.h',
-  'gtkcsspalettevalueprivate.h',
-  'gtkcssparserprivate.h',
-  'gtkcsspathnodeprivate.h',
-  'gtkcsspositionvalueprivate.h',
-  'gtkcssproviderprivate.h',
-  'gtkcssrepeatvalueprivate.h',
-  'gtkcssrgbavalueprivate.h',
-  'gtkcsssectionprivate.h',
-  'gtkcssselectorprivate.h',
-  'gtkcssserializerprivate.h',
-  'gtkcssshadowsvalueprivate.h',
-  'gtkcssshadowvalueprivate.h',
-  'gtkcssshorthandpropertyprivate.h',
-  'gtkcssstaticstyleprivate.h',
-  'gtkcssstringvalueprivate.h',
-  'gtkcssstylechangeprivate.h',
-  'gtkcssstyleprivate.h',
-  'gtkcssstylepropertyprivate.h',
-  'gtkcsstokenizerprivate.h',
-  'gtkcsstransformvalueprivate.h',
-  'gtkcsstransientnodeprivate.h',
-  'gtkcsstransitionprivate.h',
-  'gtkcsstypesprivate.h',
-  'gtkcssunsetvalueprivate.h',
-  'gtkcssvalueprivate.h',
-  'gtkcsswidgetnodeprivate.h',
-  'gtkcsswin32sizevalueprivate.h',
-  'gtkdialogprivate.h',
-  'gtkdragdestprivate.h',
-  'gtkdropprivate.h',
-  'gtkemojicompletion.h',
-  'gtkentryprivate.h',
-  'gtkeventcontrollerlegacyprivate.h',
-  'gtkeventcontrollerprivate.h',
-  'gtkfilechoosererrorstackprivate.h',
-  'gtkfilechoosernativeprivate.h',
-  'gtkfilechooserprivate.h',
-  'gtkfilechooserwidgetprivate.h',
-  'gtkfilefilterprivate.h',
-  'gtkflowboxprivate.h',
-  'gtkfontchooserprivate.h',
-  'gtkfontchooserwidgetprivate.h',
-  'gtkgesturedragprivate.h',
-  'gtkgesturelongpressprivate.h',
-  'gtkgesturemultipressprivate.h',
-  'gtkgesturepanprivate.h',
-  'gtkgestureprivate.h',
-  'gtkgesturerotateprivate.h',
-  'gtkgesturesingleprivate.h',
-  'gtkgesturestylusprivate.h',
-  'gtkgestureswipeprivate.h',
-  'gtkgesturezoomprivate.h',
-  'gtkgizmoprivate.h',
-  'gtkheaderbarprivate.h',
-  'gtkhslaprivate.h',
-  'gtkiconcacheprivate.h',
-  'gtkiconcachevalidatorprivate.h',
-  'gtkiconhelperprivate.h',
-  'gtkiconprivate.h',
-  'gtkiconthemeprivate.h',
-  'gtkiconviewprivate.h',
-  'gtkimagedefinitionprivate.h',
-  'gtkimageprivate.h',
-  'gtkimcontextbroadway.h',
-  'gtkimcontextime.h',
-  'gtkimcontextquartz.h',
-  'gtkimcontextsimpleprivate.h',
-  'gtkimcontextsimpleseqs.h',
-  'gtkimcontextwayland.h',
-  'gtkimmoduleprivate.h',
-  'gtkimmodule.h',
-  'gtkintl.h',
-  'gtkistringprivate.h',
-  'gtkkineticscrollingprivate.h',
-  'gtklabelprivate.h',
-  'gtklayoutmanagerprivate.h',
-  'gtklistbaseprivate.h',
-  'gtklistitemprivate.h',
-  'gtklistitemfactoryprivate.h',
-  'gtklistitemmanagerprivate.h',
-  'gtklistitemwidgetprivate.h',
-  'gtklistlistmodelprivate.h',
-  'gtklockbuttonprivate.h',
-  'gtkmagnifierprivate.h',
-  'gtkmediafileprivate.h',
-  'gtkmenubuttonprivate.h',
-  'gtkmenusectionboxprivate.h',
-  'gtkmenutrackeritemprivate.h',
-  'gtkmenutrackerprivate.h',
-  'gtkmodelbuttonprivate.h',
-  'gtkmodulesprivate.h',
-  'gtkmountoperationprivate.h',
-  'gtknativedialogprivate.h',
-  'gtknativeprivate.h',
-  'gtknomediafileprivate.h',
-  'gtkpango.h',
-  'gtkpasswordentrybufferprivate.h',
-  'gtkpasswordentryprivate.h',
-  'gtkpathbar.h',
-  'gdkpixbufutilsprivate.h',
-  'gtkplacessidebarprivate.h',
-  'gtkplacesviewprivate.h',
-  'gtkplacesviewrowprivate.h',
-  'gtkpointerfocusprivate.h',
-  'gtkpopcountprivate.h',
-  'gtkpopovermenubarprivate.h',
-  'gtkpopovermenuprivate.h',
-  'gtkpopoverprivate.h',
-  'gtkprintbackendprivate.h',
-  'gtkprinterprivate.h',
-  'gtkprintoperation-portal.h',
-  'gtkprintoperation-private.h',
-  'gtkprintutils.h',
-  'gtkprivate.h',
-  'gtkprogresstrackerprivate.h',
-  'gtkpropertylookuplistmodelprivate.h',
-  'gtkquery.h',
-  'gtkrangeprivate.h',
-  'gtkrbtreeprivate.h',
-  'gtkrenderbackgroundprivate.h',
-  'gtkrenderborderprivate.h',
-  'gtkrendericonprivate.h',
-  'gtkrendernodepaintableprivate.h',
-  'gtkrootprivate.h',
-  'gtkroundedboxprivate.h',
-  'gtkscalerprivate.h',
-  'gtksearchengine.h',
-  'gtksearchenginemodel.h',
-  'gtksearchenginequartz.h',
-  'gtksearchenginetracker3.h',
-  'gtksearchentryprivate.h',
-  'gtksecurememoryprivate.h',
-  'gtksettingsprivate.h',
-  'gtkshortcutactionprivate.h',
-  'gtkshortcutcontrollerprivate.h',
-  'gtkshortcutmanagerprivate.h',
-  'gtkshortcutsshortcutprivate.h',
-  'gtkshortcutswindowprivate.h',
-  'gtksidebarrowprivate.h',
-  'gtksizegroup-private.h',
-  'gtksizerequestcacheprivate.h',
-  'gtksnapshotprivate.h',
-  'gtksorterprivate.h',
-  'gtksortkeysprivate.h',
-  'gtkspinbuttonprivate.h',
-  'gtkstyleanimationprivate.h',
-  'gtkstylecascadeprivate.h',
-  'gtkstylecontextprivate.h',
-  'gtkstylepropertyprivate.h',
-  'gtkstyleproviderprivate.h',
-  'gtktestatcontextprivate.h',
-  'gtktextattributes.h',
-  'gtktextbufferprivate.h',
-  'gtktextchildprivate.h',
-  'gtktextdisplayprivate.h',
-  'gtktexthandleprivate.h',
-  'gtktexthistoryprivate.h',
-  'gtktextiterprivate.h',
-  'gtktextlayoutprivate.h',
-  'gtktextlinedisplaycacheprivate.h',
-  'gtktextmarkprivate.h',
-  'gtktextprivate.h',
-  'gtktextsegment.h',
-  'gtktexttagprivate.h',
-  'gtktextutil.h',
-  'gtktextviewchildprivate.h',
-  'gtktextviewprivate.h',
-  'gtktogglebuttonprivate.h',
-  'gtktoolbarprivate.h',
-  'gtktooltipprivate.h',
-  'gtktooltipwindowprivate.h',
-  'gtktreedatalist.h',
-  'gtktreepopoverprivate.h',
-  'gtktreeprivate.h',
-  'gtktreerbtreeprivate.h',
-  'gtkutilsprivate.h',
-  'gtkwidgetpaintableprivate.h',
-  'gtkwidgetpathprivate.h',
-  'gtkwidgetprivate.h',
-  'gtkwin32drawprivate.h',
-  'gtkwin32themeprivate.h',
-  'gtkwindowprivate.h',
-
-  'gsettings-mapping.h',
-  'gskpango.h',
-  'gtkdbusgenerated.h',
-  'imm-extra.h',
-  'language-names.h',
-  'open-type-layout.h',
-  'script-names.h',
-  'text-input-unstable-v3-client-protocol.h',
-
-  'a11y',
-  'inspector',
-  'roaring',
-  'timsort',
-  'tools',
-]
-
 images = [
   'images/aboutdialog.png',
   'images/action-bar.png',
@@ -491,67 +194,21 @@ expand_content_md_files = [
   'question_index.md',
 ]
 
-types_conf = configuration_data()
-if os_win32
-  types_conf.set('DISABLE_ON_W32', '%')
-else
-  types_conf.set('DISABLE_ON_W32', '')
-endif
-
-if os_darwin
-  types_conf.set('DISABLE_ON_QUARTZ', '%')
-else
-  types_conf.set('DISABLE_ON_QUARTZ', '')
-endif
-
 if get_option('gtk_doc')
-  configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
-
-  # gtk-markdown-to-docbook uses pandoc
-  pandoc = find_program('pandoc', required: true)
-  expand_md = find_program('gtk-markdown-to-docbook')
-  expand_md_targets = []
-  foreach t : expand_content_md_files
-    expand_md_targets += custom_target(t,
-      input: [ t ],
-      output: [ fs.replace_suffix(t, '.xml') ],
-      command: [ expand_md, '@INPUT@', '@OUTPUT@'],
-    )
-  endforeach
-
-  gnome.gtkdoc('gtk4',
-    mode: 'none',
-    main_xml: 'gtk4-docs.xml',
-    src_dir: [
-      gtkinc,
-    ],
-    dependencies: libgtk_dep,
-    gobject_typesfile: configure_file(
-      input: 'gtk4.types.in',
-      output: 'gtk4.types',
-      configuration: types_conf,
-    ),
-    scan_args: [
-      '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
-      '--ignore-headers=' + ' '.join(private_headers),
-    ],
-    mkdb_args: [
-      '--default-includes=gtk/gtk.h',
-      '--ignore-files=' + ' '.join(private_headers),
-    ],
-    fixxref_args: [
-      '--html-dir=@0@'.format(docpath),
-      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
-      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
-      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
-      '--extra-dir=@0@'.format(cairo_docpath),
-      '--extra-dir=@0@'.format(gdkpixbuf_docpath),
-      '--extra-dir=../gdk',
-      '--extra-dir=../gsk',
+  custom_target('gtk4-doc',
+    input: gtk_gir[0],
+    output: 'html',
+    command: [
+      gidocgen,
+      'generate',
+      '--add-include-path=@0@'.format(meson.current_source_dir() / '../../../gtk'),
+      '--config=@0@'.format(meson.current_source_dir() / 'gtk.toml'),
+      '--output-dir=@OUTPUT@',
+      '--content-dir=@0@'.format(meson.current_source_dir()),
+      '@INPUT@',
     ],
-    content_files: content_files + expand_md_targets,
-    html_assets: images,
-    install: true,
+    depend_files: [ 'gtk.toml', expand_content_md_files ],
+    build_by_default: true,
   )
 endif
 
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 4536addda4..63708554da 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -17,6 +17,8 @@ if get_option('gtk_doc')
   src_dir_conf.set('SRC_DIR', meson.source_root())
 endif
 
+gidocgen = find_program('gi-docgen', required: get_option('gtk_doc'))
+
 subdir('gdk')
 subdir('gsk')
 subdir('gtk')
diff --git a/meson.build b/meson.build
index 729aa3ea19..da7de18ce6 100644
--- a/meson.build
+++ b/meson.build
@@ -401,10 +401,9 @@ else
 endif
 iso_codes_dep  = dependency('iso-codes', required: false)
 
-gtk_doc_dep    = dependency('gtk-doc', version: '>=1.33',
-                            fallback: ['gtk-doc', 'dummy_dep'],
-                            default_options: ['tests=false', 'yelp_manual=false'],
-                            required: get_option('gtk_doc'))
+gidocgen_dep    = dependency('gi-docgen', version: '>= 2021.1',
+                             fallback: ['gi-docgen', 'dummy_dep'],
+                             required: get_option('gtk_doc'))
 
 fontconfig_dep = [] # only used in x11 backend
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]