Giter VIP home page Giter VIP logo

insomnia-plugin-documenter's Introduction

insomnia-plugin-documenter

Export Insomnia workspace HTML documentation.

How it Works?

The plugin provides a workspace action labelled Export HTML Documentation..., on click it will ask for the output path (you only have to type this once for each workspace as the plugin remembers the last output path ๐Ÿคญ๐Ÿคญ๐Ÿคญ) and there is support for ~ paths, e.g. ~/dev/AwesomeProject/docs, but if you did not provide one it defaults to your Desktop folder with a folder named by your workspace slug (e.g. Grant Master becomes Grant-Master-API-Docs).

After exporting, you will see a success message that contains path to the generated docs folder and it is ready to be deployed anywhere that support static HTML hosting (e.g. GitHub Pages, Vercel, and Netlify).

Credits

insomnia-plugin-documenter's People

Contributors

devhammed avatar jsoref avatar robertklohr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

insomnia-plugin-documenter's Issues

Example Response Not Parsed From Description Field

The CLI tool this plugin is based is supposed to be able to parse and create Example responses if they are in the request description and are wrapped in between and . When I try this the example I put in the description is displayed in the description field in the HTML output and not on the right side as an example response.

Here is a sample of a description field on a response.

Outputs report data to a CSV, PDF, or XLSX file format. The My Reports tab in the user interface contains the ID for the desired report. If a report is not found or permissions are not granted to export data, the message "Report does not exist or is inaccessible" appears.

* Permissions: The authentication account must have General Access - Read and Print/Export permissions to:
ย ย ย ย * Applicable component
ย ย ย ย * Applicable records
ย ย ย ย * Applicable fields in the component (table)

<!-- RESPONSE -->
{
"Id": 2,
"Name": "Anonymous Incident Analysts",
"Description": "",
"BusinessUnit": false,
"SecurityRoles": [],
"Users": [
{
"Id": 6,
"FullName": "Admin, Lockpath"
},
{
"Id": 27,
"FullName": "User, Test"
}
],
"ChildGroups": [],
"ParentGroups": []
}
<!-- ENDRESPONSE -->

Failed to install - Yarn error

Hello, I am currently facing an issue. I am trying to install insomnia-plugin-documenter. However, I keep getting a yarn error when installing via the UI.

image

Error: Yarn error warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
at file:///C:/Users/Marcello/AppData/Local/insomnia/app-2020.5.2/resources/app.asar/bundle.js:103518:16
at ChildProcess.exithandler (child_process.js:295:7)
at ChildProcess.emit (events.js:223:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket. (internal/child_process.js:430:11)
at Socket.emit (events.js:223:5)
at Pipe. (net.js:664:12)
image

TypeError: Cannot read property 'replace' of null

Hi, I just started using this plugin when I found it in the Insomnia app. I am interested and want to try it. I started in the local environment first. However, when I wanted to try it, I got an error on my console browser like:

TypeError: Cannot read property 'replace' of null
    at Re (formatEnv.js:2)
    at Object.e.$$.update (Request.svelte:32)
    at ne (index.mjs:1284)
    at new ot (Request.svelte:81)
    at Array.gt (Rows.svelte:16)
    at ft (Rows.svelte:12)
    at mt (Rows.svelte:11)
    at ne (index.mjs:1287)
    at new _t (Rows.svelte:8)
    at Array.ht (Rows.svelte:15)

This is for my insomnia.json if you want to see it.

I would like to know if there is a solution to this? I am very interested in this plugin because it really helps my work. Sorry for my bad english. Thank you for responding to this issue. Have a good day!

Deploying to a web server subfolder fails

Generating the export and deploying it to a server works fine as long as all sources are in the web server's root directory. However, when moving the deployment to a sub directory, a JSON.parse SyntaxError comes up:

The following structure works fine:

โฏ tree www
www
โ”œโ”€โ”€ bundle.css
โ”œโ”€โ”€ bundle.css.map
โ”œโ”€โ”€ bundle.js
โ”œโ”€โ”€ bundle.js.map
โ”œโ”€โ”€ favicon.ico
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ insomnia.json
โ””โ”€โ”€ logo.png

Running a web server with python3 -m http.server 8000 inside the www directory works fine.

The following structure does not work when the web server root is www:

โฏ tree www
www
โ”œโ”€โ”€ my-api-docs
โ”‚   โ”œโ”€โ”€ bundle.css
โ”‚   โ”œโ”€โ”€ bundle.css.map
โ”‚   โ”œโ”€โ”€ bundle.js
โ”‚   โ”œโ”€โ”€ bundle.js.map
โ”‚   โ”œโ”€โ”€ favicon.ico
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ insomnia.json
โ”‚   โ””โ”€โ”€ logo.png

Running a web server with python3 -m http.server 8000 inside the www directory is resulting in a JSON.parse SyntaxError. Because of this issue, I tested versions 1.0.4 and 1.0.6 of the plugin. The result is the same.

The same issue arises when deploying to a folder on Azure. When I modify the export to have all resources pointing to an absolute path (/my-api-docs/...), everything is working again. This leads me to believe that relative paths are not being picked up correctly.

JSON.parse SyntaxError since 1.0.5

After upgrading from version 1.0.4 and 1.0.5 I'm getting a JSON.parse SyntaxError when accessing a newly generated documentation. It seems to be related to insomnia.json but all JSON validators I've been using tell me it is valid.

Any clue what could be the problem ? When I get back to 1.0.4 the display of the documentation works fine.

Thanks

Move All Resources Locally

CSS and Web Fonts

Currently the index.html written by the documenter has an external reference for some of the CSS and web fonts used in the page. The prevents the page from rendering correctly on system with no internet access.

  <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
    integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">

I have been able to hack together a workaround doing the following:

  1. I downloaded the 6.0 version of Font Awesome Free removed all the files except all.css and fa-solid-900.woff2 using the folder structure:
/fontawesome
  /css
    all.css
  /webfonts
    fa-solid-900.woff2
  1. I then copied the index.html file and original external link above with the one below.
<link href="/fontawesome/css/all.css" rel="stylesheet" />
  1. After exporting my collection from Insomnia I copy the folder structure from step 1 above into the export directory and they overwrite the index.html file with the one I edited.

Ideally you could make include the web font file and the css file in the plugin along with making edits to the index.html file so that all the needed resources were local.

There is one area for improvement that I, not being a web developer, was not able to figure out. The all.css file in the Font Awesome download is 121KB while there is another file called v4-font-face.css in that download that is only 2KB. The v4-font-face.css works for all but the Example Toggle Icon in the upper right of the page. If you can determine the css code to add then the overall plugin size will only increase by about 126 KB, being the small css plus the 124KB for the web font.

Run In Insomnia Button

The run.svg image and the URI used in the button are external.

My request is to move the run.svg file to be local to the plugin and update the bundle.js file to that the URI in the button points to;

insomnia://app/import?uri=<protocol><host>/insomnia.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.