Skip to content

Commit d22feb2

Browse files
committed
docs: add the plugin introduction guide
1 parent bc16af7 commit d22feb2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

guides/plugins/introduction.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Introduction to the plugin system
2+
3+
For more customization, `TypedStructor` provides a plugin system
4+
that allows you to extend the functionality of the library.
5+
This is useful when you want to extract some common logic into a separate module.
6+
7+
See `TypedStructor.Plugin` for how to create a plugin.
8+
9+
This library comes with a few built-in plugins, and we don't like to
10+
implement more built-in plugins, but instead, we encourage you to create your own plugins.
11+
We provide some example plugins that you can use as a reference, or copy-paste.
12+
13+
**Plugin examples:**
14+
- [Registering plugins globally](./registering_plugins_globally.md)
15+
- `TypedStructor.Plugins.Accessible`
16+
- [Type Only on Ecto Schema](./type_only_on_ecto_schema.md)
17+
- [Add primary key and timestamps types to your Ecto schema](./primary_key_and_timestamps.md)

mix.exs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ defmodule TypedStructor.MixProject do
3131
"guides/migrate_from_typed_struct.md",
3232

3333
# plugins
34+
{"guides/plugins/introduction.md", [title: "Introduction"]},
3435
"guides/plugins/registering_plugins_globally.md",
3536
"guides/plugins/type_only_on_ecto_schema.md",
3637
"guides/plugins/primary_key_and_timestamps.md"

0 commit comments

Comments
 (0)