You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
526 B
JavaScript

'use strict';
module.exports = function(header, contents) {
if (/^(?:module )?api$/i.test(header)) {
return "api";
} else if (/^events$/i.test(header)) {
return "events";
} else if (/^options$/i.test(header)) {
return "options";
} else if (/^(?:tips|notes)$/i.test(header)) {
return "notes";
} else if (/(?:usage|examples?)/i.test(header)) {
// FIXME: Detect API methods under 'usage'
return "example";
} else if (/(?:caution|^warning$)/i.test(header)) {
return "warning";
} else {
return "other";
}
}