<commit_before># Brando Portfolio

[![Coverage Status](https://coveralls.io/repos/github/twined/brando_portfolio/badge.svg?branch=master)](https://coveralls.io/github/twined/brando_portfolio?branch=master)

## Installation

Add brando_portfolio to your list of dependencies in `mix.exs`:

```diff
    def deps do
      [
        {:brando, github: "twined/brando"},
+       {:brando_portfolio, github: "twined/brando_portfolio"}
      ]
    end
```

Install migrations and frontend files:

    $ mix brando.portfolio.install

Run migrations

    $ mix ecto.migrate

Add to your `web/router.ex`:

```diff

    defmodule MyApp.Router do
      use MyApp.Web, :router
      # ...
+     import Brando.Portfolio.Routes.Admin

      scope "/admin", as: :admin do
        pipe_through :admin
        dashboard_routes   "/"
        user_routes        "/users"
+       portfolio_routes   "/portfolio"
      end
    end
```

Add to your `lib/my_app.ex`:

```diff
    def start(_type, _args) do
      import Supervisor.Spec, warn: false

      children = [
        # Start the endpoint when the application starts
        supervisor(MyApp.Endpoint, []),
        # Start the Ecto repository
        supervisor(MyApp.Repo, []),
        # Here you could define other workers and supervisors as children
        # worker(MyApp.Worker, [arg1, arg2, arg3]),
      ]

+     Brando.Registry.register(Brando.Portfolio)
```

Add to your `web/static/css/app.scss`:

```diff
  @import
    "includes/colorbox",
    "includes/cookielaw",
    "includes/dropdown",
    "includes/instagram",
-   "includes/nav";
+   "includes/nav",
+   "includes/portfolio";
```

Add to your `web/static/css/custom/brando.custom.scss`

```diff
+ @import
+   "includes/portfolio"
```

## Default image series Villain data

Add to your otp_app's `config.exs`:

    config :brando_portfolio,
      default_image_series_data: ~s([{"type":"markdown","data":{"text":"Default description"}}]),

## Callbacks

To register callbacks from your otp_app, add to your otp_app's `config.exs`

    config :brando_portfolio,
      callbacks: %{image_series: %{on_delete: {MyApp.FrontpageSerie, :delete_dependent}}}

This will call `MyApp.FrontpageSerie.delete_dependent` with the record to be deleted
as argument.<commit_msg>Fix typos<commit_after># Brando Portfolio

[![Coverage Status](https://coveralls.io/repos/github/twined/brando_portfolio/badge.svg?branch=master)](https://coveralls.io/github/twined/brando_portfolio?branch=master)

## Installation

Add brando_portfolio to your list of dependencies in `mix.exs`:

```diff
    def deps do
      [
        {:brando, github: "twined/brando"},
+       {:brando_portfolio, github: "twined/brando_portfolio"}
      ]
    end
```

Install migrations and frontend files:

    $ mix brando_portfolio.install

Run migrations

    $ mix ecto.migrate

Add to your `web/router.ex`:

```diff

    defmodule MyApp.Router do
      use MyApp.Web, :router
      # ...
+     import Brando.Portfolio.Routes.Admin

      scope "/admin", as: :admin do
        pipe_through :admin
        dashboard_routes   "/"
        user_routes        "/users"
+       portfolio_routes   "/portfolio"
      end
    end
```

Add to your `lib/my_app.ex`:

```diff
    def start(_type, _args) do
      import Supervisor.Spec, warn: false

      children = [
        # Start the endpoint when the application starts
        supervisor(MyApp.Endpoint, []),
        # Start the Ecto repository
        supervisor(MyApp.Repo, []),
        # Here you could define other workers and supervisors as children
        # worker(MyApp.Worker, [arg1, arg2, arg3]),
      ]

+     Brando.Registry.register(Brando.Portfolio)
```

Add to your `web/static/css/app.scss`:

```diff
  @import
    "includes/colorbox",
    "includes/cookielaw",
    "includes/dropdown",
    "includes/instagram",
-   "includes/nav";
+   "includes/nav",
+   "includes/portfolio";
```

Add to your `web/static/css/custom/brando.custom.scss`

```diff
+ @import
+   "includes/portfolio";
```

## Default image series Villain data

Add to your otp_app's `config.exs`:

    config :brando_portfolio,
      default_image_series_data: ~s([{"type":"markdown","data":{"text":"Default description"}}])

## Callbacks

To register callbacks from your otp_app, add to your otp_app's `config.exs`

    config :brando_portfolio,
      callbacks: %{image_series: %{on_delete: {MyApp.FrontpageSerie, :delete_dependent}}}

This will call `MyApp.FrontpageSerie.delete_dependent` with the record to be deleted
as argument.
{'fraction_non_alphanumeric': 0.12898230088495574, 'fraction_numerical': 0.001327433628318584, 'mean_word_length': 3.1899907321594068, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1706741', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1471, 'n_words': 344}