Skip to content

Commit 6259fff

Browse files
committed
docs: restructure documentation for v0.1.0 release
- Rewrite README.md with user-friendly GitHub Action documentation - Create CONTRIBUTING.md with comprehensive developer guidelines - Move technical documentation from tests/ to CONTRIBUTING.md - Update package.json version to 0.1.0 - Prepare for first stable release README now focuses on end-users with clear setup instructions. CONTRIBUTING.md contains all technical details for developers.
1 parent 37d2390 commit 6259fff

File tree

3 files changed

+92
-185
lines changed

3 files changed

+92
-185
lines changed

README.md

Lines changed: 91 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
# Dev Metrics in Readme
1+
# CodeStats README
22

3-
[CodeStats](https://codestats.net/) Weekly Metrics on your Profile Readme:
3+
> 📊 A GitHub Action that automatically updates your README with your [CodeStats](https://codestats.net/) programming statistics
44
5-
## Prep work
5+
Show off your coding activity with beautiful ASCII bar charts directly in your profile README!
66

7-
1. You need to update the markdown file(.md) with 2 comments. You can refer [here](#update-your-readme) for updating it.
8-
2. You'll need a [CodeStats](https://codestats.net/) account.
9-
3. Your profile has to be public. (Settings)
10-
11-
## Update your README.md
12-
13-
Add a comment to your `README.md` like this:
14-
15-
```md
167
<!-- START_SECTION:codestats -->
178
```text
189
Markdown | ██████████████████████████████████████████ | 220306
@@ -23,52 +14,110 @@ Add a comment to your `README.md` like this:
2314
YAML | ██████████████ | 73315
2415
```
2516
<!-- END_SECTION:codestats -->
17+
18+
## 🚀 Quick Start
19+
20+
### Prerequisites
21+
22+
1. A [CodeStats](https://codestats.net/) account with a **public profile**
23+
2. The special markers in your README (see step 2)
24+
25+
### Setup
26+
27+
1. **Add the markers** to your README.md where you want the stats to appear:
28+
29+
```md
30+
<!-- START_SECTION:codestats -->
31+
<!-- END_SECTION:codestats -->
2632
```
2733

28-
4. Go to Workflows menu (mentioned in step 1), click `CodeStats Readme`, click `Run workflow`.
29-
5. Go to your profile page. you will be able to see it.
34+
2. **Create a workflow** in `.github/workflows/codestats.yml`:
35+
36+
```yml
37+
name: Update CodeStats
38+
39+
on:
40+
schedule:
41+
- cron: '0 0 * * *' # Daily at midnight
42+
workflow_dispatch: # Manual trigger
43+
44+
jobs:
45+
update-readme:
46+
runs-on: ubuntu-latest
47+
permissions:
48+
contents: write
49+
steps:
50+
- uses: vergissberlin/codestats-readme@v0.1.0
51+
with:
52+
CODESTATS_USERNAME: your-codestats-username
53+
```
54+
55+
3. **Customize** (optional) - see [Configuration](#-configuration) below
56+
57+
4. **Run** the workflow manually or wait for the next scheduled run
3058
31-
## Why only the language stats and not other data from the API?
59+
## ⚙️ Configuration
3260
33-
I am a fan of minimal designs and the profile readme is a great way to show off your skills and interests. The CodeStats API, gets us a **lot of data** about a person's **coding activity**. Using up more data via the CodeStats API will clutter the profile readme and hinder your chances on displaying what you provide **value to the community** like the pinned Repositories. You are _**exercising these languages or learning a new language**_, this will also show that you spend some amount of time to learn and exercise your development skills. That's what matters in the end :heart:
61+
All configuration is done through workflow inputs:
3462
35-
## Usage as Docker Image
63+
| Input | Description | Default | Required |
64+
|-------|-------------|---------|----------|
65+
| `CODESTATS_USERNAME` | Your CodeStats username | - | ✅ |
66+
| `README_FILE` | Path to README file | `./README.md` | ❌ |
67+
| `SHOW_TITLE` | Show update timestamp | `false` | ❌ |
68+
| `SHOW_LINK` | Show link to your profile | `false` | ❌ |
69+
| `GRAPH_WIDTH` | Width of the ASCII bars | `42` | ❌ |
70+
| `COMMIT_MESSAGE` | Custom commit message | `Update codestats metrics` | ❌ |
3671

37-
The action is also available as a Docker image, which can be used in any CI/CD system:
72+
### Example with all options:
73+
74+
```yml
75+
- uses: vergissberlin/codestats-readme@v0.1.0
76+
with:
77+
CODESTATS_USERNAME: your-username
78+
README_FILE: ./profile/README.md
79+
SHOW_TITLE: true
80+
SHOW_LINK: true
81+
GRAPH_WIDTH: 50
82+
COMMIT_MESSAGE: "📊 Updated coding stats"
83+
```
84+
85+
## ✨ Features
86+
87+
- 📊 **Beautiful ASCII Charts** - Clean, visual representation of your coding activity
88+
- 🎯 **Top 6 Languages** - Shows your most used programming languages
89+
- 🔄 **Auto-sorted** - Languages sorted by experience points (XPs)
90+
- ⚡ **Fast & Reliable** - Built with Node.js 20 and comprehensive tests
91+
- 🐳 **Docker Support** - Available as container image
92+
- 🔧 **Customizable** - Multiple configuration options
93+
94+
## 🐳 Docker Usage
95+
96+
Run as a standalone container:
3897

3998
```bash
40-
# Using GitHub Container Registry (recommended)
4199
docker run --rm -v "$PWD:/workspace" -w /workspace \
42100
-e CODESTATS_USERNAME=your_username \
43101
-e GITHUB_TOKEN=your_token \
44102
ghcr.io/vergissberlin/codestats-readme:latest
45103
```
46104

47-
> **Note**: The Docker image is automatically built and pushed to [GitHub Container Registry](https://github.com/vergissberlin/codestats-readme/pkgs/container/codestats-readme) on every release.
105+
## 🤝 Contributing
48106

49-
## Testing
107+
Want to contribute? Check out [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, testing, and contribution guidelines.
50108

51-
### Docker (Local Development)
109+
## 📄 License
52110

53-
```bash
54-
docker build -t vergissberlin/codestats-readme .
55-
docker run \
56-
-e INPUT_CODESTATS_USERNAME=vergissberlin \
57-
-e INPUT_README_FILE=/data/README.md \
58-
-e INPUT_SHOW_TITLE=true \
59-
-e INPUT_SHOW_LINK=true \
60-
-e INPUT_DEBUG=true \
61-
-v $PWD/tests/fixtures/README.md:/data/README.md \
62-
-v $PWD:/app \
63-
vergissberlin/codestats-readme
64-
```
111+
MIT © [André Lademann](https://github.com/vergissberlin)
65112

66-
### node
113+
## 🙋‍♀️ Support
67114

68-
```bash
69-
INPUT_CODESTATS_USERNAME=vergissberlin \
70-
INPUT_README_FILE=./tests/fixtures/README.md \
71-
INPUT_SHOW_TITLE=true \
72-
INPUT_SHOW_LINK=true \
73-
node index.js
74-
```
115+
- 📫 **Issues**: [GitHub Issues](https://github.com/vergissberlin/codestats-readme/issues)
116+
- 💬 **Discussions**: [GitHub Discussions](https://github.com/vergissberlin/codestats-readme/discussions)
117+
- ⭐ **Star this repo** if you find it useful!
118+
119+
---
120+
121+
<div align="center">
122+
<sub>Built with ❤️ for the developer community</sub>
123+
</div>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codestats-readme",
3-
"version": "1.0.0",
3+
"version": "0.1.0",
44
"packageManager": "pnpm@9.12.0",
55
"description": "Add codestats metrics to your readme file",
66
"main": "index.js",

tests/README.md

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)