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

Fix note box and long section names #125

Merged
merged 2 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
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
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