Skip to content

Commit 3007f27

Browse files
committed
feat: create tag favicon
1 parent c737da9 commit 3007f27

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ Like [Postman Documenter](https://www.getpostman.com/api-documentation-generator
77

88
## Table of Contents
99

10+
- [Table of Contents](#table-of-contents)
1011
- [Requirements](#requirements)
1112
- [Getting Started](#getting-started)
1213
- [Using `npx`](#using-npx)
1314
- [By installing the package globally](#by-installing-the-package-globally)
1415
- [Options](#options)
15-
- [Using a GitHub Release](#using-a-github-release)
16+
- [Using a GitHub release](#using-a-github-release)
1617
- [Updating the API](#updating-the-api)
1718
- [Custom Root Paths](#custom-root-paths)
1819
- [Running the Page Locally](#running-the-page-locally)
@@ -49,6 +50,7 @@ insomnia-documenter --config /path/to/insomnia/config.json
4950
Options:
5051
-c, --config <location> Location of the exported Insomnia JSON config.
5152
-l, --logo <location> Project logo location (48x48px PNG).
53+
-f, --favicon <location> Project favicon location (ICO).
5254
-o, --output <location> Where to save the file (defaults to current working directory).
5355
-h, --help output usage information
5456
```
@@ -61,7 +63,7 @@ Alternatively, you can start using Insomnia Documenter by downloading a release
6163

6264
Updating the API is super simple! Since Insomnia Documenter is a plug-and-play web app, you can just replace your `insomnia.json` with your new exported JSON file. Just make sure it's called `insomnia.json`.
6365

64-
The same actually applies to the logo as well (`logo.png`).
66+
The same actually applies to the logo (`logo.png`) e favicon (`favicon.ico`) as well .
6567

6668
## Custom Root Paths
6769

bin/generate.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ const mkdirp = require('mkdirp');
99
program
1010
.option('-c, --config <location>', 'Location of the exported Insomnia JSON config.')
1111
.option('-l, --logo <location>', 'Project logo location (48x48px PNG).')
12+
.option('-f, --favicon <location>', 'Project favicon location (ICO).')
1213
.option('-o, --output <location>', 'Where to save the file (defaults to current working directory).')
1314
.parse(process.argv);
1415

15-
const { config, logo, output } = program;
16+
const { config, logo, favicon, output } = program;
1617

1718
if (!config) {
1819
console.log('You must provide an exported Insomnia config (Preferences -> Data -> Export Data -> Current Workspace).');
@@ -22,6 +23,7 @@ if (!config) {
2223
const PACKAGE_DIST_PATH = path.resolve(__dirname, '..', 'public');
2324
const outputPath = output ? path.join(process.cwd(), output) : process.cwd();
2425
const logoPath = logo && path.join(process.cwd(), logo);
26+
const faviconPath = favicon && path.join(process.cwd(), favicon);
2527
const configPath = path.join(process.cwd(), config);
2628

2729
console.log('Getting files ready...');
@@ -47,6 +49,11 @@ mkdirp(outputPath, err => {
4749
fs.copyFileSync(logoPath, path.join(outputPath, 'logo.png'));
4850
}
4951

52+
if (faviconPath) {
53+
console.log('Adding custom favicon...');
54+
fs.copyFileSync(faviconPath, path.join(outputPath, 'favicon.ico'));
55+
}
56+
5057
console.log('\n * * * Done! * * *\nYour documentation has been created and it\'s ready to be deployed!');
5158

5259
process.exit();

0 commit comments

Comments
 (0)