Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Search for iOS and Android inside the same docsify server #2091

Unanswered
adriandev78 asked this question in Q&A
Discussion options

Hi,

I'm currently trying to make search work withing a docsify setup which look like this:

-- docsify

 -- index.html
 -- _sidebar.md
 -- README.md
-- other .md files
 -- iOS
 -- README.md
 -- _sidebar.md
 -- other .md files
 -- Android
 -- README.md
 -- _sidebar.md
 -- other .md files

I'de like to configure search so that when I'm viewing the iOS/Android folders, it only search inside the respective directory.
When I'm viewing the root README.md from above, I'd like search to only work for files on that respective level (no iOS / Android folder .mds related results).

Is this possible with the current plugin ? And if not, is it easy to develop some custom functionality for the existing plugin to be able to achieve something like this ?

Any hints and ideas are highly appreciated,

You must be logged in to vote

Replies: 1 comment

Comment options

You should use the search plugin's pathNamespaces option. Here is an example:

`// Docsify
window.$docsify = {
...
search: 'auto',

// Search configuration parameters
search: {
 pathNamespaces: ['/iOS', '/Android'],
},

...
}`

Basically, Docsify will create multiple indexes for each search context (iOS, Android in your case) based on the prefixes specified in the pathNameSpaces param.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /