Skip to content

Commit

Permalink
Fix note box and long section names (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhuijzer authored Jun 21, 2021
1 parent 5a0f359 commit 4563b1e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/contents/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,15 @@ For example, for `MCMCChains`,
```jl
@sco(chain)
```

### Note box

To write note boxes, you can use

```
> **_NOTE:_** The note content.
```

> **_NOTE:_** The note content.
This way is fully supported by Pandoc, so it will be correctly converted to outputs such as PDF or DOCX.
9 changes: 8 additions & 1 deletion src/html.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@ function html_page_name(html)
(id=id, text=first(sections).text)
end

html_href(text, link, level) = """<a class="menu-level-$level" href="$link">$text</a>"""
function html_href(text, link, level)
threshold = 33
if threshold < length(text)
shortened = text[1:threshold]
text = shortened * ".."
end
"""<a class="menu-level-$level" href="$link">$text</a>"""
end
html_li(text) = """<li>$text</li>"""

function pandoc_metadata(file=joinpath(GENERATED_DIR, "metadata.yml"))::Dict
Expand Down

0 comments on commit 4563b1e

Please sign in to comment.