Skip to content

Commit

Permalink
Merge pull request #520 from JacquesCarette/gabe
Browse files Browse the repository at this point in the history
Refactor rendPersL.
  • Loading branch information
JacquesCarette authored May 11, 2018
2 parents e82da48 + ad1cf0b commit 4a1c4f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
10 changes: 3 additions & 7 deletions code/Language/Drasil/HTML/Print.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import qualified Language.Drasil.Symbol as S
import qualified Language.Drasil.Document as L
import Language.Drasil.HTML.Monad
import Language.Drasil.People (People,Person(..),rendPersLFM',rendPersLFM'',
Conv(..),nameStr,rendPersLFM, dotInitial, nameSep)
Conv(..),nameStr,rendPersLFM)
import Language.Drasil.Config (StyleGuide(..), bibStyleH)
import Language.Drasil.ChunkDB(HasSymbolTable)

Expand Down Expand Up @@ -454,12 +454,8 @@ rendPers = rendPersLFM

-- To render the last person's name
rendPersL :: Person -> String
rendPersL (Person {_surname = n, _convention = Mono}) = n
rendPersL (Person {_given = f, _surname = l, _middle = []}) =
dotInitial l ++ ", " ++ dotInitial f
rendPersL (Person {_given = f, _surname = l, _middle = ms}) =
dotInitial l ++ ", " ++ foldr1 nameSep (
dotInitial f : map dotInitial (init ms) ++ [last ms])
rendPersL =
(\n -> (if not (null n) && last n == '.' then init else id) n) . rendPers

--adds an 's' if there is more than one person in a list
toPlural :: People -> String -> String
Expand Down
4 changes: 2 additions & 2 deletions code/Language/Drasil/People.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module Language.Drasil.People
, HasName
, name, manyNames, nameStr
, Conv(..) --This is needed to unwrap names for the bibliography
, lstName, initial, dotInitial
, rendPersLFM, rendPersLFM', rendPersLFM'', nameSep
, lstName
, rendPersLFM, rendPersLFM', rendPersLFM''
) where

-- | A person can have a given name, middle name(s), and surname, as well
Expand Down
2 changes: 1 addition & 1 deletion code/stable/ssp/SSP_SRS.html
Original file line number Diff line number Diff line change
Expand Up @@ -4532,7 +4532,7 @@ <h1>
</a>
<a id="fredlund1977">
<ul>
[2]: Fredlund, D. G. and Krahn, J.. "Comparison of slope stability methods of analysis." <em>Canadian Geotechnical Journal</em>, vol. 14, no. 3, April, 1977. pp. 429&ndash;439. Print.
[2]: Fredlund, D. G. and Krahn, J. "Comparison of slope stability methods of analysis." <em>Canadian Geotechnical Journal</em>, vol. 14, no. 3, April, 1977. pp. 429&ndash;439. Print.
</ul>
</a>
<a id="koothoor2013">
Expand Down

0 comments on commit 4a1c4f8

Please sign in to comment.