Giter Club home page Giter Club logo

mkautodocs's Introduction

GPT-3.5 Code Documentation Repository

This repository showcases the use of OpenAI's GPT-3.5 language model for generating documentation for code automatically. The generated documentation is then turned into a "doc as code" site for easy access and sharing.

Getting Started

To use this repository, you will need to have the following:

  • A valid OpenAI API key for GPT-3.5 language model.
  • A codebase that you want to generate documentation for.

Usage

  1. Clone or download this repository to your local machine.
  2. Set up your OpenAI API key by creating a .env file in the root directory and adding the following line, you can rename the example.env:
OPENAI_API_KEY=<your-api-key>
  1. Install the required dependencies, python, then once installed use the following command:
cd ./MKAutoDocs/
pip install -r requirements.txt
  1. Edit the configuration file to point to your code repository.
    1. docs_path: relative path to the desired doc folder (should match with mkdocs in config file).
    2. root_dir: absolute path or relative path to the desired project root directory.
    3. source_to_document:
      • Absolute path or relative path to the folders you want parsed and documented in your root directory.
    4. requirements: A list of python dependencies to run your doc as code site.
      • mkdocs: 1.4.2
      • pymdown-extensions: 9.11
    5. ignore_folders: A list of regex of folders/subfolders to ignore. Remove any or all if you like.
      • .+.git
      • .pytest
      • Include
      • Lib
      • Scripts
    6. ignore_files: A list of regex of files to ignore. Remove any or all if you like.
      • .*
      • ^(?!..py$).
    7. use_state: A boolean value, this will keep files from being regenerated on each run. Feel free to turn off if you want to update the docs.
  2. Run the following command to generate documentation for your code:
python Auto_Doc.py

This will use the GPT-3.5 language model to generate documentation for your codebase and output the generated documentation as Markdown files in the configured docs directory.

  1. Run The static site generator MkDocs to turn the generated documentation into a "doc as code" site.

For example, to use MkDocs, run the following command in the root directory to preview the site:

mkdocs serve

Or use MkDocs, to build a site:

mkdocs build

This will generate a static website in the site directory, which you can host on a server or a service like GitHub Pages.

If you want to host on GitHub Pages. You can set up github actions to autodeploy your doc as code site mkdocs how to or deploy manually using:

mkdocs gh-deploy

Contributing

If you want to contribute to this repository, please feel free to open a pull request or an issue. We welcome any feedback, suggestions, or improvements to the code.

License

This repository is licensed under the MIT License. See the LICENSE file for more information.

mkautodocs's People

Contributors

coleyr avatar coley-angel avatar

Stargazers

 avatar Tuan Duc Tran avatar Alin Osan avatar TheMattaBase avatar  avatar

Watchers

Alin Osan avatar  avatar

mkautodocs's Issues

Large documentation failing

A long file either readme or code file will be too many tokens, need some organized way to split up the code so it can chunk large files, or for at least omit them.

Create a index.md

Create a index.md from the readme if present or a blank index.md if not and place it by default in the docs dir

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.