Skip to content

Commit

Permalink
fix presentation title
Browse files Browse the repository at this point in the history
add print button that prints the page as presentation
  • Loading branch information
guFalcon committed Jan 15, 2025
1 parent 86dd576 commit be2d0d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion obsidian-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ function toggleTopdownMenu() {
}

function openAsPresentation() {
const url = new URL(window.location.href);
let url = new URL(window.location.href);
if (print) {
url.searchParams.set("print-pdf", "true")
}
url.searchParams.set("reveal", "true");
window.open(url, "_blank");
}
Expand Down
9 changes: 6 additions & 3 deletions obsidian.js
Original file line number Diff line number Diff line change
Expand Up @@ -1018,9 +1018,12 @@ async function getTopBar(startPage, req) {
</div>`
: ""
}
<button class="sl-button" style="height: 32px; margin: 6px;" onclick="openAsPresentation()">${lucideIcon(
<button class="sl-button" style="height: 32px; margin: 6px;" onclick="openAsPresentation(false)">${lucideIcon(
"Presentation"
)}</button>
<button class="sl-button" style="height: 32px; margin: 6px;" onclick="openAsPresentation(true)">${lucideIcon(
"Printer"
)}</button>
<button class="sl-button-accent topdown-menu-chevron" style="height: 32px; margin: 6px;" onclick="toggleTopdownMenu()">${lucideIcon(
"Settings"
)}</button>
Expand Down Expand Up @@ -1088,7 +1091,7 @@ export async function wrapInPage(html, startPage, req) {
return pre + html + post;
}

export async function wrapInReveal(reveal) {
export async function wrapInReveal(reveal, req) {
const pre = `
<!DOCTYPE html>
<html>
Expand All @@ -1097,7 +1100,7 @@ export async function wrapInReveal(reveal) {
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Sample RevealJS with CDN</title>
<title>${req.file.name}</title>
<link href='https://fonts.googleapis.com/css?family=Lato:300,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/reveal.css">
Expand Down

0 comments on commit be2d0d8

Please sign in to comment.