summaryrefslogtreecommitdiffstats
path: root/CustomTarget_html.mk
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2019-08-23 06:50:58 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2019-10-01 15:00:44 +0200
commitaa45ded698f25e8d3bc8eef621d727186fe18dd2 (patch)
tree705428909416c1e243d29db6cb909ce2b3f10eee /CustomTarget_html.mk
parentMute l10n of standard attributes (diff)
downloadhelp-aa45ded698f25e8d3bc8eef621d727186fe18dd2.tar.gz
help-aa45ded698f25e8d3bc8eef621d727186fe18dd2.zip
redmine#2555 replace Help online Google search
This is the helpcontent2/ part of the patch. Add xapian-omega search to online Help. The patch replaces Google custom search with xapian-omega search. A new build key is introduced. --with-omindex=server : Localizes and adds the xapian result page template, adds the xapian form to each Help page. --with-omindex=noxap : do not localize the result template and do not add a form in the Help page. --with-omindex= will force Online Help build. Default is noxap NOTES: - xapian-omega databases are built in the server. - searches returns results only on localized Help pages, avoiding same resulis in many languages. TODO: - Tweak the xapian-omega result page CSS and markup. Change-Id: I3dc2b79c4111f61fd5fea01b1f8c95bfacab1e8f Reviewed-on: https://gerrit.libreoffice.org/79366 Tested-by: Jenkins Reviewed-by: Guilhem Moulin <guilhem@libreoffice.org> Tested-by: Guilhem Moulin <guilhem@libreoffice.org>
Diffstat (limited to 'CustomTarget_html.mk')
-rw-r--r--CustomTarget_html.mk23
1 files changed, 22 insertions, 1 deletions
diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk
index de972bb73e..e43c17a48a 100644
--- a/CustomTarget_html.mk
+++ b/CustomTarget_html.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_CustomTarget_register_targets,helpcontent2/help3xsl,\
$(foreach lang,$(gb_HELP_LANGS),\
$(lang)/bookmarks.js \
$(lang)/contents.js \
+ $(if $(HELP_OMINDEX_PAGE),$(lang)/xap_tpl) \
$(lang)/html.text \
$(lang)/langnames.js \
$(foreach module,$(html_TREE_MODULES),$(module)/$(lang)/contents.part) \
@@ -53,6 +54,24 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/hid2file.js : \
) > $@ \
)
+# Xapian localized templates
+ifeq ($(HELP_OMINDEX_PAGE),TRUE)
+
+$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/xap_tpl : \
+ $(SRCDIR)/helpcontent2/help3xsl/xap_templ_query.xsl \
+ $(call gb_ExternalExecutable_get_dependencies,xsltproc) \
+ $(SRCDIR)/helpcontent2/CustomTarget_html.mk
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XAT,1)
+ $(call gb_Helper_abbreviate_dirs,\
+ $(call gb_ExternalExecutable_get_command,xsltproc) \
+ --stringparam lang $* \
+ -o $@ \
+ $(SRCDIR)/helpcontent2/help3xsl/xap_templ_query.xsl \
+ $(SRCDIR)/helpcontent2/source/text/shared/help/browserhelp.xhp \
+ )
+
+endif
+
# set of installed languages - has to be language independent
$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/languages.js : \
$(SRCDIR)/helpcontent2/CustomTarget_html.mk
@@ -62,6 +81,7 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/languages.js : \
printf ']);\n' \
) > $@
+
define html_gen_langnames_js_dep
$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/$(1)/langnames.js : \
$(if $(filter en-US,$(1)),$(SRCDIR),$(call gb_HelpTranslatePartTarget_get_workdir,$(1)))/helpcontent2/source/text/shared/help/browserhelp.xhp
@@ -152,6 +172,7 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/html.text : \
--stringparam root $(if $(filter WNT,$(OS)),$$(cygpath -m `pwd`),`pwd`)/ \
--stringparam productname "$(PRODUCTNAME)" \
--stringparam productversion "$(PRODUCTVERSION)" \
+ --stringparam xapian $(if $(filter TRUE, $(HELP_OMINDEX_PAGE)),'yes','no') \
-o $(dir $@)$${xhp%.xhp}.html \
$(SRCDIR)/helpcontent2/help3xsl/online_transform.xsl \
$(if $(filter WNT,$(OS)),$$(cygpath -m `pwd`),`pwd`)/$$xhp \
@@ -160,7 +181,7 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/html.text : \
&& rm "$$RESPONSEFILE" \
&& touch $@ \
)
-
+
$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/bookmarks.js :
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),CAT,2)
$(call gb_Helper_abbreviate_dirs,\