WIP: Add search option to Coffeescript docs#5058
WIP: Add search option to Coffeescript docs#5058zdenko wants to merge 8 commits intojashkenas:mainfrom
Conversation
64ce85c to
f8aca2d
Compare
…ace that initializes the index, so add new global initializeSearch function that it can call; load scripts from https; improve feedback in doc:site; style cleanup
Yep. Clearly, this is not the best approach, but since I had to combine all of the content, I figured it’s best to open PR earlier to discuss changes.
At first, I had just a simple method in
I think,
Yes, the search result should be well-formed HTML and not MD.
To build a search index, you need text. Parsing MD seems easier than passing HTML thru a bunch of regexes. But, as said, search results should be rendered as HTML.
I think I used that one, but I might mess up something 🤦♂️
Yes, I’m aware of these issues. I’m fixing them.
Sure, let me finish few things discussed here, and then run another review. |
|
Since changes from #5067 improved the structure of the document, I refactored few things in the last commit.
There are still some tasks on the to-do list:
|
| "babel-core": "6.26.3", | ||
| "babel-preset-env": "1.6.1", | ||
| "babel-preset-minify": "0.4.0", | ||
| "cheerio": "^1.0.0-rc.2", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Sohbeteuronet
left a comment
There was a problem hiding this comment.
I recently started using IRC again after a very long time. The also have a [URL=“https://www.forumkolik.net/“]forum[/URL] that is very informative. [URL="https://www.nazarsohbet.com/"]mobile chat rooms[/URL] provide a [URL=“https://www.sohbeteuro.net/“]friendly[/URL] and [URL=“https://www.seviyeli.net/“]accepting[/URL]
environment to those that are looking to engage in conversation.
I would recommend giving them a try.
| "babel-core": "6.26.3", | ||
| "babel-preset-env": "1.6.1", | ||
| "babel-preset-minify": "0.4.0", | ||
| "cheerio": "^1.0.0-rc.2", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| "babel-core": "6.26.3", | ||
| "babel-preset-env": "1.6.1", | ||
| "babel-preset-minify": "0.4.0", | ||
| "cheerio": "^1.0.0-rc.2", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.



This PR adds an offline search feature for docs (preview)
During the
doc:sitetask, search catalogs are build by parsing the content.To be able to build the hierarchy of the sections, I've added a
documentation/structure.coffeewhich contains the content tree (object).And, to avoid redundant work (i.e., parsing the markdown files), I use the same object to build the main content and sidebar navigation.
An element of the structure objects can have folowing keys:
id<String> requiredtitle<String> requiredhref<String> defaults to "#id"html[<String>, ...] a list of documents fromdocumentation/sectionsclassName<String> additional class attribute added to the link in the sidebarchildren[<Structure>,...] a nested structureThe search results are still not 100% perfect. Additional fine-tuning of the search library options are needed to get better results.
Also, some CSS look and feel changes of the new elements are probably needed as well.