https://github.com/patrickalphac/vheader
A tool for making perfect vyper headers, inspired by transmissions11
https://github.com/patrickalphac/vheader
Last synced: 7 months ago
JSON representation
A tool for making perfect vyper headers, inspired by transmissions11
- Host: GitHub
- URL: https://github.com/patrickalphac/vheader
- Owner: PatrickAlphaC
- Created: 2024-09-13T20:36:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-13T23:07:01.000Z (over 1 year ago)
- Last Synced: 2025-06-05T06:53:44.226Z (7 months ago)
- Language: Rust
- Size: 17.6 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vheader
> [!Important]
> I found out after that [Transmissions11 also made one for Vyper.](https://github.com/transmissions11/headers-vy)
Generate perfect Vyper code headers every time.
Forked from [transmissions11/headers](https://github.com/transmissions11/headers/tree/master)
> [!Note]
> [There is also a version of this built in python (to be installed with `pip`)](https://pypi.org/project/vheader/)
## Build
You need Rust and Cargo installed on your machine. See the installation guide
[here](https://doc.rust-lang.org/cargo/getting-started/installation.html).
Then clone the repo and install the CLI globally like this:
```sh
cargo install --path .
```
## Usage
```sh
vheader "external functions"
```
```python
# ------------------------------------------------------------------
# EXTERNAL FUNCTIONS
# ------------------------------------------------------------------
```
It will also copy the header to your clipboard automatically.
### With VSCode
Set your global [`tasks.json`](https://stackoverflow.com/questions/41046494/making-global-tasks-in-vs-code) like so to add the command as task:
```json
{
"version": "2.0.0",
"tasks": [
{
"label": "Generate Header",
"type": "shell",
"command": "vheader ${input:header}",
"presentation": {
"reveal": "never"
},
"problemMatcher": []
}
],
"inputs": [
{
"id": "header",
"description": "Header",
"type": "promptString"
}
]
}
```
To really speed-up your workflow, you can even add a keybind for the task in [`keybindings.json`](https://code.visualstudio.com/docs/getstarted/keybindings):
```json
[
{
"key": "CMD+h",
"command": "workbench.action.tasks.runTask",
"args": "Generate Header"
}
]
```
This will copy the generated header to your clipboard.
## Credits
- Inspired by virtualjpeg's [`blocky`](https://github.com/virtualjpeg/blocky).
- Forked from [transmissions11 headers](https://github.com/transmissions11/headers)