Skip to content

Commit 05376c5

Browse files
authored
Docs: Better design of hexdocs (#328)
* Cleanup in HexDocs * Moved config to separate page * Added missing `,`
1 parent 2700b23 commit 05376c5

6 files changed

Lines changed: 115 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
</div>
1010

11-
1211
LiveDebugger is a browser-based tool for debugging applications written in [Phoenix LiveView](https://github.com/phoenixframework/phoenix_live_view) - an Elixir library designed for building rich, interactive online experiences with server-rendered HTML.
1312

1413
Designed to enhance your development experience LiveDebugger gives you:
@@ -94,7 +93,7 @@ config :live_debugger,
9493
port: 4007, # Port on which LiveDebugger will be hosted
9594
secret_key_base: "YOUR_SECRET_KEY_BASE", # Secret key used for LiveDebugger.Endpoint
9695
signing_salt: "your_signing_salt", # Signing salt used for LiveDebugger.Endpoint
97-
adapter: Bandit.PhoenixAdapter # Adapter used in LiveDebugger.Endpoint
96+
adapter: Bandit.PhoenixAdapter, # Adapter used in LiveDebugger.Endpoint
9897
tracing_setup_delay: 0 # Time in ms after tracing will be initialized. Useful in case multi-nodes envs
9998
```
10099

docs/config.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
### Browser features
2+
3+
Some features require injecting JS into the debugged application. They are enabled by default, but you can disable them in your config.
4+
5+
```elixir
6+
# config/dev.exs
7+
8+
# Disables all browser features and does not inject LiveDebugger JS
9+
config :live_debugger, browser_features?: false
10+
11+
# Disables only debug button
12+
config :live_debugger, debug_button?: false
13+
```
14+
15+
### Content Security Policy
16+
17+
In `router.ex` of your Phoenix app, make sure your locally running Phoenix app can access the LiveDebugger JS files on port 4007. To achieve that you may need to extend your CSP in `:dev` mode:
18+
19+
```elixir
20+
@csp "{...your CSP} #{if Mix.env() == :dev, do: "http://127.0.0.1:4007"}"
21+
22+
pipeline :browser do
23+
# ...
24+
plug :put_secure_browser_headers, %{"content-security-policy" => @csp}
25+
```
26+
27+
### Other
28+
29+
```elixir
30+
# config/dev.exs
31+
32+
config :live_debugger,
33+
ip: {127, 0, 0, 1}, # IP on which LiveDebugger will be hosted
34+
port: 4007, # Port on which LiveDebugger will be hosted
35+
secret_key_base: "YOUR_SECRET_KEY_BASE", # Secret key used for LiveDebugger.Endpoint
36+
signing_salt: "your_signing_salt", # Signing salt used for LiveDebugger.Endpoint
37+
adapter: Bandit.PhoenixAdapter, # Adapter used in LiveDebugger.Endpoint
38+
tracing_setup_delay: 0 # Time in ms after tracing will be initialized. Useful in case multi-nodes envs
39+
```

docs/images/banner.jpg

151 KB
Loading

docs/images/logo.png

3.34 KB
Loading

docs/welcome.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
![LiveDebugger_Chrome_WebStore](images/banner.jpg)
2+
3+
LiveDebugger is a browser-based tool for debugging applications written in [Phoenix LiveView](https://github.com/phoenixframework/phoenix_live_view) - an Elixir library designed for building rich, interactive online experiences with server-rendered HTML.
4+
5+
Designed to enhance your development experience LiveDebugger gives you:
6+
7+
- A detailed view of your LiveComponents tree
8+
- The ability to inspect assigns for LiveViews and LiveComponents
9+
- Tracing of their callback executions
10+
11+
## Installation
12+
13+
> #### Important {: .info}
14+
>
15+
> LiveDebugger should not be used on production - make sure that the dependency you've added is `:dev` only
16+
17+
<!-- tabs-open -->
18+
19+
### Mix installation
20+
21+
Add `live_debugger` to your list of dependencies in `mix.exs`:
22+
23+
```elixir
24+
defp deps do
25+
[
26+
{:live_debugger, "~> 0.1.6", only: :dev}
27+
]
28+
end
29+
```
30+
31+
For full experience we recommend adding below line to your application root layout. It attaches `meta` tag and LiveDebugger scripts in dev environment enabling browser features.
32+
33+
```elixir
34+
# lib/my_app_web/components/layouts/root.html.heex
35+
36+
<head>
37+
<%= Application.get_env(:live_debugger, :live_debugger_tags) %>
38+
</head>
39+
```
40+
41+
After you start your application, LiveDebugger will be running at a default port `http://localhost:4007`.
42+
43+
### Igniter installation
44+
45+
LiveDebugger has [Igniter](https://github.com/ash-project/igniter) support - an alternative for standard mix installation. It'll automatically add LiveDebugger dependency and modify your `root.html.heex` after you use the below command.
46+
47+
```bash
48+
mix igniter.install live_debugger
49+
```
50+
51+
<!-- tabs-close -->
52+
53+
## Authors
54+
55+
LiveDebugger is created by Software Mansion.
56+
57+
Since 2012 [Software Mansion](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=livedebugger) is a software agency with experience in building web and mobile apps as well as complex multimedia solutions. We are Core React Native Contributors, Elixir ecosystem experts, and live streaming and broadcasting technologies specialists. We can help you build your next dream product – [Hire us](https://swmansion.com/contact/projects).
58+
59+
Copyright 2025, [Software Mansion](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=livedebugger)
60+
61+
[![Software Mansion](https://logo.swmansion.com/logo?color=white&variant=desktop&width=200&tag=livedebugger-github)](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=livedebugger)
62+
63+
Licensed under the [Apache License, Version 2.0](LICENSE)

mix.exs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,19 @@ defmodule LiveDebugger.MixProject do
7777

7878
defp docs() do
7979
[
80-
main: "readme",
81-
extras: ["README.md", "LICENSE"],
80+
main: "welcome",
81+
logo: "./docs/images/logo.png",
82+
extras: [
83+
"docs/welcome.md": [title: "Welcome to LiveDebugger"],
84+
"docs/config.md": [title: "Configuration"]
85+
],
8286
source_url: "https://github.com/software-mansion/live-debugger",
83-
source_ref: @version
87+
source_ref: @version,
88+
api_reference: false,
89+
assets: %{Path.expand("./docs/images") => "images"},
90+
filter_modules: fn module, _meta ->
91+
module == Mix.Tasks.LiveDebugger.Install
92+
end
8493
]
8594
end
8695

0 commit comments

Comments
 (0)