DEV Community

Cover image for Express Autodocs - A GitHub Action to generate documentation (Submission)
Prafulla Raichurkar
Prafulla Raichurkar

Posted on β€’ Edited on

14 8

Express Autodocs - A GitHub Action to generate documentation (Submission)

I am glad to announce my submission to the GitHub Actions Hackathon πŸ˜„

Are you tired of maintaining documentation for your APIs?

Express AutoDocs is a GitHub action that solves this problem.

Submission Category:

Maintainer Must-Haves

My Workflow

Express AutoDocs scans your codebase for express API definitions and automatically generates the documentation and deploys it to a GitHub branch.

Example Repo - MERN_SHOPPINGLIST

YAML File

Here's how you can integrate Express AutoDocs in your workflow.

# This is a basic workflow to help you get started with Express AutoDocs Action

name: Express AutoDocs.

# This specifies when the action should occur
on:
  push:
    branches: [master]

jobs:
  generate_docs_job:
    runs-on: ubuntu-latest
    name: Generating Docs
    steps:
      # this step checks out the master branch of your repo using checkout action.
      - name: Checks out the repository
        id: checksout-repository
        uses: actions/checkout@v2
        with:
          repository: ""
      # this step generates the docs
      - name: Generating Docs.
        id: reading-file
        uses: Pika1998/express-autodocs@v0.0.1
      # Use the output from the `hello` step
      - name: Get the output time
        run: echo "The time was ${{ steps.reading-file.outputs.time }}"
Enter fullscreen mode Exit fullscreen mode

For a detailed configuration, checkout the official repository

GitHub logo prafulla-codes / express-autodocs

A GitHub action which automatically generates documentation for your express APIs.



Contributions


πŸ’‘ Introduction

This action automatically scans for express APIs in your codebase and generates a documentation website

Whats New?

How to add to your workflow ❔

To add this action to your workflow simply modify your workflows main.yml file.

# This is a basic workflow to help you get started with Express AutoDocs Action
name: Express AutoDocs.

# This specifies when the action should occur
on:
  push:
    branches: [master]

jobs:
  generate_docs_job:
    runs-on: ubuntu-latest
    name: Generating Docs
    steps:
      # this step checks out the master branch of your repo using checkout action.
      - name: Checks out the repository
        id: checksout-repository
        uses: actions/checkout@v2
        with:
          repository: ''
      # this step generates the docs
…
Enter fullscreen mode Exit fullscreen mode

Additional Info

Easily Pass API Info using JSON in comments
Example

/*  
{
    "description":"Checks for token and gets the logged in user",
    "inputs":{
        "x-auth-token":"The JWT Token in header"
    },
    "label":"Public",
    "outputs":{
        "user":"The user object stored in database",
    }
}
*/
router.get("/user", auth, (req, res) => {
  User.findById(req.user.id)
    .select("-password")
    .then((user) => {
      res.json(user);
    });
});
Enter fullscreen mode Exit fullscreen mode

Output Format

Supports two output formats markdown and standard
Default output example:
Output 1

Easy CI/CD Integration

It is very easy to maintain the documentation website since the action deploys the output to a GitHub branch which can be easily set up as a deployment branch using Github pages, Netlify, etc.

Checkout on GitHub MarketPlace

πŸ’–πŸ‘¨β€πŸ’» It was fun and enlightening to participate in the actions hackathon.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (6)

Collapse
 
mikitashah profile image
mikitashah β€’

That's interesting!

Collapse
 
prafulla-codes profile image
Prafulla Raichurkar β€’

Thank you πŸ˜ƒ

Collapse
 
singhshivani profile image
Shivani Singh β€’

So cool!πŸ’₯

Collapse
 
prafulla-codes profile image
Prafulla Raichurkar β€’

Thank you 😁✨

Collapse
 
shunjid profile image
Shunjid Rahman Showrov β€’

This is cool πŸŽ‰ ! You can see mine πŸ˜„

Collapse
 
prafulla-codes profile image
Prafulla Raichurkar β€’

Sure, even yours seems cool 😁

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay