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
该计划包括以下未经许可获得的其他软件组件: