Skip to content

documentation search bar#8

Merged
terminator356 merged 13 commits into
muse-sequencer:masterfrom
fiumals:master
Jul 15, 2026
Merged

documentation search bar#8
terminator356 merged 13 commits into
muse-sequencer:masterfrom
fiumals:master

Conversation

@fiumals

@fiumals fiumals commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

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

image image

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:

  • It relies on a search_index.json file in the same directory as the other html files, which contains the text contents for most of the html files in that same directory, this json file gets fetched when on search.html with javascript
  • The search_index.json is generated via the python script in docs/util_scripts/generate_search_index.py, which currently needs to be ran manually when an article is modified
  • i also tampered with some core css rules to fix some margins in the mobile design but generally everything looks almost the same i think

let me know if anything needs adjusting!

fiumals added 6 commits April 13, 2026 01:10
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)
@terminator356

Copy link
Copy Markdown
Member

Hi sorry for the delay. Busy few days.

Just a quick question:
How does all of this affect adding new content?
If I add new text, or a new heading, will I have to do anything more?
Should it 'just work'?

Thanks.

@fiumals

fiumals commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

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

@terminator356

Copy link
Copy Markdown
Member

Sure that would be great.

If no success, some clear instructions on what to do after a modification would be good.
Not sure where they could reside. Top code folder README.wiki?
On the documentation site itself?
If I recall there is a section 'helping out', or something like that, which describes how to edit the content,
how to clone it, edit it, push etc.
That might be a great place to append these new instructions.

I'll wait a bit to see what you find.

fiumals and others added 7 commits May 1, 2026 16:29
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
@fiumals

fiumals commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

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 :)

@terminator356

Copy link
Copy Markdown
Member

Oh dear. I've just discovered that I've not been notified of things lately. PRs, conversations etc.
So sorry for that. You must be wondering WTF.
I came to check in, to ask if you had any luck and, well here we are.
It's late now but I'll get to it soon.
Thanks.

@fiumals

fiumals commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

no worries! tbh i thought you were just taking a break which would also have been understandable!

@terminator356

Copy link
Copy Markdown
Member

In 'Build and Deployment' I have switched to GitHub actions.
It says it is currently using two workflows: 'Github Pages Jekyll' and 'Static HTML'.
There are several other suggested workflows I can choose from
such as 'C/C++ with Make' or 'CMake based, multi-platform projects'.

Any suggestions? OK to leave it as is or change it?

I hope this does not affect some of the other workflows we might have, such as 'Mark and close stale issues'.
I hope they just continue to work. I don't know much about all of this stuff.

@fiumals

fiumals commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Sorry i forgot to mention! The active workflow would have to be the one in .github/workflows/deploy.yml, but since that file isn't in the branch yet it cannot be detected, so i think that's probably why Github Pages Jekyll and Static HTML show up there, but none of those should be active as they may conflict with the new one in .github/workflows/deploy.yml.

As for if it may interfere, the 'Mark and close stale issues' workflow is in the app repository, but this one is strictly for the website so it should be fine I believe! It should not affect anything in the other repository

So you would probably have to make sure no other deployment workflow is active and then merge, the workflow should run on its own without manual activation, as long as GitHub actions is selected in build and deployment, if i'm not mistaken!

@terminator356 terminator356 merged commit dc3942e into muse-sequencer:master Jul 15, 2026
@terminator356

Copy link
Copy Markdown
Member

I hope that worked.
There is no way to 'remove' the workflows, I think all of them are always 'just there'.
Let me know if it worked.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants