Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add A Nice Blockquote Function #24

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions src/computational_thinking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export not_defined # deprecated
export type_isa, type_eq
export code_for_check_type_funcs
export TODO, nbsp
export blockquote
export display_msg_if_fail

"Hint box with arguement as text."
Expand Down Expand Up @@ -203,3 +204,84 @@ function display_msg_if_fail(x; msg_pass = nothing)
end
end


"""
Displays a nice blockquote. Useful for including quotes by well known figures or useful nuggets of wisdom.
"""
function blockquote(text,author="")
@htl("""

<div class="nice-blockquote nice-blockquote__bordered nice-blockquote--quoted">
<p class="nice-blockquote__text">
$text
<p>
<div class="nice-blockquote__text nice-blockquote__text--author">
$author
</div>
</div>



<style>

.nice-blockquote{
margin: 10px 30px;
padding: 25px;
background: light grey;
border: 0.5px solid #ccc;
color: black;
box-sizing:border-box;
}

.nice-blockquote__bordered{
border-left-width: 14px;
}

.nice-blockquote--quoted::before{
content:open-quote;
font-size:70px;
font-family: Arial;
font-weight:bold;
color:#ccc;
display:block;
margin-top:-20px;
margin-bottom:-40px;
font-family: Arial;
}

.nice-blockquote__text{
font-family: Arial;
font-style: italic;
fontsize: 1.5em;
margin:0;
line height: 1.5;
text-align:left;
}

.nice-blockquote__text:not(:last_child){
margin-bottom:10px;
}

.nice-blockquote__text--author{
font-weight:bold;
font-style: normal;
text-align:right;
fontsize: 2em;
}

.nice-blockquote__text--author::before{
content:close-quote;
font-size:70px;
font-family: Arial;
font-weight:bold;
color:#ccc;
display:block;
margin-top:-40px;
margin-bottom:-40px;

}


</style>
""")
end