|
1 |
| -# Clutter |
| 1 | +# [# Clutter #] |
2 | 2 |
|
3 |
| -## Installation |
| 3 | +Clutter facilitates an unintrusive way to link textual content in a source tree. Think ctags for comments. |
| 4 | + |
| 5 | +The motivation is to be able to link various concepts in the code base, making implicit links between code segments explicit. |
| 6 | + |
| 7 | +## TL;DR |
4 | 8 |
|
5 |
| -### Using GO |
| 9 | +Given: |
| 10 | + |
| 11 | +`README.md`: |
6 | 12 |
|
7 | 13 | ```
|
8 |
| -go install github.com/cluttercode/clutter/cmd/clutter |
| 14 | +The code here include implementations for functions in each language to print a cat vocalization. |
| 15 | +See [# cat #] for all implementations. |
| 16 | +``` |
| 17 | + |
| 18 | +`cat.go`: |
| 19 | + |
| 20 | +```go |
| 21 | +package cat |
| 22 | + |
| 23 | +import "fmt" |
| 24 | + |
| 25 | +func cat() { // [# cat lang=go #] |
| 26 | + fmt.Println("meow") |
| 27 | +} |
9 | 28 | ```
|
10 | 29 |
|
11 |
| -### From Source |
| 30 | +`cat.py`: |
12 | 31 |
|
| 32 | +```python |
| 33 | +def cat(): # [# cat lang=python #] |
| 34 | + print("meow") |
13 | 35 | ```
|
14 |
| -make install |
| 36 | + |
| 37 | +`cat.c`: |
| 38 | + |
| 39 | +```c |
| 40 | +#include <stdio.h> |
| 41 | + |
| 42 | +void cat() { // [# cat lang=c #] |
| 43 | + printf("meow\n") |
| 44 | +} |
| 45 | + |
| 46 | +``` |
| 47 | + |
| 48 | +`cat.hs`: |
| 49 | + |
| 50 | +```haskell |
| 51 | +cat = putStrLn("meow") -- [# cat lang=haskell #] |
| 52 | +``` |
| 53 | + |
| 54 | +Clutter allows to: |
| 55 | + |
| 56 | +``` |
| 57 | +$ clutter search cat |
| 58 | +cat README.md:2 |
| 59 | +cat cat.c:3 lang=c |
| 60 | +cat cat.go:6 lang=go |
| 61 | +cat cat.hs:1 lang=haskell |
| 62 | +cat cat.py:2 lang=python |
| 63 | +
|
| 64 | +$ clutter search -g cat lang=py\* |
| 65 | +cat cat.py:2 lang=python |
15 | 66 | ```
|
16 | 67 |
|
| 68 | +## Syntax |
| 69 | + |
| 70 | +``` |
| 71 | +[# name attr1 attr2=value2 #] |
| 72 | +``` |
| 73 | + |
| 74 | +`[# @attr name #]` translates to `[# name attr #]`, which is the same as `[# name attr= #]`. |
| 75 | + |
| 76 | +`[# .name #]` translates to `[# name scope="current filename" #]`. |
| 77 | + |
| 78 | +`[# ./name #]` translates to `[# name scope="current dir" #]`. |
| 79 | + |
| 80 | +## Integrations |
| 81 | + |
| 82 | +- [Vim Plugin](https://github.com/cluttercode/vim-clutter) |
| 83 | + |
| 84 | +- [Sphinx Extension](https://github.com/cluttercode/sphinx-clutter) |
| 85 | + |
| 86 | +## Installation |
| 87 | + |
17 | 88 | ### Using gobinaries
|
18 | 89 |
|
| 90 | +```shell |
| 91 | +curl -sf https://gobinaries.com/cluttercode/clutter/cmd/clutter@latest | sh |
19 | 92 | ```
|
20 |
| -$ curl -sf https://gobinaries.com/cluttercode/clutter/cmd/clutter@latest | sh |
| 93 | + |
| 94 | +### Using go |
| 95 | + |
| 96 | +```shell |
| 97 | +go install github.com/cluttercode/clutter/cmd/clutter |
21 | 98 | ```
|
22 | 99 |
|
23 | 100 | ### Prebuilt binaries
|
24 | 101 |
|
25 |
| -From [releases](https://github.com/cluttercode/clutter/releases). |
| 102 | +See [releases](https://github.com/cluttercode/clutter/releases). |
| 103 | + |
| 104 | +### From source |
| 105 | + |
| 106 | +```shell |
| 107 | +make install |
| 108 | +``` |
| 109 | + |
| 110 | +## TODO |
| 111 | + |
| 112 | +- [ ] Docs: resolve, search |
| 113 | +- [ ] More tests |
| 114 | +- [ ] Cross repo. |
| 115 | + |
| 116 | +- [ ] Only account for tags in comments. |
0 commit comments