DITA search in html5

232 views
Skip to first unread message

Favorite s

unread,
Jul 14, 2021, 1:25:17 PM7/14/21
to DITA-OT Users
Hi,

We want to implement search functionality in our html5 plugin which should do internal search and we are not using any editor like Oxygen. I have followed the steps from the URL, http://www.taylortext.com and it didn't showing as expected. Could you please provide your suggestions or help me on how we can achieve it ? 

Thanks in advance.

kcho...@mail.com

unread,
Jul 16, 2021, 2:48:14 AM7/16/21
to DITA-OT Users
Hi, 

please take a look at this:

-----------
jAuthor - www.jauthor.com

Toshihiko Makita

unread,
Jul 17, 2021, 10:28:22 AM7/17/21
to DITA-OT Users
Hi,

I also very interested in how DITA people implements outputting HTML and how they implement search features in their publication.

I have been working DITA to PDF projects for over ten years. But recently I'm working with DITA to HTML5 (.php) project using my base HTML5 plug-in (https://github.com/AntennaHouse/ah-html5) .

In search area, it is implemented in front-end JavaScript. In DITA-OT processing the HTML5 plug-in generates a JSON file that contain DITA topic contents such like this:
      
      { "title" : "About the contents of this chapter",
        "body" : "This chapter provides a description of all parts, including options. ... continued.",
        "url" : "topic_9903.php#topic_dzx_lky_bgq" } 

The front-end JavaScript inputs this JSON and when user submit a search query, it scans this JSON and displays the search results. This function uses JavaScript String.indexOf() function. (In other words, it is so simple. It does not have language specific services.)

Another user uses cloud-based commercial search engine. They generates same level JSON and put them into AWS Elasticsearch index. When a user submit a search query, it is posted into AWS Elasticsearch engine and Elasticsearch returns the search results and relevant topic URLs. The front-end JavaScript display the result as the search result page.

Elasticsearch is very powerful and customizable. It supports many language specific features containing Japanese (very complex) or other CJK languages. 

Also another user uses OXygen WebHelp product. Oxygen WebHelp is known as very popular implementation for XML editor users and works very fine.

I know that IXIASOFT adopts Oxygen WebHelp for their manual page. (Yes, it was originally written in DITA)


If someone introduce the search implementation, it is very appreciated.

Regards,

-- 
/*-----------------------------------------------------------------------------------
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 http://www.antenna.co.jp/
 http://www.antennahouse.com/
 ------------------------------------------------------------------------------------*/   
2021年7月16日金曜日 15:48:14 UTC+9 kcho...@mail.com:

Saibul Haq

unread,
Jul 17, 2021, 11:00:45 AM7/17/21
to DITA-OT Users

I also trying to implement search functionality and want to implement how they are implemented below.

We are using plain dita-ot and trying to implement a search feature using the below plugin, unfortunately, it is not building in 3.3.2

Can we use oxygen plugin and step in dita-ot to bring the same output as in the above ixiasoft.

it would be helpful if someone implemented the search.

Toshihiko Makita

unread,
Jul 18, 2021, 12:28:06 AM7/18/21
to DITA-OT Users
It is better to hear from Oxygen and IXIASOFT people about this discussion.
I have forwarded this discussion to Radu Coravu with Oxygen and Leigh White with IXIASOFT (The author of "DITA for Print").

Regards,

Toshihiko Makita
2021年7月18日日曜日 0:00:45 UTC+9 saibu...@gmail.com:

Radu Coravu

unread,
Jul 19, 2021, 12:02:59 AM7/19/21
to Toshihiko Makita, DITA-OT Users

Hi,

As far as I know the Ixiasoft User's Guide uses Oxygen WebHelp with a custom color theme.

About this remark by Toshihiko:

If someone introduce the search implementation, it is very appreciated.
The Oxygen WebHelp plugins are commercial and not open source, the search is implemented using a local Javascript index database created during publishing, so it does not require server side functionality.

Regards,

Radu

Radu Coravu
Oxygen XML Editor

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/9f6f78a9-1c9d-4112-b36f-5a71d47f2479n%40googlegroups.com.

Saibul Haq

unread,
Jul 19, 2021, 4:57:50 AM7/19/21
to Radu Coravu, Toshihiko Makita, DITA-OT Users
Thanks Radu Toshihiko for your valuable time.

We are using the DITA-OT v3.3.2 as a AEM plugin in our AEM CMS tool.

I understand that during translation it reading all the values from the title and description and have it in the local json cache, when we do search it does indexOf in the cached json and returning the result.
To achieve that I have installed the plugin com.taylortext.ditasearch but  it throws the error said in the  https://github.com/shaneataylor/ditasearch/issues/14

we are getting the below error, when it tries to read the highlighted in red color in the below template. I tried escaping also. 
Error: Fatal error during transformation using C:\Users\Pritz\Desktop\dita-ot\plugins\com.taylortext.ditasearch\xsl\index2js.xsl: Invalid relative URI: Illegal character in opaque part at index 2: C:\Users\Pritz\Desktop\dita-ot\plugins\com.taylortext.ditasearch/js/ditasearch.js: file:/C:/Users/Pritz/Desktop/dita-ot/plugins/com.taylortext.ditasearch/xsl/index2js.xsl; SystemID: file:/C:/Users/Pritz/Desktop/dita-ot/plugins/com.taylortext.ditasearch/xsl/index2js.xsl; Line#: 21; Column#: 14

  <xsl:template match="/">
        <!-- The sequence here must match ditasearch.js -->
       
<xsl:value-of select="substring-before($script,'//==EXCEPTIONLIST==//')"/>
        <xsl:apply-templates select="//exceptionalforms/exception"/>
        <xsl:value-of select="fn:substring-between($script,'//==EXCEPTIONLIST==//','//==STRINGS==//')"/>
        <xsl:call-template name="addStrings"/>
        <xsl:value-of select="fn:substring-between($script,'//==STRINGS==//','//==SYNONYMS==//')"/>
        <xsl:call-template name="synonyms"/>
        <xsl:value-of select="fn:substring-between($script,'//==SYNONYMS==//','//==HELPINDEX==//')"/>
        <xsl:call-template name="helpindex"/>
        <xsl:value-of select="fn:substring-between($script,'//==HELPINDEX==//','//==TOPICSUMMARIES==//')"/>
        <xsl:call-template name="topicsummaries"/>
        <xsl:value-of select="substring-after($script,'//==TOPICSUMMARIES==//')"/>
    </xsl:template>



When I download v3.5.2 DIAT-OT setup locally then it is not throwing the above error but it throws the error said in the https://github.com/shaneataylor/ditasearch/issues/15



Toshihiko Makita

unread,
Jul 19, 2021, 5:05:10 PM7/19/21
to DITA-OT Users
Hi,

I looked at the  shaneataylor/ditasearch plugin. 

My warry is that it is not maintained for at least two years and developer does not respond to posted issue. Generally speaking, an Open Source Software is sometimes danger to adopt by corporate level solutions because it frequently become un-maintained or it is sometimes leave alone so it does not follow the software environment progression.

I know that one of DITA HTML project using PHP failed because only one open software component is not maintained to adopt the newest software environment. As a result, this project must develop without that component from scratch.

Hope this helps your development.

Toshihiko Makita


2021年7月19日月曜日 17:57:50 UTC+9 saibu...@gmail.com:

Leigh W

unread,
Jul 20, 2021, 11:52:55 AM7/20/21
to DITA-OT Users
Hello,

As far as how we implement search in WebHelp, we use the default search built into the Oxygen WebHelp plugin. We have customized the look and feel of the WebHelp a bit to reflect our branding (colors, banner, etc.), but we have not done any customizations to the underlying functionality. Unfortunately, I can't really speak to the code that renders that Search bar or how it could be ported to online help generated from HTML5. I think Oxygen can answer that question better.

As for using the plugin you mentioned, if it works at all, it could be made to work within the IXIASOFT Output Generator, since the Output Generator uses a largely out of the box OT, any version. Toshihiko-san's advice is good in that some open-source plugins can become outdated if not consistently maintained by the developer. If this plugin was last updated two years ago, it might have been written for an older version of the OT, which is evolving pretty rapidly right now. I notice that there is a developer note "Support OT 3.1" and that is the latest version specifically mentioned (at a glance; I have not dug deeply). It's possible it just does not work properly with OT 3.3.2. Try it with a 3.1 version and see if you get better results.

Best,
Leigh
Reply all
Reply to author
Forward
0 new messages