dita bootstrap.lunr
5.3.4
dita bootstrap lunr搜索是DITA打開的工具包插件,可通過lunr.js搜索功能擴展DITA Bootstrap HTML輸出。
DITA Bootstrap Lunr搜索插件已使用DITA-OT 4.x進行了測試。使用最新版本以獲得最佳結果。
從項目網站dita-ot.org/download下載最新的發行包。
將包裝的內容提取到要安裝DITA-OT的目錄。
可選:將bin目錄的絕對路徑添加到路徑系統變量。
這定義了從命令行運行dita命令的必要環境變量。
有關詳細的安裝說明,請參見DITA-OT文檔。
dita install https://github.com/jason-fox/fox.jason.extend.css/archive/master.zip
dita install https://github.com/infotexture/dita-bootstrap/archive/master.zip
dita install https://github.com/infotexture/dita-bootstrap.lunr/archive/master.zipdita bootstrap lunr搜索插件使用node.js javascript運行時生成lunr.js搜索索引。因此,必須存在node.js才能成功生成索引。
要下載並安裝副本,請按照下載頁面上的操作系統說明。
要運行,請使用html5-bootstrap轉換並添加args.hdr參數。
PATH_TO_DITA_OT/bin/dita -f html5-bootstrap -o out -i PATH_TO_DITAMAP
--args.hdr=path/to/your-header.xml插件提供了帶有搜索框的樣本標頭文件:include/hdr.navbar.lunr.xml-核心標記可以在下面看到。
< li class = " nav-item d-flex align-items-center " >
< span class = " nav-link pe-2 " >
< i class = " bi bi-search " />
</ span >
< form class = " search-box position-relative me-auto " >
< input type = " search " class = " form-control " placeholder = " Search… " aria-label = " Search for… " dir = " auto " />
</ form >
</ li >您可以使用標準的dita-ot-action在LUNR搜索中運行。由於轉換需要node.js的功能,因此必須將其作為install過程的一部分安裝。另外,在用英語以外的語言創建文檔時,請確保在運行轉換之前設置了適當的locale ,以確保正確生成搜索索引。
name : Create DITA with Lunr Search (DE)
permissions :
contents : write
' on ' :
workflow_dispatch : null
jobs :
build-dita :
name : Build DITA
runs-on : ubuntu-latest
steps :
- name : Git checkout
uses : actions/checkout@v3
- name : Build HTML5 + Bootstrap
uses : dita-ot/[email protected]
with :
install : |
apt-get update -q
export DEBIAN_FRONTEND=noninteractive
apt-get install -qy --no-install-recommends nodejs
nodejs -v
locale-gen de_DE.UTF-8
LANG="de_DE.UTF-8"
LANGUAGE="de_DE:de"
LC_ALL="de_DE.UTF-8"
plugins : |
fox.jason.extend.css
dita-bootstrap
dita-bootstrap.lunr
project : .github/dita-ot/html.xml
- name : ' Deploy Documentation to GitHub Pages '
uses : JamesIves/[email protected]
with :
token : ${{ secrets.GITHUB_TOKEN }}
branch : gh-pages
folder : outoffline.mode啟用Lunr搜索與DITA Bootstrap離線模式一起使用 - 這需要安裝附加的插件。 Apache 2.0©2023 Jason Fox
該計劃包括以下未經許可獲得的其他軟件組件: