Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [DHIS2] Generate library documentation with Gen AI #1590

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eirikhaugstulen
Copy link

Hey everyone,

@jenniferarnesen and I talked briefly about how you could use generative AI to write documentation for you public libraries.
I did something similar on another project, so I'll post a how-to-guide here and you can decide if you want to do something similar.

TLDR

This is the resulting documentation created by AI

image

I used an editor called Cursor to write documents. Cursor is basically just a vscode fork where they try to implement GPT 4. You can read more at their website, but the main gist is that they embed your repository and provide contextual related code snippets to OpenAI. This gives the AI context of your code and surrounding components, increasing the relevance of your AI completions.

Here's how to create docs

  1. Create a new markdown file where you want the docs to be
  2. Click Cmd + K
  3. Reference the Prompt
  4. Reference the Component you want documented
AnalyticsDocs.mp4

How to improve your response

Everything written in Prompts/generate-documentation.md will be treated as rules for the AI. This means, if you need it to abide by some sort of guidelines, write it in this file and the AI will follow.

There are some limitations to this though;

  • Since you're only using propTypes, the props-completion might not be that great. In some cases, the AI could understand object attributes and function parameters, but most of the times it would just use object or func. (The same thing as defined in propTypes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants