We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
So that you can also use them on mobile. Should copy what bs4_book() does.
bs4_book()
After implementing can delete:
table a.anchor { position: absolute; } table a.anchor { position: absolute; }
The text was updated successfully, but these errors were encountered:
From bookdown:
tweak_anchors <- function(html) { main <- xml2::xml_find_first(html, ".//main") headings <- xml2::xml_find_all(main, "(.//h1|.//h2|.//h3|.//h4|.//h5|.//h6)") id <- xml2::xml_attr(xml2::xml_find_first(headings, "parent::div"), "id") headings <- headings[!is.na(id)] id <- id[!is.na(id)] anchor <- paste0( "<a class='anchor' aria-label='anchor' href='#", id, "'>", "<i class='fas fa-link'></i>", "</a>" ) for (i in seq_along(id)) { xml2::xml_add_child(headings[[i]], xml2::read_xml(anchor[[i]])) } }
And css
.anchor { font-size: max(0.5em, 1rem); margin-left: 0.5rem; display: none; } h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { display: inline; }
Sorry, something went wrong.
Improved anchors
76c298d
* Consistently add anchors with `tweak_ancohrs()` * Move anchor to right (fixes #1782)
Anchor improvements (#1815)
3d38179
* Consistently add anchors with `tweak_anchors()` * Move anchor to right (fixes #1782) * Ensure that section ids are unique
Successfully merging a pull request may close this issue.
So that you can also use them on mobile. Should copy what
bs4_book()
does.After implementing can delete:
The text was updated successfully, but these errors were encountered: