Skip to content

Commit 5088348

Browse files
committed
update readme and clean up repo without tags proc
1 parent daa56da commit 5088348

File tree

2 files changed

+86
-16
lines changed

2 files changed

+86
-16
lines changed

README.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
11
# Turn Back Now...
22

3-
![Goblin Scout](src/assets/scout.png)
3+
![Goblin Scout](src/assets/scout.png)
4+
5+
## About
6+
7+
Goblin Scout is a Git repository documentation tool that generates structured markdown files from your codebase. It's designed for creating both human-readable documentation and machine-processable datasets.
8+
9+
### Features
10+
11+
- **Repository Processing**:
12+
- Automatic cloning of new repositories
13+
- Smart updating of existing repositories
14+
- Git metadata extraction (contributors, releases)
15+
- Requires repositories to have at least one tag for release information
16+
17+
- **Documentation Modes**:
18+
1. Single File Mode
19+
- Combines all code into one markdown file
20+
- Preserves file structure in headers
21+
- Ideal for quick codebase overview
22+
23+
2. Multi-File Mode
24+
- Creates separate markdown files for each source file
25+
- Maintains original directory structure
26+
- Each file includes complete metadata
27+
28+
3. Dataset Mode
29+
- Splits code into manageable chunks (≤750 characters)
30+
- Adds unique UUIDs to each code section
31+
- Optional JSON conversion for dataset creation
32+
- Preserves code structure with smart chunk boundaries
33+
34+
- **Metadata Tracking**:
35+
- File statistics and paths
36+
- Contributor analysis with commit counts
37+
- Latest release version and date
38+
- Direct GitHub file URLs
39+
- Language detection
40+
- UUID tracking for files and code sections
41+
42+
## Usage
43+
44+
### Installation
45+
```bash
46+
# Clone and build the project
47+
git clone https://github.com/yourusername/goblin_scout.git
48+
cd goblin_scout
49+
cargo build --release
50+
```
51+
52+
### Basic Usage
53+
```bash
54+
cargo run --release
55+
```
56+
57+
The tool will prompt you for:
58+
1. Git repository URL
59+
2. Output path for generated documentation
60+
61+
Then select your desired output format:
62+
1. Single markdown file
63+
2. Multiple markdown files (one per source file)
64+
3. Dataset format with optional JSON conversion
65+
66+
### Requirements
67+
- Target repository must have at least one Git tag
68+
- Valid Git repository URL
69+
- Write permissions for output directory
70+
71+
### Output Format
72+
73+
Generated files include:
74+
- YAML frontmatter with metadata
75+
- Code sections with syntax highlighting
76+
- UUIDs for tracking (in dataset mode)
77+
- Optional JSON conversion for dataset mode

src/source/git.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,17 @@ fn git_repo_clone(repo_url: &str, local_repo_path: &PathBuf) -> Result<Repositor
5252

5353
pub fn git_latest_release(repo: &Repository) -> Result<(String, String), CustomError> {
5454
let tags = repo.tag_names(None)?;
55-
let latest_tag = tags
56-
.iter()
57-
.last()
58-
.ok_or(CustomError::StrError("No tags found".to_string()))?
59-
.ok_or(CustomError::StrError("Invalid tag found".to_string()))?;
60-
61-
let obj = repo.revparse_single(latest_tag)?;
62-
let commit = obj.peel_to_commit()?;
63-
64-
let timestamp = commit.time();
65-
let datetime = chrono::DateTime::<chrono::Utc>::from_timestamp(timestamp.seconds(), 0)
66-
.expect("Expected a DateTime value");
67-
let formatted_datetime = datetime.format("%Y-%m-%d %H:%M:%S").to_string();
68-
69-
Ok((latest_tag.to_string(), formatted_datetime))
55+
if let Some(Some(latest_tag)) = tags.iter().last() {
56+
let obj = repo.revparse_single(latest_tag)?;
57+
let commit = obj.peel_to_commit()?;
58+
let timestamp = commit.time();
59+
let datetime = chrono::DateTime::<chrono::Utc>::from_timestamp(timestamp.seconds(), 0)
60+
.expect("Expected a DateTime value");
61+
let formatted_datetime = datetime.format("%Y-%m-%d %H:%M:%S").to_string();
62+
Ok((latest_tag.to_string(), formatted_datetime))
63+
} else {
64+
Ok(("No Release".to_string(), "N/A".to_string()))
65+
}
7066
}
7167

7268
pub fn git_contributors(repo: &Repository) -> Result<HashMap<String, usize>, CustomError> {

0 commit comments

Comments
 (0)