docs: Update the readme

This commit is contained in:
Arik Jones
2024-09-19 11:08:13 -05:00
parent eba453f09e
commit 1e88fae75d

View File

@@ -9,7 +9,9 @@ Rollup is a powerful CLI tool designed to aggregate and process files based on s
- Support for code-generated file detection - Support for code-generated file detection
- Advanced web scraping functionality - Advanced web scraping functionality
- Verbose logging option for detailed output - Verbose logging option for detailed output
- Exclusionary CSS paths for web scraping - Exclusionary CSS selectors for web scraping
- Support for multiple URLs in web scraping
- Configurable output format (single file or separate files)
## Installation ## Installation
@@ -24,19 +26,30 @@ go get github.com/tnypxl/rollup
Basic usage: Basic usage:
```bash ```bash
rollup [flags] rollup [command] [flags]
``` ```
### Flags ### Commands
- `--file-types`: Comma-separated list of file types to include (default: all files) - `rollup`: Run the main rollup functionality
- `--ignore`: Comma-separated list of patterns to ignore - `rollup web`: Run the web scraping functionality
- `--code-generated`: Comma-separated list of patterns for code-generated files
### Flags for main rollup command
- `--path, -p`: Path to the project directory (default: current directory)
- `--types, -t`: Comma-separated list of file extensions to include (default: .go,.md,.txt)
- `--codegen, -g`: Comma-separated list of glob patterns for code-generated files
- `--ignore, -i`: Comma-separated list of glob patterns for files to ignore
- `--config, -f`: Path to the configuration file (default: rollup.yml in the current directory)
- `--verbose, -v`: Enable verbose logging - `--verbose, -v`: Enable verbose logging
- `--config`: Path to the configuration file (default: rollup.yml)
- `--url`: URL to scrape (for web scraping functionality) ### Flags for web scraping command
- `--css`: CSS selector for content extraction (for web scraping)
- `--exclude-css`: CSS selector for content to exclude (for web scraping) - `--urls, -u`: URLs of the webpages to scrape (comma-separated)
- `--output, -o`: Output type: 'single' for one file, 'separate' for multiple files (default: single)
- `--depth, -d`: Depth of link traversal (default: 0, only scrape the given URLs)
- `--css`: CSS selector to extract specific content
- `--exclude`: CSS selectors to exclude from the extracted content (comma-separated)
## Configuration ## Configuration
@@ -46,19 +59,22 @@ Example `rollup.yml`:
```yaml ```yaml
file_types: file_types:
- .go - go
- .md - md
ignore: ignore:
- vendor/** - vendor/**
- **/test/** - **/test/**
code_generated: code_generated:
- **/generated/** - **/generated/**
scrape: scrape:
url: https://example.com urls:
css_locator: .content - url: https://example.com
exclude_selectors: css_locator: .content
- .ads exclude_selectors:
- .navigation - .ads
- .navigation
output_alias: example
output_type: single
``` ```
## Examples ## Examples
@@ -72,7 +88,7 @@ scrape:
2. Use specific file types and enable verbose logging: 2. Use specific file types and enable verbose logging:
```bash ```bash
rollup --file-types=.go,.js,.py --verbose rollup --types=go,js,py --verbose
``` ```
3. Use a custom configuration file: 3. Use a custom configuration file:
@@ -81,9 +97,15 @@ scrape:
rollup --config=my-config.yml rollup --config=my-config.yml
``` ```
4. Web scraping with content exclusion: 4. Web scraping with multiple URLs and content exclusion:
```bash ```bash
rollup web --url=https://example.com --css=.main-content --exclude-css=.ads,.sidebar rollup web --urls=https://example.com,https://another-example.com --css=.main-content --exclude=.ads,.sidebar
```
5. Web scraping with separate output files:
```bash
rollup web --urls=https://example.com,https://another-example.com --output=separate
``` ```
## Contributing ## Contributing