Skip to content

Commit

Permalink
docs: enhance documentation
Browse files Browse the repository at this point in the history
  * docs: add -pf (--promptFile) to the Options table
  * docs: add examples for inline prompt and prompt file
  * chore: add VSCode recommended extension config
  * docs: add CODE_OF_CONDUCT.md template from contributing-gen
  * chore: make pre-commit format code before linting
  * docs: add CONTRIBUTING.md template from contributing-gen with modifications
  * fix: remove eslint configuration for non-existent files
  * chore: make eslint ignore several folders for linting
  * chore: make prettier ignore _examples/ and .husky/ for formatting
  * docs: link CONTRIBUTING.md, CODE_OF_CONDUCT.md, & LICENSE
  * chore: update ignore lists and sort them alphabetically
  * chore: add some suggested markdown extensions
  * docs: explain files within .vscode/
  • Loading branch information
peterdanwan committed Oct 30, 2024
1 parent 17e78ce commit 041c920
Show file tree
Hide file tree
Showing 10 changed files with 406 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
npm run lint
npm run format
npm run lint
npm run test
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
_examples/
.git/
.github/
.husky/
.vscode/
node_modules/
package.json
package-lock.json
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"streetsidesoftware.code-spell-checker",
"yzhang.markdown-all-in-one",
"DavidAnson.vscode-markdownlint"
]
}
70 changes: 70 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Code of Conduct - gimme_readme

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or
advances
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban
temporarily or permanently any contributor for other behaviors that they deem
inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at <[email protected]>.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
and was generated by [contributing-gen](https://github.com/bttger/contributing-gen).
284 changes: 284 additions & 0 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

56 changes: 11 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ See our [0.1 Release Demo](https://youtu.be/S6v-u9o_Xx8)!
3. [Example Usage](#3-example-usage)
4. [Supported Models by Providers](#4-supported-models-by-providers)
5. [Contributing](#5-contributing)
6. [Testing Locally](#6-testing-locally)
7. [Author](#7-author)
6. [Code of Conduct](#6-code-of-conduct)
7. [License](#7-license)
8. [Author](#8-author)

## 1. Getting Started

Expand Down Expand Up @@ -53,9 +54,10 @@ To get started with `gimme_readme`, follow these steps:
| `-o`, `--outputFile <string>` | Specify the file to output the generated README to |
| `-m`, `--model <string>` | Choose a free-tier AI model to use (e.g., gemini, openai, grok) |
| `-p`, `--prompt <string>` | Provide a custom prompt to the AI |
| `-pf`, `--promptFile <string>` | Specify a prompt file |
| `-c`, `--config` | Show the location of the configuration file and provide links to examples |
| `-t`, `--temperature <number>` | Set the level of determinism for the AI (value between 0 and 1) |
| `-tkn`, `--token` | get information on the tokens consumed (i.e., prompt, completion, & total tokens) |
| `-tkn`, `--token` | Get information on the tokens consumed (i.e., prompt, completion, & total tokens) |
| `-h`, `--help` | Display help for the command |

## 3. Example Usage
Expand Down Expand Up @@ -103,53 +105,17 @@ gr-ai -f example.js anotherFile.py -o README.md -m llama3-8b-8192 --token

## 5. Contributing

We welcome contributions to improve `gimme_readme`! To contribute, please follow these steps:
We welcome contributions to improve `gimme_readme`! To get started with contributing, we ask that you read our [contributing guide](./CONTRIBUTING.md)

1. Check the [existing issues](https://github.com/peterdanwan/gimme_readme/issues) to see if your issue or feature request has already been logged.
2. If your issue or feature request is already listed, add your comments or create a pull request with your proposed changes.
3. If your issue or suggestion is not listed, feel free to create a new issue. If possible, provide a pull request that addresses the issue.
4. To test your local changes to `gimme_readme`, please read section [6. Testing Locally](#6-testing-locally)
## 6. Code of Conduct

When making a pull request, please ensure that your changes are well-documented and adhere to the coding standards of the project.
We are committed to providing a welcoming and inclusive experience for everyone. By participating in this project, you agree to abide by our [Code of Conduct](./CODE_OF_CONDUCT.md).

## 6. Testing Locally
## 7. License

If you are trying to contribute to the `gimme_readme` repository, please follow the following steps in sequence to test your changes locally:
This project is licensed under the MIT license. You are free to use, modify, and distribute this code, subject to the terms in the [LICENSE](./LICENSE) file.

1. Ensure you have [Node.js installed](https://nodejs.org/en/download/package-manager)
2. Fork this repository, and clone your _forked_ repository.
3. On your machine, after cloning your forked repository, navigate to the _root_ of the cloned repository and run the following:

```sh
# Remove the pre-existing, global installation of the gimme-readme repository.
npm uninstall -g gimme_readme

# Install the necessary node_modules
npm i

# Simulate the environment as if gimme-readme was installed globally via `npm i -g gimme_readme`
# You can now use the `gr-ai` executable, and changes to your source code should be reflected when you make changes to the repo
# If your changes aren't reflected after changing the source code, repeat the commands above in sequence.
npm link
```

4. After adding any new code, please try to have a `test` case made for this code as well.
5. When you're ready to make a commit, this repository has been set-up to run a [pre-commit hook](.husky/pre-commit) that runs the following:

```sh
# To spot any code issues
npm run lint

# To spot any formatting issues
npm run format

# To see if any of the existing tests are broken/need to be updated based on your update
npm run test
```

> This pre-commit hook aims to ensure that your commit passes the [continuous integration tests](.github/workflows/ci.yml).
## 7. Author
## 8. Author

Developed by [Peter Wan](https://github.com/peterdanwan).

Expand Down
16 changes: 16 additions & 0 deletions _examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,19 @@ gr-ai -m gemini-1.5-flash -f tests/unit/_gr.test.js -o explanation.md -t 0.1
```

![explain-file](assets/images/explain-file.png)

## Use the text from a custom prompt file, and send files within a particular folder

```sh
gr-ai -pf prompt.md -f src/ -o explain.md
```

![send-a-prompt-file-and-folder](assets/images/send-a-prompt-file-and-folder.png)

## Make a prompt directly from the command-line

```sh
gr-ai -p "Can you provide your best explanation of a static analysis tool, with examples in JavaScript?" -o explanation.md
```

![prompt-from-command-line](assets/images/prompt-from-command-line.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 10 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ export default [
},
},
{
// add for issue 31 - TOML configuration
files: ['*.gr.toml'],
languageOptions: {
parser: 'toml-eslint-parser',
},
ignores: [
'_examples/**',
'.git/**',
'.github/**',
'.husky/**',
'.vscode/**',
'node_modules/**',
'package.json',
'package-lock.json',
],
},
];

0 comments on commit 041c920

Please sign in to comment.