-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Add search option to Coffeescript docs #5058
base: main
Are you sure you want to change the base?
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rebase
@@ -42,6 +42,7 @@ | |||
"babel-core": "6.26.3", | |||
"babel-preset-env": "1.6.1", | |||
"babel-preset-minify": "0.4.0", | |||
"cheerio": "^1.0.0-rc.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the latest version of this?
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -42,6 +42,7 @@ | |||
"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.
@@ -42,6 +42,7 @@ | |||
"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:site
task, search catalogs are build by parsing the content.To be able to build the hierarchy of the sections, I've added a
documentation/structure.coffee
which 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/sections
className
<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.