Skip to content

Commit ef84c69

Browse files
committed
feat: update docs
1 parent ae226aa commit ef84c69

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

_includes/links.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<li>
2-
<a href="https://www.bonobo-project.org/" target="_blank">Bonobo (extract transform load)</a>
3-
</li>
4-
<li>
5-
<a href="https://python-medikit.github.io/" target="_blank">Medikit (release management)</a>
6-
</li>
7-
<li>
8-
<a href="https://python-mondrian.github.io/" target="_blank">Mondrian (logging simplified)</a>
2+
<a href="https://harp-proxy.net/" target="_blank">HARP Proxy (http proxy for APIs)</a>
93
</li>
104
<li>
115
<a href="https://python-whistle.github.io/" target="_blank">Whistle (event dispatcher)</a>

_includes/topnav.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div id="navbar" class="collapse navbar-collapse">
1515
<div class="navbar-right">
1616
<ul class="nav navbar-nav">
17-
<li><a href="#documentation"><i class="fa fa-book" aria-hidden="true"></i> Documentation</a></li>
17+
<li><a href="https://python-whistle.readthedocs.io/" target="_blank"><i class="fa fa-book" aria-hidden="true"></i> Documentation</a></li>
1818
<li><a href="{{ site.git_address }}" target="_blank"><i class="fa fa-github" aria-hidden="true"></i> Sources</a></li>
1919
</ul>
2020
</div>

index.html

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h2>Event Dispatcher for Python</h2>
2121
<p class="text-center">
2222
<a class="btn btn-primary btn-lg" href="https://pypi.org/project/whistle/" target="_blank"
2323
role="button">Install</a>
24-
<a class="btn btn-primary btn-outline-inverse btn-lg" href="#documentation"
24+
<a class="btn btn-primary btn-outline-inverse btn-lg" href="https://python-whistle.readthedocs.io/" target="_blank"
2525
role="button">Documentation</a>
2626
</p>
2727
</div>
@@ -35,14 +35,14 @@ <h2>Event Dispatcher for Python</h2>
3535
<h2 class="header-light regular-pad">What is Whistle?</h2>
3636
<blockquote>
3737
<p>
38-
Whistle is an Event Dispatcher library for the Python 3.5+ language.
38+
Whistle is a lightweight Event Dispatcher library for Python 3.10+ that enables decoupled application communication through event dispatching and listening.
3939
</p>
4040
<p>
4141
It's largely inspired from Symfony's EventDispatcher component.
4242
</p>
4343
<p>
4444
Using an event dispatcher is a great way to write loosely coupled extensible code, having each part
45-
only communicate using light events.
45+
only communicate using light events, making your code more modular, testable, and maintainable.
4646
</p>
4747
</blockquote>
4848
</div>
@@ -66,6 +66,26 @@ <h2 class="header-light regular-pad">What is Whistle?</h2>
6666

6767
<hr>
6868

69+
<div class="row">
70+
<h2>Key Features</h2>
71+
<div class="col-md-6">
72+
<ul>
73+
<li><strong>Synchronous and asynchronous dispatching</strong> - Choose the right dispatcher for your use case</li>
74+
<li><strong>Priority-based listener execution</strong> - Control the order listeners run</li>
75+
<li><strong>Event propagation control</strong> - Stop event flow when needed</li>
76+
</ul>
77+
</div>
78+
<div class="col-md-6">
79+
<ul>
80+
<li><strong>Type safety</strong> - Prevent mixing sync and async listeners</li>
81+
<li><strong>Custom events</strong> - Attach domain-specific data to events</li>
82+
<li><strong>Zero dependencies</strong> - Lightweight and easy to integrate</li>
83+
</ul>
84+
</div>
85+
</div>
86+
87+
<hr>
88+
6989
<div class="row">
7090
<h2>Quick start</h2>
7191

@@ -86,9 +106,17 @@ <h3>Add a listener to react to events</h3>
86106

87107
dispatcher.add_listener('spectacle.starts', on_spectacle_starts)</code></pre>
88108

109+
<p>Or use the decorator syntax for convenience:</p>
110+
111+
<pre><code class="python">@dispatcher.listen('spectacle.starts')
112+
def on_spectacle_starts(event):
113+
print('Please turn down your phones!')
114+
</code></pre>
115+
89116
<h3>Dispatch it!</h3>
90117

91-
<pre><code class="python">dispatcher.dispatch('spectacle.starts')</code></pre>
118+
<pre><code class="python">dispatcher.dispatch('spectacle.starts')
119+
# Output: Please turn down your phones!</code></pre>
92120

93121

94122
</div>

0 commit comments

Comments
 (0)