Skip to content
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

Attempt to add search functionality #86

Closed
wants to merge 14 commits into from
Closed

Attempt to add search functionality #86

wants to merge 14 commits into from

Conversation

zkamvar
Copy link
Contributor

@zkamvar zkamvar commented Aug 1, 2023

This is an attempt to address the search problem. This is paired with carpentries/sandpaper#495. It is most certainly not ready

To configure a lesson to test this (do not put this in production), fork it, and then add these lines to your config.yaml:

sandpaper: carpentries/sandpaper@enable-search
varnish: carpentries/varnish@use-search-2023
url: '[user].github.io/[repo]'

A current test lesson can be found at https://zkamvar.github.io/instructor-training/

2023-08-01

Test this out with carpentries/sandpaper@enable-search and carpentries/varnish@use-search-2023

I'm testing this in my fork of instructor training and I'm getting an error:

https://github.com/zkamvar/instructor-training/actions/runs/5732665782/job/15536034405

  Error in haystack[haystack$similar > 0, ] : 
    incorrect number of dimensions
  Calls: <Anonymous> ... <Anonymous> -> activate_navbar -> navbar_links_haystack
  

2023-08-02

Here is a demo (as of 2023-08-02, it works minimally): https://zkamvar.github.io/instructor-training/

One of the big challenges is that I built this using the "bootstrap 3" architecture of {pkgdown}. It now has an option to use bootstrap 5 where it expands the theming option so that people like me don't have to create new pkgdown templates to work.

The thing is, the switch between bs 3 and 5 is spread across the pkgdown infrastructure: https://github.com/search?q=repo%3Ar-lib%2Fpkgdown%20bs_version%20%3E%203&type=code

I've been able to get a basic search running and it works to a degree, but it is frustrating when certain terms do not show up. For example, if you search "pronouns" in instructor training, it says nothing showed up even though it's one of the names that's covered. This is because the code to make a page index searches for divs of class "section", but our callout divs are not "sections, so they aren't included in the index.

One way to address this is to add the "section" class to the callouts, but I'm not sure if that's appropriate. EDIT: I went ahead and applied the change in the sandpaper branch, but we'll see if it works.

@ErinBecker ErinBecker closed this May 17, 2024
@ErinBecker ErinBecker deleted the use-search-2023 branch May 17, 2024 16:32
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.

4 participants