Git Product home page Git Product logo

Comments (10)

tbugfinder avatar tbugfinder commented on May 30, 2024 1

Will do and certainly will need some guidance :-)

from antora-lunr.

tbugfinder avatar tbugfinder commented on May 30, 2024

I was able to extend search.css and search.js with the version field as a left column. 🥳
Grouping based on the version would be execellent, though.

from antora-lunr.

rorokaloom avatar rorokaloom commented on May 30, 2024

I was able to extend search.css and search.js with the version field as a left column. 🥳
Grouping based on the version would be execellent, though.

How were you able to achieve this, the version field as a left column?

from antora-lunr.

tbugfinder avatar tbugfinder commented on May 30, 2024

Hi,
this PR within the project itself includes the changes.
opendevstack/ods-documentation#59

from antora-lunr.

tbugfinder avatar tbugfinder commented on May 30, 2024

Grouping comparable to algolia results would be even better.

from antora-lunr.

ggrossetie avatar ggrossetie commented on May 30, 2024

Thanks for sharing!

Since it only requires a few changes to CSS and JS, I think we could support this feature out-of-the-box using an option to enable/disable it.

What do you think @tbugfinder? Would you like to submit a pull request?

from antora-lunr.

tbugfinder avatar tbugfinder commented on May 30, 2024

Should the option be set within the generate process and passed into the index file or rather be a configuration option within supplemental_ui ?

from antora-lunr.

ggrossetie avatar ggrossetie commented on May 30, 2024

@tbugfinder Did you have time to group results per version?

Should the option be set within the generate process and passed into the index file or rather be a configuration option within supplemental_ui ?

It depends if we need to change how the index is generated or not.
If we can work with the same index file then we can add an option here:

https://github.com/Mogztter/antora-lunr/blob/2b347f3786a05071e3d4470fe8b107b52f41f858/supplemental_ui/partials/footer-scripts.hbs#L4

Something like:

data-multi-versions=true

from antora-lunr.

myii avatar myii commented on May 30, 2024

Thanks for sharing your method, @tbugfinder. I was able to use it to dig a little deeper into what else could be possible.

Grabbed a portion from my site's search-index.js:

"/users-formula/1.46.0/README.html":{
    "text":"Formula to configure users via pillar. See the full SaltStack Formulas installation and usage instructions. If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section. If you want to use this formula, please pay attention to the FORMULA file and/or git tag, which contains the currently released version. This formula is versioned according to Semantic Versioning. See Formula Versioning Section for more details. Commit message formatting is significant!! Please see How to contribute for more details. Configures a user’s home directory, group, the user itself, secondary groups, and associated keys. Also configures sudo access, and absent users. Ensures the sudo group exists, the sudo package is installed and the sudo file is configured. Ensures the bashrc file exists in the users home directory. Sets 'manage_bashrc: True' in pillar per user. Defaults to False. Ensures the profile file exists in the users home directory. Sets 'manage_profile: True' in pillar per user. Defaults to False. Ensures the vimrc file exists in the users home directory. Sets 'manage_vimrc: True' in pillar per user. Defaults to False. This depends on the vim-formula being available and pillar users:use_vim_formula: True. Permits the abitrary management of files. See pillar.example for configuration details. In order to separate actual user account definitions from configuration the pillar users-formula was introduced: users: myuser: # stuff users-formula: lookup: root_group: toor shell: '/bin/zsh' Linux testing is done with kitchen-salt. Ruby Docker $ gem install bundler $ bundle install $ bin/kitchen test [platform] Where [platform] is the platform name defined in kitchen.yml, e.g. debian-9-2019-2-py3. Creates the docker instance and runs the template main state, ready for testing. Runs the inspec tests on the actual instance. Removes the docker instance. Runs all of the stages above in one go: i.e. destroy + converge verify + destroy. Gives you SSH access to the instance for manual testing.",
    "title":"users-formula",
    "component":"users-formula",
    "version":"1.46.0",
    "name":"README",
    "url":"/users-formula/1.46.0/README.html",
    "titles":[
        {"text":"1. General notes","id":"_general_notes"},
        {"text":"2. Contributing to this repo","id":"_contributing_to_this_repo"},
        {"text":"3. Available states","id":"_available_states"},
        {"text":"3.1. users","id":"_users"},
        {"text":"3.2. users.sudo","id":"_users_sudo"},
        {"text":"3.3. users.bashrc","id":"_users_bashrc"},
        {"text":"3.4. users.profile","id":"_users_profile"},
        {"text":"3.5. users.vimrc","id":"_users_vimrc"},
        {"text":"3.6. users.user_files","id":"_users_user_files"},
        {"text":"4. Overriding default values","id":"_overriding_default_values"},
        {"text":"5. Testing","id":"_testing"},
        {"text":"5.1. Requirements","id":"_requirements"},
        {"text":"5.2. bin/kitchen converge","id":"_binkitchen_converge"},
        {"text":"5.3. bin/kitchen verify","id":"_binkitchen_verify"},
        {"text":"5.4. bin/kitchen destroy","id":"_binkitchen_destroy"},
        {"text":"5.5. bin/kitchen test","id":"_binkitchen_test"},
        {"text":"5.6. bin/kitchen login","id":"_binkitchen_login"}
    ]
}

And then used it to play around with the doc.title, doc.component, doc.version, doc.name and even the doc.url. Found our own little sweet spot based on this:

    var documentHitTitle = document.createElement('div')
    documentHitTitle.classList.add('search-result-document-hit-title')
    documentHitTitle.innerText = doc.component + " " + doc.version + "\n" + doc.title + " [" + doc.name + "]"

Which ends up with this result:

Screenshot at 2021-05-07 10-34-06

from antora-lunr.

ggrossetie avatar ggrossetie commented on May 30, 2024

Development continues on https://gitlab.com/antora/antora-lunr-extension/

from antora-lunr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.