[gnome-builder] build: build and install sphinx-based documentation



commit 6f56a8d20e24b247e449494fd5264415febe41b8
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jun 18 21:28:40 2017 -0700

    build: build and install sphinx-based documentation

 doc/api/index.rst                            |   20 --------------------
 doc/index.rst                                |    1 -
 doc/meson.build                              |   21 +++++++++++++++++++++
 libide/application/ide-application-actions.c |    6 +++---
 meson.build                                  |    2 ++
 5 files changed, 26 insertions(+), 24 deletions(-)
---
diff --git a/doc/index.rst b/doc/index.rst
index 9331ba8..be6bd35 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -21,6 +21,5 @@ Contents
    projects/index
    plugins/index
    howto/index
-   api/index
    contributing/index
    credits
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..1adbad2
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,21 @@
+if get_option('with_docs')
+
+sphinx = find_program('sphinx-build-3', required: false)
+if not sphinx.found()
+    sphinx = find_program('sphinx-build', required: false)
+endif
+
+if sphinx.found()
+    docs_sources = [
+    ]
+
+    custom_target('en user documentation',
+                  command: [sphinx, '-b', 'html', meson.current_source_dir(), '@OUTPUT@'],
+                    input: docs_sources,
+                   output: 'en',
+         build_by_default: true)
+
+    install_subdir(meson.current_build_dir() + '/en', install_dir: pkgdocdir_abs)
+endif
+
+endif
diff --git a/libide/application/ide-application-actions.c b/libide/application/ide-application-actions.c
index 452d253..f44e92f 100644
--- a/libide/application/ide-application-actions.c
+++ b/libide/application/ide-application-actions.c
@@ -180,16 +180,16 @@ ide_application_actions_help_cb (GObject      *object,
    * We failed to reach the online site for some reason (offline, transient error, etc),
    * so instead try to load the local documentation.
    */
-  if (g_file_test (PACKAGE_DOCDIR"/html/index.html", G_FILE_TEST_IS_REGULAR))
+  if (g_file_test (PACKAGE_DOCDIR"/en/index.html", G_FILE_TEST_IS_REGULAR))
     {
       const gchar *uri;
       g_autofree gchar *real_uri = NULL;
       g_autoptr(GError) error = NULL;
 
       if (ide_is_flatpak ())
-        uri = real_uri = ide_flatpak_get_app_path ("/share/doc/gnome-builder/html/index.html");
+        uri = real_uri = ide_flatpak_get_app_path ("/share/doc/gnome-builder/en/index.html");
       else
-        uri = "file://"PACKAGE_DOCDIR"/html/index.html";
+        uri = "file://"PACKAGE_DOCDIR"/en/index.html";
 
       if (!gtk_show_uri_on_window (focused_window, uri, gtk_get_current_event_time (), &error))
         g_warning ("Failed to load documentation: %s", error->message);
diff --git a/meson.build b/meson.build
index f0f3ac3..4b136d4 100644
--- a/meson.build
+++ b/meson.build
@@ -15,6 +15,7 @@ MAJOR_VERSION = version_split[0]
 MINOR_VERSION = version_split[1]
 MICRO_VERSION = version_split[2]
 
+pkgdocdir_abs = join_paths(get_option('prefix'), get_option('datadir'), 'doc', 'gnome-builder')
 pkglibdir_abs = join_paths(get_option('prefix'), get_option('libdir'), 'gnome-builder')
 pkglibdir = join_paths(get_option('libdir'), 'gnome-builder')
 pkgincludedir = join_paths(get_option('includedir'), 'gnome-builder')
@@ -268,6 +269,7 @@ subdir('libide')
 subdir('plugins')
 subdir('po')
 subdir('tests')
+subdir('doc')
 
 exe_link_args = [
   '-pie',


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