diff --git a/gnucash/html/CMakeLists.txt b/gnucash/html/CMakeLists.txt
index 4669495727..13e4a7c5d1 100644
--- a/gnucash/html/CMakeLists.txt
+++ b/gnucash/html/CMakeLists.txt
@@ -32,7 +32,21 @@ else ()
set(html_EXTRA_DIST gnc-html-webkit1.h gnc-html-webkit1.c)
endif ()
-set_dist_list(html_DIST CMakeLists.txt ${html_HEADERS} ${html_SOURCES} gnc-html.i ${html_EXTRA_DIST})
+
+
+set (gnc_html_SCHEME html.scm)
+
+set(GUILE_OUTPUT_DIR gnucash)
+set(GUILE_DEPENDS gncmod-html gnucash-guile)
+
+gnc_add_scheme_targets(scm-gnc-html
+ "${gnc_html_SCHEME}"
+ ${GUILE_OUTPUT_DIR}
+ "${GUILE_DEPENDS}"
+ FALSE
+)
+
+set_dist_list(html_DIST CMakeLists.txt ${html_HEADERS} ${html_SOURCES} gnc-html.i ${html_EXTRA_DIST} html.scm)
add_library (gncmod-html
${html_SOURCES}
diff --git a/gnucash/html/gnc-html.i b/gnucash/html/gnc-html.i
index f30e1fad3a..573cf81cfb 100644
--- a/gnucash/html/gnc-html.i
+++ b/gnucash/html/gnc-html.i
@@ -48,6 +48,7 @@ SCM scm_init_sw_gnc_html_module(void);
%include "gnc-html-extras.h"
+void gnc_html_initialize(void);
%init {
{
diff --git a/gnucash/html/html.scm b/gnucash/html/html.scm
new file mode 100644
index 0000000000..6e39da28de
--- /dev/null
+++ b/gnucash/html/html.scm
@@ -0,0 +1,39 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; gnc-html.scm
+;;; Guile module for gnc-html
+;;;
+;;; Copyright 2019 Geert Janssens
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2 of
+;; the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, contact:
+;;
+;; Free Software Foundation Voice: +1-617-542-5942
+;; 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
+;; Boston, MA 02110-1301, USA gnu@gnu.org
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+(define-module (gnucash html))
+
+;; Guile 2 needs to find the symbols from the extension at compile time already
+(eval-when
+ (compile load eval expand)
+ (load-extension "libgncmod-html" "scm_init_sw_gnc_html_module"))
+(use-modules (sw_gnc_html))
+
+; Export the swig-wrapped symbols in the public interface of this module
+(let ((i (module-public-interface (current-module))))
+ (module-use! i (resolve-interface '(sw_gnc_html))))
+
+(gnc-html-initialize)
diff --git a/gnucash/report/CMakeLists.txt b/gnucash/report/CMakeLists.txt
index 00ea814a97..8eda96b253 100644
--- a/gnucash/report/CMakeLists.txt
+++ b/gnucash/report/CMakeLists.txt
@@ -89,7 +89,7 @@ set (report_eguile_SCHEME
)
set(GUILE_DEPENDS
- gncmod-html
+ scm-gnc-html
scm-gnome-utils
gncmod-report
scm-app-utils
diff --git a/gnucash/report/html-document.scm b/gnucash/report/html-document.scm
index 782c41f93b..b1322387ea 100644
--- a/gnucash/report/html-document.scm
+++ b/gnucash/report/html-document.scm
@@ -21,7 +21,7 @@
;; Boston, MA 02110-1301, USA gnu@gnu.org
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; class
diff --git a/gnucash/report/report.scm b/gnucash/report/report.scm
index 2107fd03d8..77c5fe3d8a 100644
--- a/gnucash/report/report.scm
+++ b/gnucash/report/report.scm
@@ -33,9 +33,7 @@
(use-modules (gnucash engine))
(use-modules (gnucash app-utils))
(use-modules (gnucash gnome-utils))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
;; commodity-utilities.scm
(export gnc:get-match-commodity-splits)
diff --git a/gnucash/report/reports/CMakeLists.txt b/gnucash/report/reports/CMakeLists.txt
index aba85f16d9..1484e94ac4 100644
--- a/gnucash/report/reports/CMakeLists.txt
+++ b/gnucash/report/reports/CMakeLists.txt
@@ -72,19 +72,17 @@ set (reports_SCHEME
)
set(scm_rpts_GUILE_DEPENDS
- gncmod-html
+ scm-gnc-html
scm-core-utils
scm-engine
- scm-core-utils
scm-gnome-utils
scm-report
)
set(scm_rpt_example_GUILE_DEPENDS
- gncmod-html
+ scm-gnc-html
scm-app-utils
scm-core-utils
- scm-core-utils
scm-gnc-module
scm-engine
scm-reports-example-links
@@ -93,8 +91,7 @@ set(scm_rpt_example_GUILE_DEPENDS
)
set(scm_rpt_locale_specific_GUILE_DEPENDS
- gncmod-html
- scm-core-utils
+ scm-gnc-html
scm-core-utils
scm-gnc-module
scm-engine
diff --git a/gnucash/report/reports/example/hello-world.scm b/gnucash/report/reports/example/hello-world.scm
index 74ea30630b..cde5540c5f 100644
--- a/gnucash/report/reports/example/hello-world.scm
+++ b/gnucash/report/reports/example/hello-world.scm
@@ -30,12 +30,10 @@
(use-modules (gnucash core-utils))
(use-modules (gnucash app-utils))
(use-modules (gnucash report))
+(use-modules (gnucash html))
(debug-enable 'backtrace)
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0) ;for gnc-build-url
-
;; This function will generate a set of options that GnuCash
;; will use to display a dialog where the user can select
;; values for your report's parameters.
diff --git a/gnucash/report/reports/locale-specific/us/taxtxf.scm b/gnucash/report/reports/locale-specific/us/taxtxf.scm
index b443c5c1d7..40e6cfbe1d 100644
--- a/gnucash/report/reports/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/reports/locale-specific/us/taxtxf.scm
@@ -107,9 +107,7 @@
(use-modules (gnucash gnome-utils))
(use-modules (gnucash report))
(use-modules (srfi srfi-1))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
(define reportname (N_ "Tax Schedule Report/TXF Export"))
diff --git a/gnucash/report/reports/standard/balsheet-eg.scm b/gnucash/report/reports/standard/balsheet-eg.scm
index ce6929446b..ebf34b154b 100644
--- a/gnucash/report/reports/standard/balsheet-eg.scm
+++ b/gnucash/report/reports/standard/balsheet-eg.scm
@@ -38,13 +38,11 @@
(use-modules (gnucash app-utils))
(use-modules (gnucash eguile))
(use-modules (gnucash report))
+(use-modules (gnucash html))
(use-modules (ice-9 local-eval)) ; for the-environment
(use-modules (srfi srfi-13)) ; for extra string functions
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
-
(define debugging? #f)
(define (debug . args)
diff --git a/gnucash/report/reports/standard/receipt.scm b/gnucash/report/reports/standard/receipt.scm
index cbfa5a395c..eb7f12d5ea 100644
--- a/gnucash/report/reports/standard/receipt.scm
+++ b/gnucash/report/reports/standard/receipt.scm
@@ -22,9 +22,7 @@
(use-modules (gnucash core-utils))
(use-modules (gnucash app-utils))
(use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
(use-modules (gnucash eguile))
diff --git a/gnucash/report/reports/standard/taxinvoice.scm b/gnucash/report/reports/standard/taxinvoice.scm
index 65e9acdbe4..1e7e398582 100644
--- a/gnucash/report/reports/standard/taxinvoice.scm
+++ b/gnucash/report/reports/standard/taxinvoice.scm
@@ -30,9 +30,7 @@
(use-modules (gnucash core-utils))
(use-modules (gnucash app-utils))
(use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
(use-modules (gnucash eguile))
diff --git a/gnucash/report/reports/standard/view-column.scm b/gnucash/report/reports/standard/view-column.scm
index 24b9600924..d73e131786 100644
--- a/gnucash/report/reports/standard/view-column.scm
+++ b/gnucash/report/reports/standard/view-column.scm
@@ -32,9 +32,7 @@
(use-modules (gnucash core-utils))
(use-modules (gnucash app-utils))
(use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0) ;for gnc-build-url
+(use-modules (gnucash html))
(define (make-options)
(let* ((options (gnc:new-options))
diff --git a/gnucash/report/stylesheets/footer.scm b/gnucash/report/stylesheets/footer.scm
index 7b2acfae83..5e1d0b6c84 100644
--- a/gnucash/report/stylesheets/footer.scm
+++ b/gnucash/report/stylesheets/footer.scm
@@ -39,10 +39,9 @@
(use-modules (gnucash engine))
(use-modules (gnucash utilities))
(use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
(use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
(define (easy-fancy-footer-options)
(let* ((options (gnc:new-options))
diff --git a/gnucash/report/stylesheets/head-or-tail.scm b/gnucash/report/stylesheets/head-or-tail.scm
index 0443181a41..6554026555 100644
--- a/gnucash/report/stylesheets/head-or-tail.scm
+++ b/gnucash/report/stylesheets/head-or-tail.scm
@@ -38,10 +38,9 @@
(use-modules (gnucash engine))
(use-modules (gnucash utilities))
(use-modules (gnucash core-utils)) ; for gnc:version and (_ ...)
+(use-modules (gnucash app-utils))
(use-modules (gnucash report))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
(define (head-or-tail-options)
(let* ((options (gnc:new-options))
diff --git a/gnucash/report/stylesheets/plain.scm b/gnucash/report/stylesheets/plain.scm
index 8b1cb999d3..c5b5021094 100644
--- a/gnucash/report/stylesheets/plain.scm
+++ b/gnucash/report/stylesheets/plain.scm
@@ -27,12 +27,11 @@
(use-modules (gnucash engine))
(use-modules (gnucash utilities))
(use-modules (gnucash core-utils))
+(use-modules (gnucash app-utils))
(use-modules (gnucash report))
(use-modules (srfi srfi-13))
(use-modules (srfi srfi-14))
-
-(use-modules (gnucash gnc-module))
-(gnc:module-load "gnucash/html" 0)
+(use-modules (gnucash html))
;; plain style sheet
;; this should generally be the default style sheet for most reports.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2ff5214c34..015b1288c7 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -300,6 +300,7 @@ gnucash/html/gnc-html-history.c
gnucash/html/gnc-html-webkit1.c
gnucash/html/gnc-html-webkit2.c
gnucash/html/gncmod-html.c
+gnucash/html/html.scm
gnucash/import-export/aqb/assistant-ab-initial.c
gnucash/import-export/aqb/assistant-ab-initial.glade
gnucash/import-export/aqb/dialog-ab-daterange.c