Compare commits

...

4 Commits

Author SHA1 Message Date
Pim Snel
f5740ec6fe fix wrong select label 2024-04-16 22:01:44 +02:00
Pim Snel
12b2c51e7c add new version, CI work 2024-04-16 21:58:26 +02:00
Pim Snel
ebf87c8f86 cleanup 2024-04-16 21:42:01 +02:00
Pim Snel
fea3a76ddf add parser for 22.11 2024-04-16 21:37:25 +02:00
7 changed files with 33 additions and 34 deletions

View File

@ -15,32 +15,17 @@ jobs:
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: master-options
- name: extract-options-master (unstable)
run: ./scripts/build_hm_options.sh
- name: update gitignore
run: echo result > .gitignore
- name: release-options
- name: extract-options-release-23.11 (stable)
env:
HM_RELEASE: release-23.11
run: ./scripts/build_hm_options.sh
- name: release-options
env:
HM_RELEASE: release-23.05
run: ./scripts/build_hm_options.sh
#
# - name: master-options
# env:
# RELEASE: release-22.11
# run: ./scripts/build_hm_options.sh
#
# - name: master-options
# env:
# RELEASE: release-22.05
# run: ./scripts/build_hm_options.sh
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:

3
.gitignore vendored
View File

@ -2,4 +2,5 @@
.nix-gems
.bundle
result
data/hm-options*
data/hm-options-release-23.11.json
data/hm-options-master.json

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -87,10 +87,7 @@
<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>
<option value="release-22.05">22.05</option>
-->
</select>
<!--
<label for="advcheck">

View File

@ -10,6 +10,6 @@ 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
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

@ -13,24 +13,38 @@ 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
if val.key? "example"
val['example'] = val['example']['text']
else
val['example'] = ""
end
if val.key? "default"
val['default'] = val['default']['text']
else
val['default'] = ""
end
val = parseVal(val)
options_arr << val
end