Comments (13)
@ryanlelek
Sorry for late, if you want add search support for Chinese, use 'codepiano/lunr.js' replace official lunr.js dependency in module 'rateno-core', not 'rateno' itself, like this:
"lunr": "codepiano/lunr.js",
It seems fine.
from raneto.
Same here. Seems like lunr
doesn't support utf-8.
from raneto.
Same for Russian :(
from raneto.
It seems i have found the way how to add support for languages other than English.
For that i have installed the lunr-languages package:
[~/Raneto-0.6.0]$ npm install lunr-languages
And add a few lines to node_modules/raneto-core/raneto.js
:
[~/Raneto-0.6.0]$ diff node_modules/raneto-core/raneto.js node_modules/raneto-core/raneto.js.orig
10,11d9
< require('../lunr-languages/lunr.stemmer.support.js')(lunr);
< require('../lunr-languages/lunr.ru.js')(lunr);
199d196
< this.use(lunr.ru);
from raneto.
Nice job man!
But still, no Chinese support in lunr-languages
:(
from raneto.
Yes really, I have missed that point. Then perhaps you might try to replace default lunr package with that one - https://github.com/codepiano/lunr.js?
from raneto.
@bborysenko, дай бог тебе здоровья =)
from raneto.
Chinese search support was mentioned in another issue that was closed, so I'll summarize it here.
@vyp said:
For Chinese searching, you will probably have to modify raneto to add support for lunr-languages: olivernn/lunr.js#91 (comment). But as you can see in that link, lunr-languages does not yet support Chinese.
Another potential option would be to try and replace the lunr that Raneto uses with https://github.com/codepiano/lunr.js, which seems like a Chinese version of lunr.js (found with the comment just below the previously linked comment). I haven't used this though, so I'm not sure if this only support Chinese, or supports both English and Chinese.
@codepiano replied:
My fork of lunr supports both English and Chinese.I use it to replace the original lunr repo in gitbook dependencies, and it works well.
...
I'll test whether it works well in Raneto when I have time. Raneto is a nice tool.
Looping you all in via mention so we can restart this and get a solution.
@LuxuryZhou, @shuhankuang, @nykma, @OneManOpsTeam, @in-in
from raneto.
Gitbook use lunr.js to build search index from original markdown files, store the index in a file,and load this file in web page.
If Raneto also uses lunr.js this way,maybe my fork version will also work.
from raneto.
@codepiano 我按照您的方案配置了lunr.js 和Raneto,nodejieba 也安装好了,但是搜索中文的时候,还是不能搜索中文,不造啥原因~,大神能帮忙集成一下,十分感谢~!
from raneto.
@codepiano @ryanlelek Thank OF provide such a good tool, replaced by the support of the Chinese lunr.js codepiano has successfully support Chinese search
from raneto.
Fixed in #246 by @Orhideous
from raneto.
@ZhangTongLe can you post step by step details about how to config Raneto to support Chinese keywords search ? Any help from you will be greatly appreciated.
from raneto.
Related Issues (20)
- Raneto-0.17.0 start fail HOT 2
- Feature Request: it would be cool if the category-meta file could apply to "Main articles" too
- How to use sub-folder more than 3 levels?
- Searching for quoted strings (ie `obj = {"a": 1}` ) or chars with markers that are present in code markdowns are not found
- Security Issue HOT 4
- Allow Images in Content Directory HOT 1
- TODO: Documentation Update
- ROADMAP: v0.19
- Page meta "description" tag is not present
- Bug: Markdown Editor vs Rendered HOT 1
- Bug: Saving Markdown Document HTML-encodes entities
- Strange 'undefined' in "Edit" link HOT 5
- Blockquotes? HOT 3
- Sanitize only potential XSS HTML code, rather than all HTML on submit of edit page HOT 4
- Backticks are replaced with ` in the editor HOT 2
- [feature request] Adding color support? HOT 2
- Netlify Support HOT 1
- [bug] Saving too much text causes 413 error
- 'Add Page' does not add new .md file HOT 3
- How I package it into a format suitable for Github Page HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raneto.