Skip to content

Commit

Permalink
Merge branch 'main' into apb/error-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp committed Oct 12, 2023
2 parents e7db3fc + 9a72447 commit 3a4da69
Show file tree
Hide file tree
Showing 15 changed files with 89 additions and 56 deletions.
32 changes: 1 addition & 31 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How to contribute
# How to Contribute

## Issue Tags

Expand Down Expand Up @@ -45,33 +45,3 @@ get accepted:

If your pull-request addresses an issue then please add the corresponding
issue's number to the description of your pull-request.

# How to work with this project locally

## Installation

First clone this repository:

```sh
git clone [email protected]:BeaconCMS/beacon.git
```

Call setup to install deps:

```sh
mix setup
```

## Running tests

```sh
mix test
```

## Running a local app

```sh
iex -S mix dev
```

Check out https://github.com/BeaconCMS/beacon/blob/main/dev.exs and visit http://localhost:4001/dev/home
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Main components:
- Admin - LiveView UI to manage layouts, pages, and all other resources. See https://github.com/BeaconCMS/beacon_live_admin
- Page Builder - An easy to use, drag & drop UI for building pages, targeted to non-technical users. Not released yet, in the initial stages of development.

## Contributing

Check out the [CONTRIBUTING.md](https://github.com/BeaconCMS/beacon/blob/main/CONTRIBUTING.md) doc for overall guidelines to contribute to this project,
then follow the [Local Development](https://github.com/BeaconCMS/beacon#local-development) steps to run a local project or watch the video below to understand more
about Beacon internals:

<a href="https://www.youtube.com/watch?v=5jk0fIJOFuc">
<img src="https://raw.githubusercontent.com/BeaconCMS/beacon/main/assets/images/youtube_card.png" width="512" alt="YouTube card - ElixirConf 2023 - Leandro Pereira - Beacon: The next generation of CMS in Phoenix LiveView">
</a>

## Local Development

The file `dev.exs` is a self-contained Phoenix application running Beacon with sample data and code reloading enabled. Follow these steps to get a site up and running:
Expand All @@ -48,3 +58,12 @@ Note that running a named node isn't required unless you're running Beacon LiveA

Finally, visit any of the routes defined in `dev.exs` as http://localhost:4001/dev/home
or request resources from the API as http://localhost:4001/api/pages

## Looking for help with your Elixir project?

<img src="assets/images/dockyard_logo.png" width="256" alt="DockYard logo">

At DockYard we are [ready to help you build your next Elixir project](https://dockyard.com/phoenix-consulting).
We have a unique expertise in Elixir and Phoenix development that is unmatched and we love to [write about Elixir](https://dockyard.com/blog/categories/elixir).

Have a project in mind? [Get in touch](https://dockyard.com/contact/hire-us)!
Binary file added assets/images/dockyard_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/youtube_card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions guides/deployment/fly.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Once you have a Beacon site up and running locally, you can have it deployed on

## Fly.io CLI

Firstly instal the fly cli tool as described at https://fly.io/docs/hands-on/install-flyctl. You're gonna use it to deploy your beacon site.
Firstly, install the Fly CLI tool as described at https://fly.io/docs/hands-on/install-flyctl. You're going to use it to deploy your beacon site.

## Sign in or sign up

Expand All @@ -22,7 +22,7 @@ fly auth login

## Dockerfile

Aplications on Fly run on containers, let's generate a Dockerfile and other supporting files, and then make a couple of changes:
Applications on Fly run on containers, let's generate a Dockerfile and other supporting files, and then make a couple of changes:

Run:

Expand Down Expand Up @@ -122,7 +122,7 @@ Before we can access the deployed site let's run seeds to populate some sample d
fly ssh console
```

2. Open a IEx console:
2. Open an IEx console:

```sh
app/bin/my_app remote
Expand All @@ -134,11 +134,11 @@ app/bin/my_app remote
MyApp.Release.beacon_seeds
```

Note that you could save some commands and just call `fly ssh console --command "/app/bin/beacon_seeds"` to run seeds, but it may fail and at this momment it's recommended to connected to the instance as showed before.
Note that you could save some commands and just call `fly ssh console --command "/app/bin/beacon_seeds"` to run seeds, but it may fail and at this momment it's recommended to connect to the instance as shown before.

## Open

Finally run the following command to see your site live:
Finally, run the following command to see your site live:

```sh
fly open my_site/home
Expand Down
10 changes: 5 additions & 5 deletions guides/introduction/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Beacon is an application that runs on top of an existing Phoenix LiveView applic

## TLDR

We recomment following the guide thoroughly, but if you want a short version or to just recap the main steps:
We recommend following the guide thoroughly, but if you want a short version or to just recap the main steps:

1. Install Elixir v1.14+

Expand All @@ -30,7 +30,7 @@ We recomment following the guide thoroughly, but if you want a short version or

6. Run `mix deps.get`

7. Add `:beacon` dependency to `.formatter.exs` in `:
7. Add `:beacon` to `import_deps` in the .formatter.exs file.

8. Run `mix beacon.install --site my_site`

Expand Down Expand Up @@ -112,8 +112,8 @@ mix deps.get

```elixir
[
import_deps: [:ecto, :ecto_sql, :phoenix, :beacon],
# rest of file
import_deps: [:ecto, :ecto_sql, :phoenix, :beacon],
# rest of file
]
```

Expand Down Expand Up @@ -296,7 +296,7 @@ For more info on site options, check out `Beacon.start_link/1`.
<main>
<h2>A blog</h2>
<ul>
<li>Path Params Blog Slug: <%%= @beacon_path_params.blog_slug %></li>
<li>Path Params Blog Slug: <%%= @beacon_path_params["blog_slug"] %></li>
<li>Live Data blog_slug_uppercase: <%%= @beacon_live_data.blog_slug_uppercase %></li>
</ul>
</main>
Expand Down
4 changes: 2 additions & 2 deletions lib/beacon/loader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ defmodule Beacon.Loader do
end

defp load_site_from_db(site) do
with :ok <- Beacon.RuntimeJS.load(),
with :ok <- Beacon.RuntimeJS.load!(),
:ok <- load_runtime_css(site),
:ok <- load_stylesheets(site),
:ok <- load_components(site),
Expand Down Expand Up @@ -193,7 +193,7 @@ defmodule Beacon.Loader do
if Code.ensure_loaded?(Mix.Project) and Mix.env() == :test do
defp load_runtime_css(_site), do: :ok
else
defp load_runtime_css(site), do: Beacon.RuntimeCSS.load(site)
defp load_runtime_css(site), do: Beacon.RuntimeCSS.load!(site)
end

defp load_stylesheets(site) do
Expand Down
4 changes: 2 additions & 2 deletions lib/beacon/runtime_css.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ defmodule Beacon.RuntimeCSS do
end

@doc false
def load(site) do
def load!(site) do
{:ok, css} = compile(site)

case :brotli.encode(css) do
case ExBrotli.compress(css) do
{:ok, compressed} ->
hash = Base.encode16(:crypto.hash(:md5, css), case: :lower)
true = :ets.insert(:beacon_assets, {{site, :css}, {hash, css, compressed}})
Expand Down
4 changes: 2 additions & 2 deletions lib/beacon/runtime_js.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ defmodule Beacon.RuntimeJS do
end
end

def load do
def load! do
js = build()

case :brotli.encode(js) do
case ExBrotli.compress(js) do
{:ok, compressed} ->
hash = Base.encode16(:crypto.hash(:md5, js), case: :lower)
true = :ets.insert(:beacon_assets, {:js, {hash, js, compressed}})
Expand Down
16 changes: 13 additions & 3 deletions lib/beacon/template/markdown.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@ defmodule Beacon.Template.Markdown do

# TODO: implement a markdown format that is aware of Phoenix features like link attrs and assigns

@doc """
Convert a markdown `template` into HTML using [mdex](https://hex.pm/packages/mdex)
## Options
* `:syntax_highlight_theme` (default `"onedark"`) - see https://hexdocs.pm/mdex/MDEx.html#to_html/2 for more info.
"""
@spec convert_to_html(Beacon.Template.t(), Beacon.Template.LoadMetadata.t()) :: {:cont, Beacon.Template.t()} | {:halt, Exception.t()}
def convert_to_html(template, _metadata) do
def convert_to_html(template, _metadata, opts \\ []) do
syntax_highlight_theme = Keyword.get(opts, :syntax_highlight_theme, "onedark")

template =
MDEx.to_html(template,
extension: [
strikethrough: true,
tagfilter: true,
tagfilter: false,
table: true,
autolink: true,
tasklist: true,
Expand All @@ -26,7 +36,7 @@ defmodule Beacon.Template.Markdown do
unsafe_: true
],
features: [
syntax_highlight_theme: "Dracula"
syntax_highlight_theme: syntax_highlight_theme
]
)

Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ defmodule Beacon.MixProject do
defp deps do
[
{:accent, "~> 1.1"},
{:brotli, "~> 0.3.2"},
{:bypass, "~> 2.1", only: :test},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.2", only: :dev, runtime: false},
{:ecto_sql, "~> 3.6"},
{:esbuild, "~> 0.5", only: :dev},
{:ex_brotli, "~> 0.3"},
{:ex_doc, "~> 0.29", only: :docs},
{:ex_aws, "~> 2.4"},
{:ex_aws_s3, "~> 2.4"},
Expand Down Expand Up @@ -79,7 +79,7 @@ defmodule Beacon.MixProject do
if path = System.get_env("MDEX_PATH") do
{:mdex, path: path}
else
{:mdex, "~> 0.1.6"}
{:mdex, "~> 0.1.9"}
end
end

Expand Down
6 changes: 3 additions & 3 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
%{
"accent": {:hex, :accent, "1.1.1", "20257356446d45078b19b91608f74669b407b39af891ee3db9ee6824d1cae19d", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.3", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "6d5afa50d4886e3370e04fa501468cbaa6c4b5fe926f72ccfa844ad9e259adae"},
"brotli": {:hex, :brotli, "0.3.2", "59cf45a399098516f1d34f70d8e010e5c9bf326659d3ef34c7cc56793339002b", [:rebar3], [], "hexpm", "9ec3ef9c753f80d0c657b4905193c55e5198f169fa1d1c044d8601d4d931a2ad"},
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"bypass": {:hex, :bypass, "2.1.0", "909782781bf8e20ee86a9cabde36b259d44af8b9f38756173e8f5e2e1fabb9b1", [:mix], [{:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: false]}, {:ranch, "~> 1.3", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "d9b5df8fa5b7a6efa08384e9bbecfe4ce61c77d28a4282f79e02f1ef78d96b80"},
"castore": {:hex, :castore, "1.0.3", "7130ba6d24c8424014194676d608cb989f62ef8039efd50ff4b3f33286d06db8", [:mix], [], "hexpm", "680ab01ef5d15b161ed6a95449fac5c6b8f60055677a8e79acf01b27baa4390b"},
Expand All @@ -21,6 +20,7 @@
"esbuild": {:hex, :esbuild, "0.7.0", "ce3afb13cd2c5fd63e13c0e2d0e0831487a97a7696cfa563707342bb825d122a", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}], "hexpm", "4ae9f4f237c5ebcb001390b8ada65a12fb2bb04f3fe3d1f1692b7a06fbfe8752"},
"ex_aws": {:hex, :ex_aws, "2.4.3", "6c6d88ba7b9c07e3b0f4b70406d5fccb9f5358f5ef18138f7bd396f7863e8255", [:mix], [{:configparser_ex, "~> 4.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8 or ~> 3.0", [hex: :jsx, repo: "hexpm", optional: true]}, {:mime, "~> 1.2 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:sweet_xml, "~> 0.7", [hex: :sweet_xml, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "67f61f8b6aec740150d483a21f551fabce26a481d9917305ed2bb47717007519"},
"ex_aws_s3": {:hex, :ex_aws_s3, "2.4.0", "ce8decb6b523381812798396bc0e3aaa62282e1b40520125d1f4eff4abdff0f4", [:mix], [{:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:sweet_xml, ">= 0.0.0", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "85dda6e27754d94582869d39cba3241d9ea60b6aa4167f9c88e309dc687e56bb"},
"ex_brotli": {:hex, :ex_brotli, "0.3.0", "69d5f3720df70d5c89d1395d8fbe49ba37466b626834aaf6d77c72e0c93cf975", [:mix], [{:phoenix, ">= 0.0.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:rustler, "~> 0.29", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.6", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "8e46982f7d20069419ca8c8c54f9f3ebd9fa0e1d094c54cbf8ce3d636d84dfa7"},
"ex_doc": {:hex, :ex_doc, "0.29.4", "6257ecbb20c7396b1fe5accd55b7b0d23f44b6aa18017b415cb4c2b91d997729", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "2c6699a737ae46cb61e4ed012af931b57b699643b24dabe2400a8168414bc4f5"},
"expo": {:hex, :expo, "0.4.1", "1c61d18a5df197dfda38861673d392e642649a9cef7694d2f97a587b2cfb319b", [:mix], [], "hexpm", "2ff7ba7a798c8c543c12550fa0e2cbc81b95d4974c65855d8d15ba7b37a1ce47"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
Expand All @@ -35,7 +35,7 @@
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
"mdex": {:hex, :mdex, "0.1.6", "ce705242117d26fe4c8a3385227ef466154f14d12975930a8f5ad6033d340e92", [:mix], [{:rustler, ">= 0.0.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.6", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "a8c2512748adb826af7c45f754e6350ec632ca69003cc03602cf473dfef1bb14"},
"mdex": {:hex, :mdex, "0.1.9", "e88d097ecb8ecd76e9836b3c54b89755a93313e73c07e8a36d6949807ee421b6", [:mix], [{:rustler, ">= 0.0.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.6", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "9923558c37d6135dc9e3ed1288edfbbc5c90f5c4e609b8105a8efbab7d98f724"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
Expand All @@ -56,7 +56,7 @@
"postgrex": {:hex, :postgrex, "0.17.1", "01c29fd1205940ee55f7addb8f1dc25618ca63a8817e56fac4f6846fc2cddcbe", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "14b057b488e73be2beee508fb1955d8db90d6485c6466428fe9ccf1d6692a555"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"rustler": {:hex, :rustler, "0.29.1", "880f20ae3027bd7945def6cea767f5257bc926f33ff50c0d5d5a5315883c084d", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:toml, "~> 0.6", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "109497d701861bfcd26eb8f5801fe327a8eef304f56a5b63ef61151ff44ac9b6"},
"rustler_precompiled": {:hex, :rustler_precompiled, "0.6.3", "f838d94bc35e1844973ee7266127b156fdc962e9e8b7ff666c8fb4fed7964d23", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: true]}], "hexpm", "e18ecca3669a7454b3a2be75ae6c3ef01d550bc9a8cf5fbddcfff843b881d7c6"},
"rustler_precompiled": {:hex, :rustler_precompiled, "0.7.0", "5d0834fc06dbc76dd1034482f17b1797df0dba9b491cef8bb045fcaca94bcade", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:rustler, "~> 0.23", [hex: :rustler, repo: "hexpm", optional: true]}], "hexpm", "fdf43a6835f4e4de5bfbc4c019bfb8c46d124bd4635fefa3e20d9a2bbbec1512"},
"safe_code": {:git, "https://github.com/TheFirstAvenger/safe_code.git", "9907b385f1b71c0602183bf7fd8732570252b622", []},
"solid": {:hex, :solid, "0.14.1", "61b454dc7e7bf8a56926e805a0d047f817a993c28af71c9b79b840482da1ba5a", [:mix], [{:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5fda2b9176d7a71f52cca7f694d8ca75aed3f1b5b76dd175ada30b2756f96bae"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
Expand Down
17 changes: 17 additions & 0 deletions test/beacon/runtime_css_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
defmodule Beacon.RuntimeCSSTest do
use BeaconWeb.ConnCase, async: false

alias Beacon.RuntimeCSS

@site :my_site

setup_all do
start_supervised!({Beacon.Loader, Beacon.Config.fetch!(@site)})
:ok
end

test "load!" do
assert RuntimeCSS.load!(@site) == :ok
assert @site |> RuntimeCSS.fetch() |> :erlang.size() > 100
end
end
17 changes: 17 additions & 0 deletions test/beacon/runtime_js_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
defmodule Beacon.RuntimeJSTest do
use BeaconWeb.ConnCase, async: false

alias Beacon.RuntimeJS

@site :my_site

setup_all do
start_supervised!({Beacon.Loader, Beacon.Config.fetch!(@site)})
:ok
end

test "load" do
assert RuntimeJS.load!() == :ok
assert RuntimeJS.fetch() |> :erlang.size() > 100
end
end
2 changes: 1 addition & 1 deletion test/beacon/template/markdown_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ defmodule Beacon.Template.MarkdownTest do
%{}
) ==
{:cont,
"<h1>Test</h1>\n<p>Paragraph</p>\n<pre style=\"background-color:#282a36;\"><code class=\"language-elixir\"><span style=\"color:#ff79c6;\">defmodule </span><span style=\"text-decoration:underline;color:#8be9fd;\">MyApp </span><span style=\"color:#ff79c6;\">do\n</span><span style=\"color:#f8f8f2;\"> </span><span style=\"color:#6272a4;\">@moduledoc &quot;Test&quot;\n</span><span style=\"color:#f8f8f2;\">\n</span><span style=\"color:#f8f8f2;\"> </span><span style=\"color:#ff79c6;\">def </span><span style=\"color:#50fa7b;\">foo</span><span style=\"color:#f8f8f2;\">, </span><span style=\"color:#bd93f9;\">do: :bar\n</span><span style=\"color:#ff79c6;\">end\n</span></code></pre>\n"}
"<h1>Test</h1>\n<p>Paragraph</p>\n<pre class=\"autumn highlight\" style=\"background-color: #282C34; color: #ABB2BF;\">\n<code class=\"language-elixir\"><span class=\"keyword\" style=\"color: #E06C75;\">defmodule</span> <span class=\"namespace\" style=\"color: #61AFEF;\">MyApp</span> <span class=\"keyword\" style=\"color: #E06C75;\">do</span>\n <span class=\"comment\" style=\"font-style: italic; color: #5C6370;\">@</span><span class=\"comment\" style=\"font-style: italic; color: #5C6370;\">moduledoc</span> <span class=\"comment\" style=\"font-style: italic; color: #5C6370;\">&quot;Test&quot;</span>\n\n <span class=\"keyword\" style=\"color: #E06C75;\">def</span> <span class=\"function\" style=\"color: #61AFEF;\">foo</span><span class=\"\" style=\"color: #ABB2BF;\">,</span> <span class=\"string\" style=\"color: #98C379;\">do: </span><span class=\"string\" style=\"color: #98C379;\">:bar</span>\n<span class=\"keyword\" style=\"color: #E06C75;\">end</span>\n</code></pre>\n"}
end
end

0 comments on commit 3a4da69

Please sign in to comment.