Intersec / antora-indexer-elasticsearch

Antora-compatible module to index pages in an Elastic Search cluster
2 stars 2 forks source link

Implementation documentation #1

Open kzdelarec opened 4 years ago

kzdelarec commented 4 years ago

Can you please provide implementation docs?

JeanMarcCoic commented 4 years ago

Hi Kristijan,

This library is only one building block to index an antora website in Elastic search. You will have to write additional code to integrate the library. I can think of at least :

 const mapSite = require('@antora/site-mapper')
 const produceRedirects = require('@antora/redirect-producer')
 const publishSite = require('@antora/site-publisher')
+const siteIndexer = require('antora-indexer-elasticsearch')
 const { resolveConfig: resolveAsciiDocConfig } = require('@antora/asciidoc-loader')

 async function generateSite (args, env) {
@@ -20,6 +21,7 @@
   ])
   const asciidocConfig = resolveAsciiDocConfig(playbook)
   const pages = convertDocuments(contentCatalog, asciidocConfig)
+  siteIndexer(pages)
   const navigationCatalog = buildNavigation(contentCatalog, asciidocConfig)
   const composePage = createPageComposer(playbook, contentCatalog, uiCatalog, env)
   pages.forEach((page) => composePage(page, contentCatalog, navigationCatalog))

And your ask of more documentation is totally legitimate, we need to work on this in the future.

Jean-Marc