mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-13 06:23:18 +00:00
docs: Update readme to include generate command that produces default config file.
This commit is contained in:
43
README.md
43
README.md
@@ -1,6 +1,6 @@
|
|||||||
# Rollup
|
# Rollup
|
||||||
|
|
||||||
Rollup is a powerful CLI tool designed to aggregate and process files based on specified criteria. It's particularly useful for developers and system administrators who need to collect and summarize information from multiple files across a project or system. It now includes advanced web scraping capabilities.
|
Rollup aggregates the contents of text-based files and webpages into a markdown file.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -11,7 +11,9 @@ Rollup is a powerful CLI tool designed to aggregate and process files based on s
|
|||||||
- Verbose logging option for detailed output
|
- Verbose logging option for detailed output
|
||||||
- Exclusionary CSS selectors for web scraping
|
- Exclusionary CSS selectors for web scraping
|
||||||
- Support for multiple URLs in web scraping
|
- Support for multiple URLs in web scraping
|
||||||
- Configurable output format (single file or separate files)
|
- Configurable output format for web scraping (single file or separate files)
|
||||||
|
- Configuration file support (YAML)
|
||||||
|
- Generation of default configuration file
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -31,19 +33,18 @@ rollup [command] [flags]
|
|||||||
|
|
||||||
### Commands
|
### Commands
|
||||||
|
|
||||||
- `rollup`: Run the main rollup functionality
|
- `rollup files`: Rollup files into a single Markdown file
|
||||||
- `rollup web`: Run the web scraping functionality
|
- `rollup web`: Scrape main content from webpages and convert to Markdown
|
||||||
|
- `rollup generate`: Generate a rollup.yml config file
|
||||||
|
|
||||||
### Flags for main rollup command
|
### Flags for `files` command
|
||||||
|
|
||||||
- `--path, -p`: Path to the project directory (default: current directory)
|
- `--path, -p`: Path to the project directory (default: current directory)
|
||||||
- `--types, -t`: Comma-separated list of file extensions to include (default: .go,.md,.txt)
|
- `--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
|
- `--codegen, -g`: Comma-separated list of glob patterns for code-generated files
|
||||||
- `--ignore, -i`: Comma-separated list of glob patterns for files to ignore
|
- `--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
|
|
||||||
|
|
||||||
### Flags for web scraping command
|
### Flags for `web` command
|
||||||
|
|
||||||
- `--urls, -u`: URLs of the webpages to scrape (comma-separated)
|
- `--urls, -u`: URLs of the webpages to scrape (comma-separated)
|
||||||
- `--output, -o`: Output type: 'single' for one file, 'separate' for multiple files (default: single)
|
- `--output, -o`: Output type: 'single' for one file, 'separate' for multiple files (default: single)
|
||||||
@@ -51,6 +52,11 @@ rollup [command] [flags]
|
|||||||
- `--css`: CSS selector to extract specific content
|
- `--css`: CSS selector to extract specific content
|
||||||
- `--exclude`: CSS selectors to exclude from the extracted content (comma-separated)
|
- `--exclude`: CSS selectors to exclude from the extracted content (comma-separated)
|
||||||
|
|
||||||
|
### Global flags
|
||||||
|
|
||||||
|
- `--config, -f`: Path to the configuration file (default: rollup.yml in the current directory)
|
||||||
|
- `--verbose, -v`: Enable verbose logging
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Rollup can be configured using a YAML file. By default, it looks for `rollup.yml` in the current directory. You can specify a different configuration file using the `--config` flag.
|
Rollup can be configured using a YAML file. By default, it looks for `rollup.yml` in the current directory. You can specify a different configuration file using the `--config` flag.
|
||||||
@@ -62,8 +68,9 @@ file_types:
|
|||||||
- go
|
- go
|
||||||
- md
|
- md
|
||||||
ignore:
|
ignore:
|
||||||
|
- node_modules/**
|
||||||
- vendor/**
|
- vendor/**
|
||||||
- **/test/**
|
- .git/**
|
||||||
code_generated:
|
code_generated:
|
||||||
- **/generated/**
|
- **/generated/**
|
||||||
scrape:
|
scrape:
|
||||||
@@ -79,28 +86,28 @@ scrape:
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
1. Basic usage with default configuration:
|
1. Rollup files with default configuration:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rollup
|
rollup files
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Use specific file types and enable verbose logging:
|
2. Web scraping with multiple URLs:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rollup --types=go,js,py --verbose
|
rollup web --urls=https://example.com,https://another-example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Use a custom configuration file:
|
3. Generate a default configuration file:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rollup --config=my-config.yml
|
rollup generate
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Web scraping with multiple URLs and content exclusion:
|
4. Use a custom configuration file:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rollup web --urls=https://example.com,https://another-example.com --css=.main-content --exclude=.ads,.sidebar
|
rollup files --config=my-config.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Web scraping with separate output files:
|
5. Web scraping with separate output files:
|
||||||
@@ -114,4 +121,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the [MIT License](LICENSE).
|
This project is licensed under the MIT License.
|
||||||
|
|||||||
Reference in New Issue
Block a user