Skip to content

Commit

Permalink
deploy: 9494819
Browse files Browse the repository at this point in the history
  • Loading branch information
MR-Addict committed Jan 15, 2024
1 parent 18faada commit 2970ef5
Show file tree
Hide file tree
Showing 18 changed files with 238 additions and 238 deletions.
20 changes: 10 additions & 10 deletions global-configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h1 class="menu-title">Mdbook Embedify</h1>
<a href="https://github.com/mr-addict/mdbook-embedify" title="Git repository" aria-label="Git repository">
<i id="git-repository-button" class="fa fa-github"></i>
</a>
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/src/global-configuration.md" title="Suggest an edit" aria-label="Suggest an edit">
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/example/src/global-configuration.md" title="Suggest an edit" aria-label="Suggest an edit">
<i id="git-edit-button" class="fa fa-edit"></i>
</a>

Expand Down Expand Up @@ -199,8 +199,8 @@ <h1 id="global-configuration"><a class="header" href="#global-configuration">Glo
scroll-to-top.enable = true

announcement-banner.enable = true
announcement-banner.name = &quot;0.2.2&quot;
announcement-banner.style = &quot;default&quot;
announcement-banner.id = &quot;0.2.2&quot;
announcement-banner.theme = &quot;default&quot;
announcement-banner.message = &quot;*Version **0.2.2** now has relased, check it out [here](https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.2).*&quot;
</code></pre>
<p>You can see more details about each app at its own page.</p>
Expand Down Expand Up @@ -277,17 +277,17 @@ <h1 id="global-configuration"><a class="header" href="#global-configuration">Glo
--site-announcement-bar-stripe-color2: #d1d5db;
}

.announcement-banner[data-style="ocean"] {
.announcement-banner[data-theme="ocean"] {
--site-announcement-bar-stripe-color1: #86b2f9;
--site-announcement-bar-stripe-color2: #7298ea;
}

.announcement-banner[data-style="forest"] {
.announcement-banner[data-theme="forest"] {
--site-announcement-bar-stripe-color1: #97f5d6;
--site-announcement-bar-stripe-color2: #6de0bf;
}

.announcement-banner[data-style="lava"] {
.announcement-banner[data-theme="lava"] {
--site-announcement-bar-stripe-color1: #fea3a3;
--site-announcement-bar-stripe-color2: #e57e7e;
}
Expand Down Expand Up @@ -316,17 +316,17 @@ <h1 id="global-configuration"><a class="header" href="#global-configuration">Glo
background-color: transparent;
}
</style>
<div class="announcement-banner" data-style="default" data-name="0.2.2">
<div class="announcement-banner" data-theme="default" data-id="0.2.2">
<p><em>Version <strong>0.2.2</strong> now has relased, check it out <a href="https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.2">here</a>.</em></p>
<button type="button">X</button>
</div>
<script>
const banner = document.querySelector(".announcement-banner");
const name = banner.getAttribute("data-name");
const id = banner.getAttribute("data-id");
const message = banner.querySelector("p").textContent;
const localData = JSON.parse(localStorage.getItem("mdbook-announcement-banner"));

if (localData && localData.hide === true && localData.name === name) banner.remove();
if (localData && localData.hide === true && localData.id === id) banner.remove();
else {
// move banner before page class element slibling
const page = document.querySelector(".page");
Expand All @@ -335,7 +335,7 @@ <h1 id="global-configuration"><a class="header" href="#global-configuration">Glo
// add event listener to close button
banner.querySelector("button").addEventListener("click", () => {
banner.remove();
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ name, hide: true, message }));
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ id, hide: true, message }));
});
}
</script>
Expand Down
18 changes: 9 additions & 9 deletions ignore-embeds.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h1 class="menu-title">Mdbook Embedify</h1>
<a href="https://github.com/mr-addict/mdbook-embedify" title="Git repository" aria-label="Git repository">
<i id="git-repository-button" class="fa fa-github"></i>
</a>
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/src/ignore-embeds.md" title="Suggest an edit" aria-label="Suggest an edit">
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/example/src/ignore-embeds.md" title="Suggest an edit" aria-label="Suggest an edit">
<i id="git-edit-button" class="fa fa-edit"></i>
</a>

Expand Down Expand Up @@ -183,7 +183,7 @@ <h1 class="menu-title">Mdbook Embedify</h1>
<div id="content" class="content">
<main>
<h1 id="ignore-embeds"><a class="header" href="#ignore-embeds">Ignore Embeds</a></h1>
<p>Sometimes you may want preprocessors to ignore some embeds.</p>
<p>Sometimes you may want preprocessor to ignore some embeds.</p>
<p>You can do it by wrapping content that you want to ignore with below two comments:</p>
<ul>
<li><code>&lt;!-- embed ignore begin --&gt;</code></li>
Expand Down Expand Up @@ -270,17 +270,17 @@ <h1 id="ignore-embeds"><a class="header" href="#ignore-embeds">Ignore Embeds</a>
--site-announcement-bar-stripe-color2: #d1d5db;
}

.announcement-banner[data-style="ocean"] {
.announcement-banner[data-theme="ocean"] {
--site-announcement-bar-stripe-color1: #86b2f9;
--site-announcement-bar-stripe-color2: #7298ea;
}

.announcement-banner[data-style="forest"] {
.announcement-banner[data-theme="forest"] {
--site-announcement-bar-stripe-color1: #97f5d6;
--site-announcement-bar-stripe-color2: #6de0bf;
}

.announcement-banner[data-style="lava"] {
.announcement-banner[data-theme="lava"] {
--site-announcement-bar-stripe-color1: #fea3a3;
--site-announcement-bar-stripe-color2: #e57e7e;
}
Expand Down Expand Up @@ -309,17 +309,17 @@ <h1 id="ignore-embeds"><a class="header" href="#ignore-embeds">Ignore Embeds</a>
background-color: transparent;
}
</style>
<div class="announcement-banner" data-style="default" data-name="0.2.2">
<div class="announcement-banner" data-theme="default" data-id="0.2.2">
<p><em>Version <strong>0.2.2</strong> now has relased, check it out <a href="https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.2">here</a>.</em></p>
<button type="button">X</button>
</div>
<script>
const banner = document.querySelector(".announcement-banner");
const name = banner.getAttribute("data-name");
const id = banner.getAttribute("data-id");
const message = banner.querySelector("p").textContent;
const localData = JSON.parse(localStorage.getItem("mdbook-announcement-banner"));

if (localData && localData.hide === true && localData.name === name) banner.remove();
if (localData && localData.hide === true && localData.id === id) banner.remove();
else {
// move banner before page class element slibling
const page = document.querySelector(".page");
Expand All @@ -328,7 +328,7 @@ <h1 id="ignore-embeds"><a class="header" href="#ignore-embeds">Ignore Embeds</a>
// add event listener to close button
banner.querySelector("button").addEventListener("click", () => {
banner.remove();
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ name, hide: true, message }));
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ id, hide: true, message }));
});
}
</script>
Expand Down
16 changes: 8 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h1 class="menu-title">Mdbook Embedify</h1>
<a href="https://github.com/mr-addict/mdbook-embedify" title="Git repository" aria-label="Git repository">
<i id="git-repository-button" class="fa fa-github"></i>
</a>
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/src/intro.md" title="Suggest an edit" aria-label="Suggest an edit">
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/example/src/intro.md" title="Suggest an edit" aria-label="Suggest an edit">
<i id="git-edit-button" class="fa fa-edit"></i>
</a>

Expand Down Expand Up @@ -258,17 +258,17 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
--site-announcement-bar-stripe-color2: #d1d5db;
}

.announcement-banner[data-style="ocean"] {
.announcement-banner[data-theme="ocean"] {
--site-announcement-bar-stripe-color1: #86b2f9;
--site-announcement-bar-stripe-color2: #7298ea;
}

.announcement-banner[data-style="forest"] {
.announcement-banner[data-theme="forest"] {
--site-announcement-bar-stripe-color1: #97f5d6;
--site-announcement-bar-stripe-color2: #6de0bf;
}

.announcement-banner[data-style="lava"] {
.announcement-banner[data-theme="lava"] {
--site-announcement-bar-stripe-color1: #fea3a3;
--site-announcement-bar-stripe-color2: #e57e7e;
}
Expand Down Expand Up @@ -297,17 +297,17 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
background-color: transparent;
}
</style>
<div class="announcement-banner" data-style="default" data-name="0.2.2">
<div class="announcement-banner" data-theme="default" data-id="0.2.2">
<p><em>Version <strong>0.2.2</strong> now has relased, check it out <a href="https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.2">here</a>.</em></p>
<button type="button">X</button>
</div>
<script>
const banner = document.querySelector(".announcement-banner");
const name = banner.getAttribute("data-name");
const id = banner.getAttribute("data-id");
const message = banner.querySelector("p").textContent;
const localData = JSON.parse(localStorage.getItem("mdbook-announcement-banner"));

if (localData && localData.hide === true && localData.name === name) banner.remove();
if (localData && localData.hide === true && localData.id === id) banner.remove();
else {
// move banner before page class element slibling
const page = document.querySelector(".page");
Expand All @@ -316,7 +316,7 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
// add event listener to close button
banner.querySelector("button").addEventListener("click", () => {
banner.remove();
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ name, hide: true, message }));
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ id, hide: true, message }));
});
}
</script>
Expand Down
16 changes: 8 additions & 8 deletions intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h1 class="menu-title">Mdbook Embedify</h1>
<a href="https://github.com/mr-addict/mdbook-embedify" title="Git repository" aria-label="Git repository">
<i id="git-repository-button" class="fa fa-github"></i>
</a>
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/src/intro.md" title="Suggest an edit" aria-label="Suggest an edit">
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/example/src/intro.md" title="Suggest an edit" aria-label="Suggest an edit">
<i id="git-edit-button" class="fa fa-edit"></i>
</a>

Expand Down Expand Up @@ -258,17 +258,17 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
--site-announcement-bar-stripe-color2: #d1d5db;
}

.announcement-banner[data-style="ocean"] {
.announcement-banner[data-theme="ocean"] {
--site-announcement-bar-stripe-color1: #86b2f9;
--site-announcement-bar-stripe-color2: #7298ea;
}

.announcement-banner[data-style="forest"] {
.announcement-banner[data-theme="forest"] {
--site-announcement-bar-stripe-color1: #97f5d6;
--site-announcement-bar-stripe-color2: #6de0bf;
}

.announcement-banner[data-style="lava"] {
.announcement-banner[data-theme="lava"] {
--site-announcement-bar-stripe-color1: #fea3a3;
--site-announcement-bar-stripe-color2: #e57e7e;
}
Expand Down Expand Up @@ -297,17 +297,17 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
background-color: transparent;
}
</style>
<div class="announcement-banner" data-style="default" data-name="0.2.2">
<div class="announcement-banner" data-theme="default" data-id="0.2.2">
<p><em>Version <strong>0.2.2</strong> now has relased, check it out <a href="https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.2">here</a>.</em></p>
<button type="button">X</button>
</div>
<script>
const banner = document.querySelector(".announcement-banner");
const name = banner.getAttribute("data-name");
const id = banner.getAttribute("data-id");
const message = banner.querySelector("p").textContent;
const localData = JSON.parse(localStorage.getItem("mdbook-announcement-banner"));

if (localData && localData.hide === true && localData.name === name) banner.remove();
if (localData && localData.hide === true && localData.id === id) banner.remove();
else {
// move banner before page class element slibling
const page = document.querySelector(".page");
Expand All @@ -316,7 +316,7 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
// add event listener to close button
banner.querySelector("button").addEventListener("click", () => {
banner.remove();
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ name, hide: true, message }));
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ id, hide: true, message }));
});
}
</script>
Expand Down
28 changes: 14 additions & 14 deletions local/announcement-banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h1 class="menu-title">Mdbook Embedify</h1>
<a href="https://github.com/mr-addict/mdbook-embedify" title="Git repository" aria-label="Git repository">
<i id="git-repository-button" class="fa fa-github"></i>
</a>
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/src/local/announcement-banner.md" title="Suggest an edit" aria-label="Suggest an edit">
<a href="https://github.com/mr-addict/mdbook-embedify/edit/main/example/src/local/announcement-banner.md" title="Suggest an edit" aria-label="Suggest an edit">
<i id="git-edit-button" class="fa fa-edit"></i>
</a>

Expand Down Expand Up @@ -184,25 +184,25 @@ <h1 class="menu-title">Mdbook Embedify</h1>
<main>
<h2 id="options"><a class="header" href="#options">Options</a></h2>
<div class="table-wrapper"><table><thead><tr><th style="text-align: left">Option</th><th style="text-align: left">Description</th><th style="text-align: left">Required</th><th style="text-align: left">Default</th></tr></thead><tbody>
<tr><td style="text-align: left">name</td><td style="text-align: left">Announcement name</td><td style="text-align: left">Yes</td><td style="text-align: left">- -</td></tr>
<tr><td style="text-align: left">id</td><td style="text-align: left">Announcement id</td><td style="text-align: left">Yes</td><td style="text-align: left">- -</td></tr>
<tr><td style="text-align: left">message</td><td style="text-align: left">Announcement message, supports markdown syntax</td><td style="text-align: left">Yes</td><td style="text-align: left">- -</td></tr>
<tr><td style="text-align: left">style</td><td style="text-align: left">Supports style: <strong>default</strong>, <strong>ocean</strong>, <strong>forest</strong>, <strong>lava</strong></td><td style="text-align: left">No</td><td style="text-align: left">default</td></tr>
<tr><td style="text-align: left">theme</td><td style="text-align: left">Supports theme: <strong>default</strong>, <strong>ocean</strong>, <strong>forest</strong>, <strong>lava</strong></td><td style="text-align: left">No</td><td style="text-align: left">default</td></tr>
</tbody></table>
</div>
<h2 id="example"><a class="header" href="#example">Example</a></h2>
<!-- embed ignore begin -->
<pre><code class="language-text">{% embed announcement-banner name=&quot;0.2.2&quot; style=&quot;default&quot; message=&quot;*Version **0.2.2** now has relased, check it out [here](https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.2).*&quot; %}
<pre><code class="language-text">{% embed announcement-banner id=&quot;0.2.2&quot; theme=&quot;default&quot; message=&quot;*Version **0.2.2** now has relased, check it out [here](https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.2).*&quot; %}
</code></pre>
<!-- embed ignore end -->
<p>This book’s announcement banner is enabled, you can see it at the top of this page.</p>
<p>However, you may want to enable it for the whole book. You can do this by adding below options to <code>book.toml</code> file:</p>
<pre><code class="language-toml">[preprocessor.embedify]
announcement-banner.enable = true
announcement-banner.name = &quot;0.2.2&quot;
announcement-banner.style = &quot;default&quot;
announcement-banner.id = &quot;0.2.2&quot;
announcement-banner.theme = &quot;default&quot;
announcement-banner.message = &quot;*Version **0.2.2** now has relased, check it out [here](https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.2).*&quot;
</code></pre>
<p>Note that announcement banner name must be <strong>unique</strong>, otherwise it won’t be shown if there is another announcement banner with the same name when user closed it.</p>
<p>Note that announcement banner id must be <strong>unique</strong>, otherwise it won’t be shown if there is another announcement banner with the same id when user closed it.</p>
<style>
.scroll-to-top {
display: flex;
Expand Down Expand Up @@ -276,17 +276,17 @@ <h2 id="example"><a class="header" href="#example">Example</a></h2>
--site-announcement-bar-stripe-color2: #d1d5db;
}

.announcement-banner[data-style="ocean"] {
.announcement-banner[data-theme="ocean"] {
--site-announcement-bar-stripe-color1: #86b2f9;
--site-announcement-bar-stripe-color2: #7298ea;
}

.announcement-banner[data-style="forest"] {
.announcement-banner[data-theme="forest"] {
--site-announcement-bar-stripe-color1: #97f5d6;
--site-announcement-bar-stripe-color2: #6de0bf;
}

.announcement-banner[data-style="lava"] {
.announcement-banner[data-theme="lava"] {
--site-announcement-bar-stripe-color1: #fea3a3;
--site-announcement-bar-stripe-color2: #e57e7e;
}
Expand Down Expand Up @@ -315,17 +315,17 @@ <h2 id="example"><a class="header" href="#example">Example</a></h2>
background-color: transparent;
}
</style>
<div class="announcement-banner" data-style="default" data-name="0.2.2">
<div class="announcement-banner" data-theme="default" data-id="0.2.2">
<p><em>Version <strong>0.2.2</strong> now has relased, check it out <a href="https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.2">here</a>.</em></p>
<button type="button">X</button>
</div>
<script>
const banner = document.querySelector(".announcement-banner");
const name = banner.getAttribute("data-name");
const id = banner.getAttribute("data-id");
const message = banner.querySelector("p").textContent;
const localData = JSON.parse(localStorage.getItem("mdbook-announcement-banner"));

if (localData && localData.hide === true && localData.name === name) banner.remove();
if (localData && localData.hide === true && localData.id === id) banner.remove();
else {
// move banner before page class element slibling
const page = document.querySelector(".page");
Expand All @@ -334,7 +334,7 @@ <h2 id="example"><a class="header" href="#example">Example</a></h2>
// add event listener to close button
banner.querySelector("button").addEventListener("click", () => {
banner.remove();
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ name, hide: true, message }));
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ id, hide: true, message }));
});
}
</script>
Expand Down
Loading

0 comments on commit 2970ef5

Please sign in to comment.