#? stdtmpl(subsChar = '$', metaChar = '#') #import xmltree, strutils, uri #import ../types, ../formatters, ../utils #include "tweet.nimf" # #proc renderProfileCard*(profile: Profile): string =
${genImg(profile.getUserpic("_200x200"))}
${linkUser(profile, class="profile-card-fullname")} ${linkUser(profile, class="profile-card-username")}
#if profile.bio.len > 0:

${linkifyText(profile.bio)}

#end if
#end proc # #proc renderBanner(profile: Profile): string = #if "#" in profile.banner:
#else: #let url = getSigUrl(profile.banner, "pic") ${genImg(profile.banner)} #end if #end proc # #proc renderTimeline*(tweets: Tweets; profile: Profile; beginning: bool): string =
#if profile.protected:

This account's Tweets are protected.

Only confirmed followers have access to @${profile.username}'s Tweets.

#end if #if not beginning:
Load newest tweets
#end if #var retweets: Tweets #for tweet in tweets: #if tweet in retweets: continue #elif tweet.retweetBy.isSome: retweets.add tweet #end if ${renderTweet(tweet, "timeline-tweet")} #end for #if tweets.len > 0:
#let retweet = tweets[^1].retweetId.get("") #let id = if retweet.len > 0: retweet else: tweets[^1].id Load older tweets
#else:

No tweets found.

#end if
#end proc # #proc renderProfile*(profile: Profile; tweets: Tweets; beginning: bool): string =
${renderBanner(profile)}
${renderProfileCard(profile)}
${renderTimeline(tweets, profile, beginning)}
#end proc # #proc renderConversation*(conversation: Conversation): string =
#if conversation.before.len > 0:
#for tweet in conversation.before: ${renderTweet(tweet)} #end for
#end if
${renderTweet(conversation.tweet)}
#if conversation.after.len > 0:
#for tweet in conversation.after: ${renderTweet(tweet)} #end for
#end if
#if conversation.replies.len > 0:
#for thread in conversation.replies:
#for tweet in thread: ${renderTweet(tweet)} #end for
#end for
#end if
#end proc