Is admonition available in Franklin.jl?

I found that in Franklin’s website:

I wonder how I can do this.

I think is written as is on Julia Markdown

!!! Note
    Whatever you want to write on that.

Thank you for your reply.
I tried it, but it seemed not to work in Minimal Mistakes theme in Franklin.jl.
May this possibly be due to CSS in the theme? I’m gonna try to what you suggest in another theme.

I really haven’t used Franklin, but may be useful for you to check this page.

I tried to insert the following lines in the “basic” template of franklin.jl

!!! note
    this is a note!

Then, I got:


Seemingly, admonition does not work :frowning:

Judging from the source of the docs, seems the incantation is

\note{Text you want to show up in the note}

I believe this is done via a combination of custom commands and div classes to create CSS stylable div objects in the DOM with a given name. The style will probably depend on your theme (and if it supports that command in its style sheets).

2 Likes

That’s correct, so the full story is:

  1. In your config.md you can define a note command like so:
\newcommand{\note}[1]{@@note @@title ⚠ Note@@ @@content #1 @@ @@}
  1. You can use it on a page as @Sukera mentioned so \note{You could have ...}
  2. the @@ things indicate div blocks, so the correspondingHTML will be
<div class="note">
  <div class="title">⚠ Note</div>
  <div class="content">You could have...</div>
</div> 

To style this you have to specify the style of .note, .note .title and .note .content so for instance in the docs this is what is used:

.note {
  margin-top: 1.5em;
  width: 95%;
  margin-left:auto;
  margin-right:auto;
  background-color:  aliceblue;
  border-radius: 5px;
  margin-bottom: 1em;
}
.note .content {
  padding: 10px;
  padding-left: 12px;
}
.note .title{
  font-size: 105%;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  padding-left: 7px;
  padding-top: 2px;
  color: white;
  background: cornflowerblue;
}
5 Likes

It works perfectly :slight_smile: Thanks !
image

2 Likes