Giter Site home page Giter Site logo

plugin-search's People

Contributors

jpreynat avatar samypesse avatar soreine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

plugin-search's Issues

no pagination

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

highlight hits

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

page does not open if it's among search hits

Hi,

Steps to replicate the issue:

  • Navigate to a page
  • Enter a search term that occurs in the previously navigated page
  • The page appears among the search results, but when clicked, it will not open.

Thanks,
Imre

Is this plugin still maintained?

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.)

Accessibility: Add label to the Search Input Field

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.

Emojis break the search

For example, if the query includes a result containing this text "๐Ÿ”ฝ" the search will just error.

to find the search plugin in the gitbook desktop

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.

GLOSSARY.md broken on gitbook serve when plugin gitbook-search is enabled

What is the current behavior?

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)

What is the expected behavior?

No crash ;)

I tried an empty file. It crashes. A minimal file with only 1 entry. It crashes.
NO file, it runs.

Temporary fix:

-search

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)

Disabling plugin-search hides plugin-fontsettings

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.

Plugin does not work with _layouts directory

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.