updated README

This commit is contained in:
Charlie Crossley
2025-08-20 14:05:42 +01:00
parent 2c80cc135b
commit 5353b0e27f

View File

@@ -8,56 +8,6 @@ Features
- Highlight results: Search results are highlighted for better visibility using ANSI color codes. - Highlight results: Search results are highlighted for better visibility using ANSI color codes.
- Contextual results: Display surrounding context around matches, such as parent headings or list items. - Contextual results: Display surrounding context around matches, such as parent headings or list items.
- Support for multiple search terms: Search for more than one term at once. - Support for multiple search terms: Search for more than one term at once.
- No dependencies: `mdq` is built using Python's standard libraries, so its easy to set up and use.
Installation
Option 1: Install via `pipx` (Recommended)
`pipx` is a great way to install Python applications globally while keeping them isolated from the system environment.
1. Install `pipx` if it's not already installed:
```bash
sudo apt install pipx
```
2. Install `mdq`:
```bash
pipx install git+https://github.com/yourusername/mdq.git
```
Option 2: Install in a Virtual Environment
1. Create a virtual environment:
```bash
python3 -m venv mdq-env
```
2. Activate the virtual environment:
```bash
source mdq-env/bin/activate
```
3. Install `mdq` locally:
In the root of the repository (where `setup.py` is):
```bash
pip install .
```
4. Run the `mdq` command:
```bash
mdq "search term"
```
Option 3: Install Globally (Not Recommended)
If you really want to install `mdq` globally on your system, you can override the restrictions by running:
```bash
sudo pip install . --break-system-packages
```
Note: This method is not recommended, as it may interfere with system-managed Python packages.
Usage Usage
@@ -66,7 +16,7 @@ Once installed, you can use the `mdq` command to search through markdown files.
Basic Search Basic Search
```bash ```bash
mdq "search term" /path/to/your/markdown/files/*.md mdq "search term" --file /path/to/your/markdown/files/*.md
``` ```
This will search for the term `"search term"` in all `.md` files in the specified directory. This will search for the term `"search term"` in all `.md` files in the specified directory.
@@ -74,7 +24,7 @@ This will search for the term `"search term"` in all `.md` files in the specifie
Multiple Search Terms Multiple Search Terms
```bash ```bash
mdq "term1" "term2" /path/to/your/markdown/files/*.md mdq "term1" "term2" --file /path/to/your/markdown/files/*.md
``` ```
This will search for both `"term1"` and `"term2"` in the specified markdown files and show the results for both. This will search for both `"term1"` and `"term2"` in the specified markdown files and show the results for both.
@@ -83,21 +33,6 @@ Search with Context
By default, the results will show the keyword matches with surrounding context (headings and list items). You can adjust the context size and highlighting options through various flags. By default, the results will show the keyword matches with surrounding context (headings and list items). You can adjust the context size and highlighting options through various flags.
Flags
- `--raw`: Output results without any highlighting (for raw output).
Example:
```bash
mdq --raw "search term" /path/to/your/markdown/files/*.md
```
- `--help`: Display help message with available options.
Example:
```bash
mdq --help
```
Example Example