docs: update options table in README and keep up-to-date with commit hook (#2427)

* Update options table in README and keep up-to-date with commit hook

* Separate multiple options with a newline

* remove the old javascript version
This commit is contained in:
Joe Rickerby
2025-05-28 15:38:53 -04:00
committed by GitHub
parent c41b47f7c2
commit 7e099863cd
4 changed files with 139 additions and 60 deletions
-34
View File
@@ -1889,40 +1889,6 @@ Some options support placeholders, like `{project}`, `{package}` or `{wheel}`, t
}
}
// write the markdown table for the README
var markdown = ''
markdown += '| | Option | Description |\n'
markdown += '|---|--------|-------------|\n'
var prevHeader = null
for (var i = 0; i < headers.length; i += 1) {
var header = headers[i];
var headerOptions = options[header];
for (var j = 0; j < headerOptions.length; j += 1) {
var option = headerOptions[j];
if (j == 0) {
markdown += '| **'+header+'** '
} else {
markdown += '| '
}
var optionNames = option.name.trim().split(', ')
var url = 'https://cibuildwheel.pypa.io/en/stable/options/#'+option.id;
var namesMarkdown = $.map(optionNames, function(n) {
return '[`'+n+'`]('+url+') '
}).join(' <br> ')
markdown += '| '+namesMarkdown+' '
markdown += '| '+option.description.trim()+' '
markdown += '|\n'
}
}
console.log('readme options markdown\n', markdown)
// add the option tags to each heading
$('.rst-content h3')
.each(function (i, el) {