commit 78c2937ea1f19177c930b0f3c3ca941e07bc9c64
parent 63e7dde46ada7abfc663b7ce6cdd70e244e6753b
Author: Friedel Schön <[email protected]>
Date: Mon, 24 Oct 2022 14:33:28 +0200
add FAQ's and installing binary
Diffstat:
5 files changed, 57 insertions(+), 20 deletions(-)
diff --git a/LICENSE b/LICENSE.txt
diff --git a/README.md b/README.md
@@ -11,7 +11,7 @@
### Building from HEAD
Get the repository with `git` and compile everything with `dub`
-```
+```bash
$ git clone https://github.com/friedelschoen/importsort-d
$ cd importsort-d
$ dub build
@@ -21,9 +21,19 @@ If everything went fine, there should be a binary at `bin/importsort-d`.
Copy this into a directory included in `$PATH` (`/usr/bin` for example) to make this command work globally.
-### Building with DUB
+```bash
+$ sudo cp bin/importsort-d /usr/bin/
+```
+or add this into your `.bashrc`, `.zshrc`, etc.
+```bash
+export PATH=$PATH:"<path/to/importsort-d>/bin/" # on bash or zsh
+fish_add_path "<path/to/importsort-d>/bin/" # on fish-shell
```
+
+### Building with DUB
+
+```bash
$ dub fetch importsort-d
$ dub run importsort-d -- --help
```
@@ -32,7 +42,7 @@ This won't install the command globally, you always have to run `dub run imports
## Usage
-```
+```bash
$ importsort-d [-h] [-v] [-r] [-m] [-i] [-o <out>] [-k] [-a] [-r] <input...>
```
`input` may be omitted or set to `-` to read from STDIN
@@ -53,18 +63,40 @@ $ importsort-d [-h] [-v] [-r] [-m] [-i] [-o <out>] [-k] [-a] [-r] <input...>
## Documentation
-Look at the documentation on [`dpldocs.info`](https://importsort-d.dpldocs.info/), if you want to use this project in code.
+Look at the documentation at [`dpldocs.info`](https://importsort-d.dpldocs.info/), if you want to use this project in code.
## FAQ
-For example, how to add `importsort-d` to Visual Studio Code and other: [go here](/docs/tips-tricks)
+### How to add `importsort-d` to Visual Studio Code?
+> There's a plugin called [Run on Save](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave). You can install it and set `importsort-d` as an onSave-hook:
+```json
+...
+"emeraldwalk.runonsave": {
+ "commands": [
+ {
+ "cmd": "importsort-d -i ${file}",
+ "match": "\\.d$"
+ }
+ ]
+},
+...
+```
+
+### How to add `importsort-d` to VIM/NeoVIM?
+> Just add this to your `.vimrc` or `init.vim`
+```vim
+:autocmd BufWritePost * silent !importsort-d -i <afile>
+```
+
+### Are cats cool?
+> Yes
## ToDo's
- [x] recursive searching (`v0.2.0`)
- [x] merge imports (`v0.3.0`)
- [ ] watch-mode (struggling with save-timings - can clear files)
- - you can add importsort-d into your onSave-hooks (e. g. [Run on Save](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave) on VSCode)
+ - you can add importsort-d into your onSave-hooks
- [ ] support multiple imports in one line (demilited by `;`)
- [ ] stripping unused imports (maybe)
@@ -87,7 +119,7 @@ For example, how to add `importsort-d` to Visual Studio Code and other: [go here
- added `--merge` (see above)
### `v0.3.1`
-- added documentation for contributers (or people who wan't to see my code)
+- added documentation for contributers (or people who really want to see my code)
## License
diff --git a/_config.yml b/_config.yml
@@ -11,3 +11,4 @@ github:
zip_url: https://github.com/friedelschoen/importsort-d/zipball/master
tar_url: https://github.com/friedelschoen/importsort-d/tarball/master
owner_name: Friedel Schön
+ commit_url: https://github.com/friedelschoen/importsort-d/commits
diff --git a/_layouts/default.html b/_layouts/default.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="{{ site.lang | default: " en-US" }}">
+<html lang="{{ site.lang | default: 'en-US' }}">
<head>
<meta charset="UTF-8">
@@ -11,19 +11,20 @@
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
- {% include head-custom.html %}
<style>
- header {
- width: 360px;
+ .wrapper {
+ width: 1000px;
}
- header .downloads {
+ footer,
+ header .downloads,
+ header {
width: 360px;
}
- .wrapper {
- width: 950px;
+ section {
+ width: 550px;
}
</style>
</head>
@@ -40,10 +41,15 @@
<p>{{ site.description | default: site.github.project_tagline }}</p>
<p>
- <a href="https://code.dlang.org/packages/importsort-d/">
- <img src="https://img.shields.io/dub/v/importsort-d?color=b03931" /></a>
- <img src="https://img.shields.io/dub/l/importsort-d" />
- <img src="https://img.shields.io/github/commit-activity/m/friedelschoen/importsort-d" />
+ <a href="{{ site.dub_url }}">
+ <img src="https://img.shields.io/dub/v/importsort-d?color=b03931" />
+ </a>
+ <a href="LICENSE.txt">
+ <img src="https://img.shields.io/dub/l/importsort-d" />
+ </a>
+ <a href="{{ site.github.commit_url }}">
+ <img src="https://img.shields.io/github/commit-activity/m/friedelschoen/importsort-d" />
+ </a>
</p>
{% if site.github.is_user_page %}
diff --git a/docs/tips-tricks.md b/docs/tips-tricks.md
@@ -1 +0,0 @@
-# Coming soon
-\ No newline at end of file