fixing minor issues seen with mix credo

This commit is contained in:
Adam Piontek 2021-04-06 18:39:31 -04:00
parent e2fd00f043
commit 10fbc6732b
4 changed files with 14 additions and 1 deletions

View file

@ -1,4 +1,7 @@
defmodule Home73k.Blog do
@moduledoc """
Blog content loading & data access functions.
"""
import Home73k, only: [app_blog_content: 0]
alias Home73k.Blog.Post

View file

@ -1,4 +1,7 @@
defmodule Home73k.Blog.Post do
@moduledoc """
Blog Post struct definition and content parsing functions.
"""
alias Home73k.Highlighter
@enforce_keys [:title, :id, :date, :author, :tags, :lede, :body, :corpus]
@ -76,7 +79,7 @@ defmodule Home73k.Blog.Post do
# grab text only, rejecting HTML
# downcase & scrub line breaks, slashes
corpus =
(tags ++ [title, (lede && lede) || " ", body])
(tags ++ [title, lede || " ", body])
|> Enum.join(" ")
|> Floki.parse_fragment!()
|> Floki.text()

View file

@ -1,4 +1,7 @@
defmodule Home73kWeb.BlogLive do
@moduledoc """
LiveView engine for Blog navigation
"""
use Home73kWeb, :live_view
alias Home73k.Blog

View file

@ -1,4 +1,8 @@
defmodule Home73kWeb.LiveHelpers do
@moduledoc """
Functions to make working with Phoenix LiveView a little easier.
"""
@doc """
Performs the {:noreply, socket} for a given socket.
This helps make the noreply pipeable