gitorial-cli 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/mdbook.js +18 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitorial-cli",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "CLI Tools for Creating and Managing a Gitorial",
5
5
  "main": "src/index.js",
6
6
  "bin": "src/index.js",
package/src/mdbook.js CHANGED
@@ -297,10 +297,24 @@ function generateFileMarkdown(type, files) {
297
297
 
298
298
  let codeStyle = "text";
299
299
  let extname = path.extname(filepath);
300
- if (extname == ".rs") {
301
- codeStyle = "rust";
302
- } else if (extname == ".toml") {
303
- codeStyle = "toml";
300
+ switch (extname) {
301
+ case ".rs":
302
+ codeStyle = "rust";
303
+ break;
304
+ case ".toml":
305
+ codeStyle = "toml";
306
+ break;
307
+ case ".js":
308
+ codeStyle = "js";
309
+ break;
310
+ case ".json":
311
+ codeStyle = "json";
312
+ break;
313
+ case ".ts":
314
+ codeStyle = "ts";
315
+ break;
316
+ default:
317
+ codeStyle = "text";
304
318
  }
305
319
 
306
320
  parsedFiles.push({ filename: file.file, classStyle, codeStyle, filepath })