| Differences between
and this patch
- a/Source/JavaScriptCore/ChangeLog +19 lines
Lines 1-3 a/Source/JavaScriptCore/ChangeLog_sec1
1
2022-04-08  Adrian Perez de Castro  <aperez@igalia.com>
2
3
        [GTK][WPE] Missing inter-module documentation links
4
        https://bugs.webkit.org/show_bug.cgi?id=239016
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add JS snippets to be used in the gi-docgen output to setup links to
9
        other modules. Take advantage of being able to compute the documentation
10
        API version suffix from the currently loaded page URL, which avoids having
11
        a number of templates depending on the API version and having to deal with
12
        the documentation API version being sometimes different than the actual API
13
        version of the library. The URLs for GTK3 vs. GTK4 documentation cannot be
14
        handled in the same way, and instead the JS snippet is also a template
15
        expanded by CMake to allows using the ${GTK_API_VERSION} variable there.
16
17
        * API/glib/docs/jsc.toml.in: Use added urlmap.js file.
18
        * API/glib/docs/urlmap.js: Added.
19
1
2022-04-08  Elliott Williams  <emw@apple.com>
20
2022-04-08  Elliott Williams  <emw@apple.com>
2
21
3
        Unreviewed, reverting r292591.
22
        Unreviewed, reverting r292591.
- a/Source/WebKit/ChangeLog +25 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2022-04-08  Adrian Perez de Castro  <aperez@igalia.com>
2
3
        [GTK][WPE] Missing inter-module documentation links
4
        https://bugs.webkit.org/show_bug.cgi?id=239016
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add JS snippets to be used in the gi-docgen output to setup links to
9
        other modules. Take advantage of being able to compute the documentation
10
        API version suffix from the currently loaded page URL, which avoids having
11
        a number of templates depending on the API version and having to deal with
12
        the documentation API version being sometimes different than the actual API
13
        version of the library. The URLs for GTK3 vs. GTK4 documentation cannot be
14
        handled in the same way, and instead the JS snippet is also a template
15
        expanded by CMake to allows using the ${GTK_API_VERSION} variable there.
16
17
        * PlatformGTK.cmake: Set urlmap.js as documentation content template.
18
        * gtk/urlmap.js.in: Added.
19
        * gtk/webkit2gtk-webextension.toml.in: Use urlmap.js from added template.
20
        * gtk/webkit2gtk.toml.in: Ditto.
21
        * wpe/urlmap.js: Added.
22
        (const.baseURLApiLevelSuffix):
23
        * wpe/wpewebextension.toml.in: Use added urlmap.js file.
24
        * wpe/wpewebkit.toml.in: Ditto.
25
1
2022-04-08  Elliott Williams  <emw@apple.com>
26
2022-04-08  Elliott Williams  <emw@apple.com>
2
27
3
        Unreviewed, reverting r292591.
28
        Unreviewed, reverting r292591.
- a/Source/JavaScriptCore/API/glib/docs/jsc.toml.in +3 lines
Lines 21-23 show_class_hierarchy = true a/Source/JavaScriptCore/API/glib/docs/jsc.toml.in_sec1
21
21
22
[source-location]
22
[source-location]
23
base_url = "https://github.com/WebKit/WebKit/tree/main"
23
base_url = "https://github.com/WebKit/WebKit/tree/main"
24
25
[extra]
26
urlmap_file = "urlmap.js"
- a/Source/JavaScriptCore/API/glib/docs/urlmap.js +4 lines
Line 0 a/Source/JavaScriptCore/API/glib/docs/urlmap.js_sec1
1
baseURLs = [
2
  ["GLib", "https://docs.gtk.org/glib/"],
3
  ["GObject", "https://docs.gtk.org/gobject/"],
4
]
- a/Source/WebKit/PlatformGTK.cmake -2 / +6 lines
Lines 726-732 GI_INTROSPECT(WebKit2 ${WEBKITGTK_API_VERSION} webkit2/webkit2.h a/Source/WebKit/PlatformGTK.cmake_sec1
726
        UIProcess/API/gtk
726
        UIProcess/API/gtk
727
    NO_IMPLICIT_SOURCES
727
    NO_IMPLICIT_SOURCES
728
)
728
)
729
GI_DOCGEN(WebKit2 gtk/webkit2gtk.toml.in)
729
GI_DOCGEN(WebKit2 gtk/webkit2gtk.toml.in
730
    CONTENT_TEMPLATES gtk/urlmap.js
731
)
730
732
731
GI_INTROSPECT(WebKit2WebExtension ${WEBKITGTK_API_VERSION} webkit2/webkit-web-extension.h
733
GI_INTROSPECT(WebKit2WebExtension ${WEBKITGTK_API_VERSION} webkit2/webkit-web-extension.h
732
    TARGET WebKit
734
    TARGET WebKit
Lines 757-760 GI_INTROSPECT(WebKit2WebExtension ${WEBKITGTK_API_VERSION} webkit2/webkit-web-ex a/Source/WebKit/PlatformGTK.cmake_sec2
757
        WebProcess/InjectedBundle/API/glib/DOM
759
        WebProcess/InjectedBundle/API/glib/DOM
758
    NO_IMPLICIT_SOURCES
760
    NO_IMPLICIT_SOURCES
759
)
761
)
760
GI_DOCGEN(WebKit2WebExtension gtk/webkit2gtk-webextension.toml.in)
762
GI_DOCGEN(WebKit2WebExtension gtk/webkit2gtk-webextension.toml.in
763
    CONTENT_TEMPLATES gtk/urlmap.js
764
)
- a/Source/WebKit/gtk/urlmap.js.in +15 lines
Line 0 a/Source/WebKit/gtk/urlmap.js.in_sec1
1
const baseURLApiLevelSuffix = (function (uri) {
2
  const slashPos = uri.lastIndexOf("/");
3
  const dashPos = uri.lastIndexOf("-", slashPos);
4
  return uri.substring(dashPos, slashPos + 1);
5
})(window.location.href);
6
baseURLs = [
7
  ["GLib", "https://docs.gtk.org/glib/"],
8
  ["GObject", "https://docs.gtk.org/gobject/"],
9
  ["Gio", "https://docs.gtk.org/gio/"],
10
  ["Gdk", "https://docs.gtk.org/gdk@GTK_API_VERSION@/"],
11
  ["Gtk", "https://docs.gtk.org/gtk@GTK_API_VERSION@/"],
12
  ["JavaScriptCore", "../javascriptcoregtk" + baseURLApiLevelSuffix],
13
  ["WebKit2", "../webkit2gtk" + baseURLApiLevelSuffix],
14
  ["WebKit2WebExtension", "../webkit2gtk-web-extension" + baseURLApiLevelSuffix],
15
]
- a/Source/WebKit/gtk/webkit2gtk-webextension.toml.in +3 lines
Lines 31-33 show_class_hierarchy = true a/Source/WebKit/gtk/webkit2gtk-webextension.toml.in_sec1
31
31
32
[source-location]
32
[source-location]
33
base_url = "https://github.com/WebKit/WebKit/tree/main"
33
base_url = "https://github.com/WebKit/WebKit/tree/main"
34
35
[extra]
36
urlmap_file = "urlmap.js"
- a/Source/WebKit/gtk/webkit2gtk.toml.in +3 lines
Lines 36-38 show_class_hierarchy = true a/Source/WebKit/gtk/webkit2gtk.toml.in_sec1
36
36
37
[source-location]
37
[source-location]
38
base_url = "https://github.com/WebKit/WebKit/tree/main"
38
base_url = "https://github.com/WebKit/WebKit/tree/main"
39
40
[extra]
41
urlmap_file = "urlmap.js"
- a/Source/WebKit/wpe/urlmap.js +13 lines
Line 0 a/Source/WebKit/wpe/urlmap.js_sec1
1
const baseURLApiLevelSuffix = (function (uri) {
2
  const slashPos = uri.lastIndexOf("/");
3
  const dashPos = uri.lastIndexOf("-", slashPos);
4
  return uri.substring(dashPos, slashPos + 1);
5
})(window.location.href);
6
baseURLs = [
7
  ["GLib", "https://docs.gtk.org/glib/"],
8
  ["GObject", "https://docs.gtk.org/gobject/"],
9
  ["Gio", "https://docs.gtk.org/gio/"],
10
  ["WPEJavaScriptCore", "../wpe-javascriptcore" + baseURLApiLevelSuffix],
11
  ["WPEWebExtension", "../wpe-web-extension" + baseURLApiLevelSuffix],
12
  ["WPEWebKit", "../wpe-webkit" + baseURLApiLevelSuffix],
13
]
- a/Source/WebKit/wpe/wpewebextension.toml.in +3 lines
Lines 31-33 show_class_hierarchy = true a/Source/WebKit/wpe/wpewebextension.toml.in_sec1
31
31
32
[source-location]
32
[source-location]
33
base_url = "https://github.com/WebKit/WebKit/tree/main"
33
base_url = "https://github.com/WebKit/WebKit/tree/main"
34
35
[extra]
36
urlmap_file = "urlmap.js"
- a/Source/WebKit/wpe/wpewebkit.toml.in +3 lines
Lines 31-33 show_class_hierarchy = true a/Source/WebKit/wpe/wpewebkit.toml.in_sec1
31
31
32
[source-location]
32
[source-location]
33
base_url = "https://github.com/WebKit/WebKit/tree/main"
33
base_url = "https://github.com/WebKit/WebKit/tree/main"
34
35
[extra]
36
urlmap_file = "urlmap.js"
- a/Source/cmake/FindGIDocgen.cmake -3 / +24 lines
Lines 123-129 endif () a/Source/cmake/FindGIDocgen.cmake_sec1
123
123
124
  .. code-block:: cmake
124
  .. code-block:: cmake
125
125
126
    GI_DOCGEN(<namespace> <toml-file>)
126
    GI_DOCGEN(<namespace> <toml-file>
127
              [CONTENT_TEMPLATES <file...>])
127
128
128
   Configures generating documentation for a GObject-Introspection
129
   Configures generating documentation for a GObject-Introspection
129
   ``<namespace>``, which needs to have been previously configured using
130
   ``<namespace>``, which needs to have been previously configured using
Lines 136-141 endif () a/Source/cmake/FindGIDocgen.cmake_sec2
136
137
137
   __ https://gnome.pages.gitlab.gnome.org/gi-docgen/project-configuration.html
138
   __ https://gnome.pages.gitlab.gnome.org/gi-docgen/project-configuration.html
138
139
140
   ``CONTENT_TEMPLATES`` can be used to list files, for each of them a
141
   template with the ``.in`` suffix will be expanded using the
142
   command:`configure_file` in ``@ONLY`` mode. The ``.in`` sufix must
143
   not be present.
144
139
   Documentation is generated in the ``Documentation/<pkgname>-<nsversion>/``
145
   Documentation is generated in the ``Documentation/<pkgname>-<nsversion>/``
140
   subdirectory by the ``doc-<namespace>`` target added by the command.
146
   subdirectory by the ``doc-<namespace>`` target added by the command.
141
   Additionally, a ``doc-check-<namespace>`` target is created as well,
147
   Additionally, a ``doc-check-<namespace>`` target is created as well,
Lines 147-152 endif () a/Source/cmake/FindGIDocgen.cmake_sec3
147
153
148
#]=======================================================================]
154
#]=======================================================================]
149
function(GI_DOCGEN namespace toml)
155
function(GI_DOCGEN namespace toml)
156
    cmake_parse_arguments(PARSE_ARGV 1 opt
157
        ""
158
        ""
159
        "CONTENT_TEMPLATES"
160
    )
150
    if (NOT TARGET "gir-${namespace}")
161
    if (NOT TARGET "gir-${namespace}")
151
        message(FATAL_ERROR
162
        message(FATAL_ERROR
152
            "Introspection not configured for '${namespace}'. "
163
            "Introspection not configured for '${namespace}'. "
Lines 154-161 function(GI_DOCGEN namespace toml) a/Source/cmake/FindGIDocgen.cmake_sec4
154
        )
165
        )
155
    endif ()
166
    endif ()
156
167
168
    set(contentdir "${CMAKE_BINARY_DIR}/GIDocgenGenerated/${namespace}")
169
157
    get_property(gir_path TARGET "gir-${namespace}" PROPERTY GI_GIR_PATH)
170
    get_property(gir_path TARGET "gir-${namespace}" PROPERTY GI_GIR_PATH)
158
    set(toml_path "${CMAKE_BINARY_DIR}/${namespace}.toml")
171
    set(toml_path "${contentdir}.toml")
159
    configure_file("${toml}" "${toml_path}" @ONLY)
172
    configure_file("${toml}" "${toml_path}" @ONLY)
160
173
161
    get_filename_component(toml_dir "${toml}" DIRECTORY)
174
    get_filename_component(toml_dir "${toml}" DIRECTORY)
Lines 167-172 function(GI_DOCGEN namespace toml) a/Source/cmake/FindGIDocgen.cmake_sec5
167
    endif ()
180
    endif ()
168
    set(outdir "${CMAKE_BINARY_DIR}/Documentation/${package}")
181
    set(outdir "${CMAKE_BINARY_DIR}/Documentation/${package}")
169
182
183
    set(docdeps "${toml_path};${gir_path}")
184
    foreach (item IN LISTS opt_CONTENT_TEMPLATES)
185
        get_filename_component(filename "${item}" NAME)
186
        configure_file("${item}.in" "${contentdir}/${filename}" @ONLY)
187
        list(APPEND docdeps "${contentdir}/${filename}")
188
    endforeach ()
189
170
    set(common_flags)
190
    set(common_flags)
171
    list(APPEND common_flags
191
    list(APPEND common_flags
172
        --quiet
192
        --quiet
Lines 179-189 function(GI_DOCGEN namespace toml) a/Source/cmake/FindGIDocgen.cmake_sec6
179
        OUTPUT "${outdir}/index.html"
199
        OUTPUT "${outdir}/index.html"
180
        COMMENT "Generating documentation: ${namespace}"
200
        COMMENT "Generating documentation: ${namespace}"
181
        WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
201
        WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
182
        DEPENDS "${toml_path}" "${gir_path}"
202
        DEPENDS ${docdeps}
183
        VERBATIM
203
        VERBATIM
184
        COMMAND "${GIDocgen_EXE}" generate
204
        COMMAND "${GIDocgen_EXE}" generate
185
            ${common_flags}
205
            ${common_flags}
186
            --no-namespace-dir
206
            --no-namespace-dir
207
            --content-dir "${contentdir}"
187
            --content-dir "${toml_dir}"
208
            --content-dir "${toml_dir}"
188
            --output-dir "${outdir}"
209
            --output-dir "${outdir}"
189
            --config "${toml_path}"
210
            --config "${toml_path}"
- a/ChangeLog +20 lines
Lines 1-3 a/ChangeLog_sec1
1
2022-04-08  Adrian Perez de Castro  <aperez@igalia.com>
2
3
        [GTK][WPE] Missing inter-module documentation links
4
        https://bugs.webkit.org/show_bug.cgi?id=239016
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add JS snippets to be used in the gi-docgen output to setup links to
9
        other modules. Take advantage of being able to compute the documentation
10
        API version suffix from the currently loaded page URL, which avoids having
11
        a number of templates depending on the API version and having to deal with
12
        the documentation API version being sometimes different than the actual API
13
        version of the library. The URLs for GTK3 vs. GTK4 documentation cannot be
14
        handled in the same way, and instead the JS snippet is also a template
15
        expanded by CMake to allows using the ${GTK_API_VERSION} variable there.
16
17
        * Source/cmake/FindGIDocgen.cmake: Add a new CONTENT_TEMPLATES option
18
        to GI_DOCGEN(), which allows setting up files to be expanded as CMake
19
        @ONLY templates and then be used as documentation content files.
20
1
2022-04-08  Elliott Williams  <emw@apple.com>
21
2022-04-08  Elliott Williams  <emw@apple.com>
2
22
3
        Unreviewed, reverting r292591.
23
        Unreviewed, reverting r292591.

Return to Bug 239016