This commit is contained in:
mipmip 2024-04-26 18:01:16 +00:00
parent 3b66c253e8
commit a953b012b0
17 changed files with 33 additions and 557 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
result

View File

@ -1,60 +0,0 @@
# CHANGELOG
## Next version
- keyboard (tab) navigation (thanks to github.com/hallundbaek)
- better result sorting (thanks to github.com/hallundbaek)
- style improvements
- native options export
- improve example and descriptions layout
- move to extranix.com
- prepare ethical ads
## Version 1.4
- featuring dark mode
- fix parsing bug causing wrong search results
## Version 1.3
- new logo
- remove animations
- sticky search field
- sticky table headers
- sticky footer
- hide advanced search options
- change menu items
- multiple minor layout changes
## Version 1.2
- preserve links in declared_by
- add favicon
- show example when in `<code>` element
- remove proto from title
- github action parser working
## Version 1.1
- [x] hover plus handicon row
- [x] search improvements
- [x] allow enter
- [x] read url query string
## Version 1
- [x] finish nokogiri
- [x] write to json
- [x] make search front end
- [x] write last updated
- [x] reference to home manager and appendix page
- [x] github actions
- [x] bug <name> filtered out
- [x] improve style
- [x] cleanup/reorganize
- [x] logo
- [x] footer/header like the NUR
- [x] stats
- [x] onclick show complete listing

201
LICENSE
View File

@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,21 +0,0 @@
# Home Manager Options Search
## Home Manager Options Search has moved
The new location is <a href="https://home-manager-options.extranix.com/">HOME-MANAGER-OPTIONS.EXTRANIX.COM</a>
## Please update your bookmarks
Find [home manager](https://github.com/nix-community/home-manager) options quickly.
![](images/homemanageroptionsearch.gif)
## Contribute
- Please use the issue tracker or fork this site for PR's
## Credits
- Powered by the [Nix Community](https://nix-community.org/)
- [JS Search](https://github.com/bvaughn/js-search), efficient, client-side search library for JavaScript and JSON objects
- Header inspired by the [DocDock](https://docdock.vjeantet.fr/) Hugo Theme.

1
categories/index.xml Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Categories on Home Manager - Option Search</title><link>https://home-manager-options.extranix.com/categories/</link><description>Recent content in Categories on Home Manager - Option Search</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://home-manager-options.extranix.com/categories/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

View File

@ -56,9 +56,18 @@ header {
text-decoration: none; }
header .logo {
min-width: 295px;
font-size: 100%; }
font-size: 100%;
}
header .logo a,
header .logo a:visited {
color:white;
font-size: 120%;
font-weight: bold;
}
header .logo * {
vertical-align: middle; }
vertical-align: middle;
}
header .logo img {
height: 32px;
margin-right: 0.5rem; }
@ -192,7 +201,7 @@ article > aside {
html,
body {
height: 100%;
height: 100%;
}
html {
@ -770,7 +779,7 @@ table.nur-stats tr td{
table {
text-align: left;
position: relative;
border-collapse: collapse;
border-collapse: collapse;
}
th {
background: white;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,174 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home Manager - Option Search</title>
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link rel="search" type="application/opensearchdescription+xml" title="Home Manager - Option Search" href="opensearch.xml" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script async src="https://umami.pimsnel.com/script.js" data-website-id="8e970d59-b517-4ba6-9b92-207e7dbdb4b1"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link href="css/nucleus.css" rel="stylesheet">
<link href="css/style-nix.css" rel="stylesheet">
<link rel="stylesheet" href="css/style-q2.css">
<script async src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
</head>
<body>
<div id="eadiv" data-ea-publisher="extranixcom" data-ea-type="text"></div>
<header>
<div id="lastUpdateElement" style="position:absolute; line-height: 11px; right: 37px;top:59px;"></div>
<div class="logo">
<a class="baselink" href="./"> <img src="images/home-manager-option-search2.png"></a>
</div>
<nav class="shortcuts">
<li style="padding-top:10px;">
<a href="https://nix-community.github.io/home-manager/" rel="noopener">
<i class="fa fa-book"></i>&nbsp;<label>HM&nbsp;Documentation</label>
</a>
</li>
<li style="padding-top:10px;">
<a href="https://github.com/mipmip/home-manager-option-search" rel="noopener">
<i class="fa fa-github"></i> <label>Source</label>
</a>
</li>
<li style="margin-left:9px;padding-top:14px;">
<iframe style="width:51px;" src="https://ghbtns.com/github-btn.html?user=mipmip&repo=home-manager-option-search&type=star&count=false&text=true" frameborder="0" scrolling="0" width="150" height="20" title="GitHub"></iframe>
</li>
</nav>
</header>
<div class="xcontainer" style="padding-top:70px;">
<!-- Modal -->
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body" id="myModalBody">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div id="searchform" xstyle="background-color: white;top:54px;position:sticky;">
<form method="get" action="?" onSubmit="searchEnter()">
<div class="form-group">
<label for="searchInput">
Option Search
<span style="font-weight:normal;font-size:smaller;"> (<span><span id="optionCountBadge" style="font-weight:normal;font-size:smaller;" xclass="badge"></span><span style="font-weight:normal;font-size:smaller;">)<span>
</label>
<input class="form-control" type="search" id="searchInput" autofocus="autofocus" placeholder="Search.. e.g. vim">
</div>
<div class="form-group">
<label for="release">
Home Manager release
</label>
<select id="releaseSelect">
<option value="master">unstable</option>
<option value="release-23.11">23.11</option>
<option value="release-23.05">23.05</option>
<option value="release-22.11">22.11</option>
</select>
<!--
<label for="advcheck">
search options
<input id="advcheck" type="checkbox" data-toggle="collapse" data-target="#advanced" />
-->
</div>
</form>
<div class="collapse" id="advanced" >
<ul class="list-inline" style="margin-top:5px;margin-bottom:5px;">
<li>Search in</li>
<li><input type="checkbox" checked id="indexOnTitleCheckbox"> Title</li>
<li><input type="checkbox" checked id="indexOnDescriptionCheckbox"> Description</li>
<li>Strategy</li>
<li>
<select id="indexStrategySelect" style="margin-bottom:0">
<option value="JsSearch.AllSubstringsIndexStrategy">All substrings</option>
<option value="JsSearch.ExactWordIndexStrategy">Exact match</option>
<option value="JsSearch.PrefixIndexStrategy" selected>Prefix matching</option>
</select>
</li>
</div>
<table id="indexedOptionsTableHeader" style="margin-bottom:0;" class="table table-striped table-condensed hidden">
<thead>
<tr>
<th>Title</th>
<th class="phonehide">Description</th>
<th class="phonehide">Type</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<table id="indexedOptionsTable" class="table table-striped table-condensed hidden">
<!--
<thead>
<tr>
<th>Title</th>
<th>Description</th>
<th>Type</th>
</tr>
</thead>
-->
<tbody>
</tbody>
</table>
<div id="loadingProgressBar" class="progress">
<div class="progress-bar progress-bar-striped active"
role="progressbar"
aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;">
Loading option data...
</div>
</div>
</div>
<footer class=" navbar-fixed-bottom" >
<div >
<p>
Powered by the <a href="https://nix-community.org/">Nix Community</a> |
<a href="https://github.com/mipmip/home-manager-option-search#credits">Credits</a> |
<a href="https://nix-community.github.io/home-manager/">Home Manager Documentation</a>
</p>
<p>
Made with ❤️ by <a href="https://github.com/mipmip">Pim Snel</a>
</p>
</div>
</footer>
<!--<script type="text/javascript" src="https://rawgit.com/kristopolous/Porter-Stemmer/master/PorterStemmer1980.min.js"></script>-->
<!--<script type="text/javascript" src="https://unpkg.com/js-search@1.3.7/dist/umd/js-search.min.js"></script>-->
<script type="text/javascript" src="https://unpkg.com/js-search@2.0.1/dist/umd/js-search.min.js"></script>
<script type="text/javascript" src="js/script.js?version=2024-03-23"></script>
</body>
</html>
<!doctype html><html lang=en><head><meta name=generator content="Hugo 0.125.3"><meta charset=UTF-8><title>Home Manager - Option Search</title>
<link rel="shortcut icon" href=images/favicon.png type=image/x-icon><link rel=stylesheet href=https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css integrity=sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u crossorigin=anonymous><link rel=stylesheet href=https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css integrity=sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp crossorigin=anonymous><meta name=description content><meta name=keywords content><link rel=search type=application/opensearchdescription+xml title="Home Manager - Option Search" href=opensearch.xml><script src=https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js></script><script src=https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js integrity=sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa crossorigin=anonymous></script><link rel=stylesheet href=https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css><link href=css/nucleus.css rel=stylesheet><link href=css/style-nix.css rel=stylesheet><link rel=stylesheet href=css/style-q2.css><script async src=https://umami.pimsnel.com/script.js data-website-id=8e970d59-b517-4ba6-9b92-207e7dbdb4b1></script><script async src=https://media.ethicalads.io/media/client/ethicalads.min.js></script></head><body><div id=eadiv data-ea-publisher=extranixcom data-ea-type=text></div><header><div id=lastUpdateElement style=position:absolute;line-height:11px;right:37px;top:59px></div><div class=logo><a class=baselink href=./><img src=images/home-manager-option-search2.png></a></div><nav class=shortcuts><li style=padding-top:10px><a href=https://nix-community.github.io/home-manager/><i class="fa fa-book"></i> <label>HM&nbsp;Documentation</label></a></li><li style=padding-top:10px><a href=https://github.com/mipmip/home-manager-option-search><i class="fa fa-github"></i> <label>Source</label></a></li><li style=margin-left:9px;padding-top:14px><iframe src="https://ghbtns.com/github-btn.html?user=mipmip&repo=home-manager-option-search&type=star&count=true&text=false" style=width:101px frameborder=0 scrolling=0 width=150 height=20 title=GitHub></iframe></li></nav></header><div class=xcontainer style=padding-top:70px><div class=modal id=myModal tabindex=-1 role=dialog aria-labelledby=myModalLabel><div class="modal-dialog modal-lg" role=document><div class=modal-content><div class=modal-header><button type=button class=close data-dismiss=modal aria-label=Close><span aria-hidden=true>&#215;</span></button><h4 class=modal-title id=myModalLabel>Modal title</h4></div><div class=modal-body id=myModalBody>...</div><div class=modal-footer><button type=button class="btn btn-default" data-dismiss=modal>Close</button></div></div></div></div><div id=searchform xstyle="background-color: white;top:54px;position:sticky;"><form method=get action=? onsubmit=searchEnter()><div class=form-group><label for=searchInput>Option Search
<span style=font-weight:400;font-size:smaller>(<span><span id=optionCountBadge style=font-weight:400;font-size:smaller xclass=badge></span><span style=font-weight:400;font-size:smaller>)<span>
</label><input class=form-control type=search id=searchInput autofocus placeholder="Search.. e.g. vim"></div><div class=form-group><label for=release>Home Manage Release
</label><select id=releaseSelect><option value=master>unstable</option><option value=release-23.11>23.11</option><option value=release-23.05>23.05</option><option value=release-22.11>22.11</option></select></div></form><div class=collapse id=advanced><ul class=list-inline style=margin-top:5px;margin-bottom:5px><li>Search in</li><li><input type=checkbox checked id=indexOnTitleCheckbox> Title</li><li><input type=checkbox checked id=indexOnDescriptionCheckbox> Description</li><li>Strategy</li><li><select id=indexStrategySelect style=margin-bottom:0><option value=JsSearch.AllSubstringsIndexStrategy>All substrings</option><option value=JsSearch.ExactWordIndexStrategy>Exact match</option><option value=JsSearch.PrefixIndexStrategy selected>Prefix matching</option></select></li></div><table id=indexedOptionsTableHeader style=margin-bottom:0 class="table table-striped table-condensed hidden"><thead><tr><th>Title</th><th class=phonehide>Description</th><th class=phonehide>Type</th></tr></thead><tbody></tbody></table></div><table id=indexedOptionsTable class="table table-striped table-condensed hidden"><tbody></tbody></table><div id=loadingProgressBar class=progress><div class="progress-bar progress-bar-striped active" role=progressbar aria-valuenow=100 aria-valuemin=0 aria-valuemax=100 style=width:100%>Loading option data...</div></div></div><footer class=navbar-fixed-bottom><div><p>Powered by the <a href=https://nix-community.org/>Nix Community</a> |
<a href=https://github.com/mipmip/home-manager-option-search#credits>Credits</a> |
<a href=https://nix-community.github.io/home-manager/>Home Manager Documentation</a></p><p>Made with ❤️ by <a href=https://github.com/mipmip>Pim Snel</a> - © 2022-2024</p></div></footer><script type=text/javascript src=https://unpkg.com/js-search@2.0.1/dist/umd/js-search.min.js></script><script type=text/javascript src="js/script.js?version=2024-03-23"></script></body></html>

1
index.xml Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Home Manager - Option Search</title><link>https://home-manager-options.extranix.com/</link><description>Recent content on Home Manager - Option Search</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://home-manager-options.extranix.com/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

View File

@ -21,7 +21,6 @@ var docOnload = function(){
searchOptions(query);
$("#advcheck").prop("checked", false);
// $("#advcheck").removeAttr("checked");
}
indexOnDescriptionCheckbox.onchange = rebuildAndRerunSearch;
@ -193,8 +192,8 @@ var searchOptions = function(query) {
// No reason to index beyond result of lastIndex +aIndex + term.length,
// as a would come first in that case.
const bIndex = bConcat
.slice(lastIndex, lastIndex + aIndex + term.length)
.indexOf(term);
.slice(lastIndex, lastIndex + aIndex + term.length)
.indexOf(term);
// Not found in b, a must come first
if (bIndex == -1) return -1;
@ -237,20 +236,12 @@ searchInput.oninput = function() {
releaseSelect.onchange = function(){
const query = searchInput.value;
const release = releaseSelect.selectedOptions[0].value;
const query = searchInput.value;
const release = releaseSelect.selectedOptions[0].value;
setSearchQueryToUrlParam(query, release);
setSearchQueryToUrlParam(query, release);
//window.location.reload(false);
window.location.replace(newUrl);
//newSearch();
//var release = releaseSelect.selectedOptions[0].value;
//xmlhttp.open('GET', 'data/hm-options-'+release+'.json', true);
//xmlhttp.send();
window.location.replace(newUrl);
}
var updateOptionCount = function(numOptions) {
@ -291,5 +282,5 @@ const urlParams = new URLSearchParams(window.location.search);
const release = urlParams.get('release') ?? 'master';
document.getElementById('releaseSelect').value = release;
xmlhttp.open('GET', 'data/hm-options-'+release+'.json', true);
xmlhttp.open('GET', 'data/options-'+release+'.json', true);
xmlhttp.send();

View File

@ -1,15 +0,0 @@
#!/usr/bin/env sh
# Copyright 2024 Pim Snel <post@pimsnel.com
# License: MIT
if [ -z $HM_RELEASE ]; then
HM_RELEASE=master
fi
echo "building Home Manager options from ${HM_RELEASE}"
rm -Rf result
nix build github:nix-community/home-manager/${HM_RELEASE}#docs-json --no-write-lock-file
rm -f ./data/hm-options-${HM_RELEASE}.json
ruby ./scripts/parse_options-json.rb

View File

@ -1,63 +0,0 @@
# Copyright 2024 Pim Snel <post@pimsnel.com
# License: MIT
require 'json'
require 'pp'
if not ENV['HM_RELEASE']
ENV['HM_RELEASE'] = "master"
end
p ENV['HM_RELEASE']
in_file = File.read("./result/share/doc/home-manager/options.json")
parsed = JSON.parse(in_file)
def isLiteralExpression(val, key)
if val.key? key and val[key].instance_of? Hash and val[key].key? "_type" and val[key]['_type'] == 'literalExpression'
true
else
false
end
end
def getValFor(val, key)
if isLiteralExpression(val, key)
val[key]['text']
elsif val.key? key
val[key]
else
""
end
end
def parseVal(val)
val['example'] = getValFor(val, 'example')
val['default'] = getValFor(val, 'default')
val
end
options_arr = []
parsed.each do | name, val |
next if name == '_module.args'
val['title'] = name
val = parseVal(val)
options_arr << val
end
outobj = {}
time = Time.new
outobj["last_update"] = time.utc.strftime("%B %d, %Y at %k:%M UTC")
outobj["options"] = options_arr
filename = "data/hm-options-#{ENV['HM_RELEASE']}.json"
File.open(filename,"w") do |f|
f.write(outobj.to_json)
end
print "Finished parsing home manager options."

1
sitemap.xml Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://home-manager-options.extranix.com/categories/</loc></url><url><loc>https://home-manager-options.extranix.com/</loc></url><url><loc>https://home-manager-options.extranix.com/tags/</loc></url></urlset>

1
tags/index.xml Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tags on Home Manager - Option Search</title><link>https://home-manager-options.extranix.com/tags/</link><description>Recent content in Tags on Home Manager - Option Search</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://home-manager-options.extranix.com/tags/index.xml" rel="self" type="application/rss+xml"/></channel></rss>