mirror of
https://github.com/caddyserver/website.git
synced 2025-04-20 20:16:16 -04:00
New download page, better JSON/module docs
This commit is contained in:
parent
09c3a73299
commit
5c3a67692e
8 changed files with 277 additions and 217 deletions
|
@ -9,7 +9,7 @@ if (moduleID) {
|
|||
$(function() {
|
||||
$('#module-docs-container').show();
|
||||
$('h1').text("Module "+moduleID);
|
||||
beginRendering(json.result);
|
||||
beginRendering(json.result, moduleID);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
|
@ -23,10 +23,17 @@ if (moduleID) {
|
|||
$table = $('#module-list');
|
||||
for (modID in moduleList) {
|
||||
var val = moduleList[modID];
|
||||
|
||||
// refine a short preview of the module's docs
|
||||
let shortDoc = truncate(val.doc, 200);
|
||||
if (shortDoc && shortDoc.indexOf(modID) === 0) {
|
||||
shortDoc = shortDoc.substr(modID.length).trim();
|
||||
}
|
||||
|
||||
var standard = isStandard(val.type_name);
|
||||
var $tr = $('<tr/>');
|
||||
$tr.append('<td><a href="./'+modID+'" class="module-link">'+modID+'</a>'+(standard ? '' : ' '+nonStandardFlag)+'</td>');
|
||||
$tr.append('<td>'+markdown(truncate(val.doc, 200))+'</td>');
|
||||
$tr.append($('<td/>').text(shortDoc));
|
||||
$table.append($tr);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue