Comments (10)
Will do and certainly will need some guidance :-)
from antora-lunr.
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.
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.
Hi,
this PR within the project itself includes the changes.
opendevstack/ods-documentation#59
from antora-lunr.
Grouping comparable to algolia results would be even better.
from antora-lunr.
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.
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.
@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:
Something like:
data-multi-versions=true
from antora-lunr.
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:
from antora-lunr.
Development continues on https://gitlab.com/antora/antora-lunr-extension/
from antora-lunr.
Related Issues (20)
- Docker support? HOT 5
- The footer-scripts.hbs from supplemental-ui requires updated HOT 5
- Chinese language support HOT 7
- Readme update: Building site on Windows HOT 2
- Provide this library as an Antora 3 pipeline extension HOT 7
- Remove header from generate-index HOT 1
- The search box doesn't show up HOT 5
- If the site URL is set, only use the pathname segment HOT 2
- Mention the dedicated site generator in the README HOT 2
- Version bump of lunr.js to 2.3.8 HOT 3
- Correlate titles with the search results HOT 3
- Translate README to .adoc HOT 2
- Linter errors when used with Antora default UI HOT 11
- Package supplemental_ui files in the Node package
- Use relative paths, not the site url HOT 19
- site.url is missing in the generated search index HOT 5
- Index ignores site.url and always creates relative links HOT 3
- How to support other languages? HOT 9
- Gitlab integration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from antora-lunr.