documentation search bar#8
Conversation
added search.html for search results, added mini search bar to the sidebar and replaced Return to homepage with the logo and MusE Documentation text
added the searchbar to the spanish translation as well, search works by fetching the contents of the search_index.json files which are generated via the python script at docs/util_scripts/generate_search_index.py, this script indexes the articles with the class "articlelink" in the contents.html file
added a comment explaining a little bit of what it does and made it accept a directory as an argument too
to make it get the title from its text in contents.html instead of the article's first h1 element (i should have thought about this before)
|
Hi sorry for the delay. Busy few days. Just a quick question: Thanks. |
|
Hey! No problem, I figured you must be busy with other stuff. As of now anytime you edit text or add new entries to the sidebar, the search_index.json needs to be updated by running a python script i wrote in docs/util_scripts/generate_search_index.py (should be ran from inside /docs directory), but aside from that nothing else should be needed afaik. When making changes you would also need to commit that updated search_index.json file to have up to date search results though. I think it might be possible to automate updating the search index with github actions but to be honest I don't know much about how to use them yet, If you prefer I could look into that though! It might be more convenient |
|
Sure that would be great. If no success, some clear instructions on what to do after a modification would be good. I'll wait a bit to see what you find. |
also changed the index generation script to work regardless of where it was executed from, and added instructions on the wikiedit on how to update the search indexes manually (though the workflow should take care of that)
the bot wasn't commiting it
…he index for hte english one
|
Hello! i looked into workflows today and made one that takes care of the search generation when you submit any changes, i also set it to commit the generated index to the repository so that when you pull the changes offline the search is up to date when running the site locally as well. I tested it by modifying some files myself without manually generating the search_index, and it seems to work fine, the search gets updated on its own, no extra steps should be needed now when modifying the wiki. I did add a section in "Editing this Wiki", explaining how to generate the search_index manually, but normally you wouldn't need to do so. I believe you would have to make sure that the build and deployment source in the repository settings is set to "github actions" instead of "deploy from a branch" before merging though let me know if anything else! I'd be glad to help :) |
hello :)
I thought it would be useful to have a search bar in the documentation to search all articles at once for a word or phrase, so i've been working on one, it looks like this
Also replaced the "Return to Homepage" link with the MusE Sequencer logo and title similar to the homepage, when clicked it still does return to the homepage though
A few things:
let me know if anything needs adjusting!