Skip to content

Commit a9a1c8d

Browse files
committed
Improve readme
1 parent 98e019c commit a9a1c8d

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,19 @@ iex> project.get_module(MyApp.Model.User)
5757
}
5858
```
5959

60-
By default module information is rather basic, but with help of custom classifiers it can be easily augmented with data that is important in the context of your project (see "Classifiers" section below).
60+
By default module information is rather basic, but with help of custom classifiers modules can be annotated with extra information that is important in the context of your project (see [Classifiers](#classifiers) section).
61+
62+
### Filtering modules by annotations
63+
64+
Filtering by tags in built-in `Tracex.Project.get_modules/2`, extra annotations must be filtered manually.
65+
66+
```elixir
67+
project
68+
|> Tracex.Project.get_modules(tags: [:phoenix_controller, :phoenix_view])
69+
|> Enum.filter(fn %{extra: extra} -> Map.get(extra, :context) == "Users" end)
70+
```
71+
72+
### Module insights
6173

6274
To get some insights into how a module is used and how it interacts with other modules in your project use `Tracex.insights/2`
6375

@@ -82,7 +94,8 @@ iex> Tracex.insights(traces, MyApp.Model.User)
8294

8395
Module insights encapsulate the information provided by compiler tracers. At the very minimum you can get some idea how the module interacts with others and possibly track down dependencies contributing to extensive recompilations in your project.
8496

85-
## Classifiers
97+
98+
### Classifiers
8699

87100
Tracex is generic, it is able to extract some basic information about your project modules, but every project has its own unique characteristics, like naming conventions or usage of certain macros. Classifiers make it easy to leverage that tacit knowledge to annotate your project's modules.
88101

@@ -156,16 +169,6 @@ iex> c "my_classifier.exs"
156169
iex> Tracex.compile_project(custom_classifiers: [MyClassifier])
157170
```
158171

159-
### Filtering modules by annotations
160-
161-
Filtering by tags in built-in `Tracex.Project.get_modules/2`, extra annotations must be filtered manually.
162-
163-
```elixir
164-
project
165-
|> Tracex.Project.get_modules(tags: [:phoenix_controller, :phoenix_view])
166-
|> Enum.filter(fn %{extra: extra} -> Map.get(extra, :context) == "Users" end)
167-
```
168-
169172
## State of the library
170173

171174
Tracex is highly experimental and completely untested. The interface is a subject to change.

0 commit comments

Comments
 (0)