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

Fixed #20 #22

Merged
merged 2 commits into from
May 10, 2024
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,8 @@ Also, to change the header text style for slides with simple [`background`](http
- The source code for another example that uses only `sc-sb-title`: [example_section-title.qmd](example_section-title.qmd) and the live demo of the rendered revealjs slides, [`example_section_title.html`](https://shafayetshafee.github.io/reveal-header/example_section_title.html)

- The source code for example where header text is hidden on the title slide: [example_hide_header_text.qmd](example_hide_header_text.qmd) and the [`rendered output`](https://shafayetshafee.github.io/reveal-header/example_hide_header_text.html)


## Similar Extension

If you find this extension useful, you may also like [`metropolis-beamer`](https://github.com/shafayetShafee/metropolis-beamer/tree/main) extension that provides a custom quarto revealjs format which aims to provide a lookalike [`metropolis beamer theme`] for quarto revealjs.
2 changes: 1 addition & 1 deletion _extensions/reveal-header/_extension.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Reveal-header
author: Shafayet Khan Shafee
version: 1.2.7
version: 1.2.8
quarto-required: ">=1.2.0"
contributes:
filters:
Expand Down
3 changes: 3 additions & 0 deletions _extensions/reveal-header/resources/css/add_header.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
.reveal-header.no-logo .sc-title p {margin-left: 6vw}


.reveal .header-logo svg,
.reveal .header-logo img {
margin: var(--header-margin);
padding-left: 1vw;
Expand All @@ -46,6 +47,8 @@
}




/* .reveal .slides { margin-top: 3vh !important;} */
.inverse-header { color: #c5d7ce !important;}

Expand Down
8 changes: 4 additions & 4 deletions _extensions/reveal-header/resources/js/add_header.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ function header() {
reveal.insertBefore(header, reveal.firstChild);

logo_img = document.querySelector('.header-logo img');
if (logo_img.getAttribute('src') == null) {
if (logo_img?.getAttribute('src') == null) {
if (logo_img?.getAttribute('data-src') != null) {
logo_img.src = logo_img?.getAttribute('data-src') || "";
logo_img.removeAttribute('data-src');
logo_img?.removeAttribute('data-src');
};
};
};
Expand Down Expand Up @@ -86,12 +86,12 @@ function header() {
const footer_logo_link = get_clean_attrs(header_logo, 'data-footer-logo-link');

if (header_logo_link != null) {
const header_logo_img = document.querySelector('div.header-logo img');
const header_logo_img = document.querySelector('div.header-logo').firstElementChild;
linkify_logo(header_logo_img, header_logo_link);
};

if (footer_logo_link != null) {
const footer_logo_img = document.querySelector('img.slide-logo');
const footer_logo_img = document.querySelector('.slide-logo');
footer_logo_img.setAttribute('style', "z-index:99;");
linkify_logo(footer_logo_img, footer_logo_link);
};
Expand Down
2 changes: 1 addition & 1 deletion _extensions/reveal-header/resources/js/sc_sb_title.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

if (Reveal.isReady()) {

if (document.querySelector('div.reveal-header img').getAttribute('src').length == 0) {
if (document.querySelector('div.reveal-header img')?.getAttribute('src')?.length == 0) {
document.querySelector('div.reveal-header').classList.add('no-logo')
}

Expand Down
127 changes: 89 additions & 38 deletions docs/example.html

Large diffs are not rendered by default.

101 changes: 76 additions & 25 deletions docs/example_all.html

Large diffs are not rendered by default.

127 changes: 89 additions & 38 deletions docs/example_hide_header_text.html

Large diffs are not rendered by default.

84 changes: 61 additions & 23 deletions docs/example_section_title.html

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions open_html_files.sh

This file was deleted.

6 changes: 0 additions & 6 deletions test_examples.sh

This file was deleted.

2 changes: 1 addition & 1 deletion testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ case "$argument" in
mv *.html docs/
echo "Opening HTML files from docs folder"
for html_file in docs/*.html; do
start "$html_file"
open "$html_file"
done
;;
"help")
Expand Down