gitbookio / plugin-search Goto Github PK
View Code? Open in Web Editor NEWSearch content in your book
License: Apache License 2.0
Search content in your book
License: Apache License 2.0
Hi,
When using lunr as backend, the search gives me for example 50 hits, but I can only see about a dozen or so, because there is no pagination on the search results page and cannot see all results.
Please enable pagination of search results.
Thanks,
Imre
Hi,
It would be great if search hits could be highlighted. Basically need to add something like a span
to them and then they could be styled with CSS.
Plugin search-pro
is an example.
Thanks,
Imre
A project I'm trying to help uses markdown. Is there a markdown-specific search index generator I'd need to change? Is the search query filtering in https://github.com/GitbookIO/plugin-search/blob/master/assets/search.js a place to start?
Hi,
Steps to replicate the issue:
Thanks,
Imre
Current lunr backend doesn't support Chinese. So I wrote one.
I have some pending fixes internally, but don't want to bother with a PR if nobody is maintaining that anymore.
(Namely, the throttling is completely broken.)
The search input box could use a label to convey meaning to users with assistive devices.
Something like:
_layouts/website/page.html
{% block search_input %}
<div id="book-search-input" role="search">
<label for="book-search-input-field" class="sr-only">{{ 'SEARCH_PLACEHOLDER'|t }}</label>
<input id="book-search-input-field" type="text" placeholder="{{ 'SEARCH_PLACEHOLDER'|t }}" />
</div>
{% endblock %}
This would resolve a WCAG 2.0/AA error and make GitBook more accessible.
For example, if the query includes a result containing this text "๐ฝ"
the search will just error.
Sorry for the novice question, but:
It says it's a default plugin in the Gitbook desktop, but I do not see it and can't manage to activate it.
What shall I do?
Thanks in advance for your time.
Launching gitbook serve with a GLOSSARY.md crashes.
$ gitbook -V
CLI version: 2.3.2
GitBook version: 3.2.3
# Ubuntu 16.04.5 LTS (Also tested on Debian 9 sid)
No crash ;)
I tried an empty file. It crashes. A minimal file with only 1 entry. It crashes.
NO file, it runs.
Temporary fix:
in the plugins section...
See output:
$ gitbook -d serve
Live reload server started on port: 35729
Press CTRL+C to quit ...
info: 15 plugins are installed
info: 14 explicitly listed
info: loading plugin "autocover"... OK
info: loading plugin "github"... OK
info: loading plugin "toc"... OK
info: loading plugin "anchors"... OK
info: loading plugin "alerts"... OK
info: loading plugin "advanced-emoji"... OK
info: loading plugin "image-class"... OK
info: loading plugin "livereload"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 30 pages
info: found 223 asset files
warn: "options" property is deprecated, use config.get(key) instead
warn: "options.generator" property is deprecated, use "output.name" instead
warn: "sections" property is deprecated, use page.content instead
warn: "contentLink" is deprecated, use "output.toURL()" instead
warn: "page.progress" property is deprecated
error: error while generating page "GLOSSARY.md":
TypeError: Cannot read property 'title' of null
TypeError: Cannot read property 'title' of null
at Object.page (/home/misp/misp-book/node_modules/gitbook-plugin-search/index.js:52:46)
at /home/misp/.gitbook/versions/3.2.3/lib/output/callHook.js:48:29
at /home/misp/.gitbook/versions/3.2.3/lib/utils/promise.js:22:20
at _fulfilled (/home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:834:54)
at /home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:863:30
at Promise.promise.promiseDispatch (/home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:796:13)
at /home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:604:44
at runSingle (/home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:137:13)
at flush (/home/misp/.gitbook/versions/3.2.3/node_modules/q/q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:61:11)
I noticed that if I disabled plugin-search
with
{
"plugins" : [ "-search"]
}
in my book.json
, even though gitbook serve
shows that the fontsettings
plugin is loaded, it doesn't really load.
I had to manually add fontsettings
to the plugin list to make it work.
{
"plugins" : [ "-search", "fontsettings"]
}
Is this the intended behavior? I don't think the 2 plugins should be in any way related / connected.
Using gitbook
3.0.3 and the default theme, the search plugin works fine.
If I create a _layouts
directory copying the contents from theme-default/_layouts
(with no modifications at all) then the search box does not appear anymore.
Any idea why?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.