updated README to better reflect the nature of the program and the dependencies needed
This commit is contained in:
119
README.md
119
README.md
@@ -1,86 +1,127 @@
|
|||||||
### README.md
|
|
||||||
|
|
||||||
# Vimwiki Markdown Utilities
|
# Vimwiki Markdown Utilities
|
||||||
|
|
||||||
A collection of Lua keybindings and shell scripts for enhancing the functionality of Vimwiki in Neovim. This project focuses on providing seamless workflows for previewing, converting, and managing Markdown files directly from Neovim.
|
A powerful set of utilities for enhancing the Vimwiki experience in Neovim. This project combines Lua keybindings with a custom shell script to provide seamless Markdown preview, conversion to HTML, and browser integration. Designed for developers and note-takers who rely on Vimwiki and Markdown for their workflows.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
1. **Markdown Preview**:
|
### 1. Markdown Preview
|
||||||
- Quickly preview your Vimwiki Markdown files using a simple keybinding.
|
- Preview your entire Vimwiki in Markdown format.
|
||||||
- Leverages a custom shell script to index and render the wiki for better organization.
|
- Automatically indexes and renders the wiki files.
|
||||||
- Opens the preview directly in a browser.
|
- Opens the preview in your default web browser.
|
||||||
|
|
||||||
2. **Convert Markdown to HTML**:
|
### 2. Convert Markdown to HTML
|
||||||
- Convert the current Markdown file to HTML and open it in Qutebrowser with one command.
|
- Convert the current Markdown file into an HTML document.
|
||||||
- Automatically checks for file compatibility and script availability.
|
- Moves the HTML file to a designated location and opens it in Qutebrowser.
|
||||||
|
- Ensures compatibility by checking file existence and format.
|
||||||
|
|
||||||
3. **Neovim Integration**:
|
### 3. Neovim Integration
|
||||||
- Preconfigured keybindings to streamline workflows.
|
- Custom Lua keybindings for quick access to preview and conversion features.
|
||||||
- Error notifications for missing files or unsupported formats.
|
- Built-in error handling to notify you of issues (e.g., missing files or unsupported formats).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. **Clone the repository**:
|
### 1. Clone the Repository
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/<your-username>/vimwiki-markdown-utilities.git
|
git clone https://github.com/<your-username>/vimwiki-markdown-utilities.git
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Add to Neovim**:
|
### 2. Configure Neovim
|
||||||
- Include the `keybindings.lua` file in your Neovim configuration.
|
- Include `keybindings.lua` in your Neovim configuration:
|
||||||
```lua
|
```lua
|
||||||
require('path-to-keybindings/keybindings')
|
require('path-to-keybindings/keybindings')
|
||||||
```
|
```
|
||||||
- Alternatively, source it from your `init.lua`:
|
- Alternatively, source it directly in your `init.lua`:
|
||||||
```lua
|
```lua
|
||||||
dofile('~/.config/nvim/keybindings.lua')
|
dofile('~/.config/nvim/keybindings.lua')
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Place the Shell Script**:
|
### 3. Place the Shell Script
|
||||||
- Move `vimwiki-markdown-preview.sh` to `~/.config/nvim/scripts/` or update the path in `keybindings.lua`.
|
- Move `vimwiki-markdown-preview.sh` to your Neovim scripts directory:
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/.config/nvim/scripts/
|
||||||
|
cp vimwiki-markdown-preview.sh ~/.config/nvim/scripts/
|
||||||
|
```
|
||||||
|
- Ensure the path in `keybindings.lua` matches the script location.
|
||||||
|
|
||||||
4. **Install Requirements**:
|
### 4. Install Dependencies
|
||||||
- Ensure you have `bash`, `qutebrowser`, and any additional dependencies needed by the shell script.
|
Make sure the following are installed and accessible from your system:
|
||||||
|
- `bash`
|
||||||
|
- `pandoc` (for Markdown-to-HTML conversion)
|
||||||
|
- `qutebrowser` (or modify the script for your preferred browser)
|
||||||
|
- `sed`
|
||||||
|
- `find`
|
||||||
|
- `rsync`
|
||||||
|
- `grep`
|
||||||
|
- `mkdir`
|
||||||
|
- `basenme`
|
||||||
|
- `diff`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Keybindings:
|
### Keybindings:
|
||||||
- **Preview Markdown Wiki**:
|
|
||||||
- Press `<leader>mip` to render and index the Vimwiki Markdown files.
|
|
||||||
|
|
||||||
- **Convert and Open Markdown**:
|
#### Preview Markdown Wiki
|
||||||
- Press `<leader>mp` to convert the current Markdown file to HTML and open it in Qutebrowser.
|
- **Keybinding**: `<leader>mip`
|
||||||
|
- **Description**: Renders and indexes your Vimwiki Markdown files, then opens them in a web browser.
|
||||||
|
|
||||||
### Script Options:
|
#### Convert and Open Markdown
|
||||||
- The shell script supports:
|
- **Keybinding**: `<leader>mp`
|
||||||
- `--index-wiki`: Index and render the entire Vimwiki.
|
- **Description**: Converts the current Markdown file to HTML and opens it in Qutebrowser.
|
||||||
- `--convert <file>`: Convert a specific Markdown file to HTML.
|
|
||||||
|
### Script Functionality
|
||||||
|
|
||||||
|
The `vimwiki-markdown-preview.sh` script performs the following:
|
||||||
|
|
||||||
|
#### `--index-wiki`
|
||||||
|
- Generates an index of your Vimwiki files.
|
||||||
|
- Prepares a single HTML file for all wikis in your configuration.
|
||||||
|
|
||||||
|
#### `--convert <file>`
|
||||||
|
- Converts a specified Markdown file to HTML using `pandoc`.
|
||||||
|
- Moves the resulting HTML file to `~/.config/nvim/scripts/vimwiki_html/`.
|
||||||
|
- Opens the HTML file in Qutebrowser.
|
||||||
|
|
||||||
|
#### Example Usage:
|
||||||
|
```bash
|
||||||
|
bash vimwiki-markdown-preview.sh --index-wiki
|
||||||
|
bash vimwiki-markdown-preview.sh --convert ~/vimwiki/notes.md
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
- **Script Not Found**: Ensure the path to `vimwiki-markdown-preview.sh` is correct in `keybindings.lua`.
|
1. **Script Not Found**:
|
||||||
- **Browser Not Opening**: Verify that Qutebrowser is installed and accessible from the terminal.
|
- Ensure the `vimwiki-markdown-preview.sh` path in `keybindings.lua` matches its actual location.
|
||||||
- **File Not Markdown**: The `Convert and Open` command only works for `.md` files.
|
|
||||||
|
2. **File Not Markdown**:
|
||||||
|
- The "Convert and Open" command only works for `.md` files. Check the file format before running the command.
|
||||||
|
|
||||||
|
3. **Browser Not Opening**:
|
||||||
|
- Verify that `qutebrowser` is installed and accessible. Alternatively, modify the script to use a different browser.
|
||||||
|
|
||||||
|
4. **Missing Dependencies**:
|
||||||
|
- Install `pandoc` if HTML conversion fails:
|
||||||
|
```bash
|
||||||
|
sudo apt install pandoc
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Contributions
|
## Contribution
|
||||||
|
|
||||||
Contributions are welcome! Feel free to submit issues or pull requests to improve functionality, add features, or fix bugs.
|
Contributions are welcome! If you find bugs, want to suggest features, or improve the code, feel free to open an issue or submit a pull request.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the MIT License. See the `LICENSE` file for more details.
|
This project is licensed under the MIT License. See the `LICENSE` file for details.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user