-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Searchbar and Index, Fancy Codeblock, Latex Support (#44)
* Update README.md * Delete .github/workflows/docs.yml * old shortcodes, update info, first pass of code SCSS and clipboarding * Get nodes and code clipboards working * gif shortcode improvement with width * Add dim. options for newtab shortcode * Enable clipboard code blocks by default * Update README * inline code highlighting, comments * Make LaTex a config option partial * Update README * Initial working search bar support * Better searchbar styling * Refine search styling, search index file path resolution * Update demo pages, update README * fix: graceful search index path resolution, downsize screenshot * Youtube and audio shortcodes, search on /, blockquote styling * Add custom 404 page * Blockquote bg, toggle theme JS code for later * Override index title for pages * Update theme.toml * Update blockquote styling * Revert to original author's README, config, and theme files with additions * Add back deleted docs workflow * Update README instruction for codeblocks
- Loading branch information
Showing
29 changed files
with
1,436 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
+++ | ||
title = "Code Example" | ||
date = 2017-09-24 | ||
|
||
[taxonomies] | ||
categories = ["demo"] | ||
tags = ["code", "example"] | ||
+++ | ||
|
||
Have code snippets complete with **clipboard functionality** and **fancy | ||
language tags**. No more boring code snippets in your pages. Oh yeah baby! Click | ||
on this article to see some code in action. | ||
|
||
<!-- more --> | ||
|
||
```rust | ||
|
||
fn main() { | ||
println!("Hello, world!"); | ||
} | ||
``` | ||
|
||
This is a code block with syntax highlighting. It's pretty cool, right? | ||
|
||
```python | ||
|
||
def main(): | ||
print("Hello, world!") | ||
``` | ||
|
||
This is another code block with syntax highlighting. It's pretty cool, right? | ||
|
||
<!-- prettier-ignore--> | ||
```js | ||
|
||
function debounce(func, wait) { | ||
var timeout; | ||
|
||
return function () { | ||
var context = this; | ||
var args = arguments; | ||
clearTimeout(timeout); | ||
|
||
timeout = setTimeout(function () { | ||
timeout = null; | ||
func.apply(context, args); | ||
}, wait); | ||
}; | ||
} | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
+++ | ||
title = "LaTeX Example" | ||
date = 2017-09-24 | ||
|
||
[taxonomies] | ||
categories = ["demo"] | ||
tags = ["latex", "example"] | ||
+++ | ||
|
||
This theme allows you to use MathJax directly in your Markdown! Click on this | ||
article to see some fancy math in action. Little teaser: | ||
$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $ | ||
|
||
<!-- more --> | ||
|
||
Some fancy math thingy: | ||
|
||
$$ | ||
\begin{align*} | ||
\frac{d}{dx} \left( \int_{0}^{x} f(u) \, du \right) &= f(x) \\ | ||
\frac{d}{dx} \left( \int_{g(x)}^{h(x)} f(u) \, du \right) &= f(h(x))h'(x) - f(g(x))g'(x) | ||
\end{align*} | ||
$$ | ||
|
||
Isn't that cool?! | ||
|
||
--- | ||
|
||
## Another cool thingy | ||
|
||
We will prove this statement by induction on $h$. | ||
|
||
### Base Case: $h = 0$ | ||
|
||
The AVL tree of height 0 has no nodes, so $N_0 = 0$. The Fibonacci number $F_{0+2} = F_2 = 1$. Therefore, | ||
|
||
$$ | ||
N_0 = 0 \geq F_2 - 1 = 1 - 1 = 0 | ||
$$ | ||
|
||
which holds true. | ||
|
||
### Base Case: $h = 1$ | ||
|
||
The AVL tree of height 1 has one node, so $N_1 = 1$. The Fibonacci number $F_{1+2} = F_3 = 2$. Therefore, | ||
|
||
$$ | ||
N_1 = 1 \geq F_3 - 1 = 2 - 1 = 1 | ||
$$ | ||
|
||
which holds true. | ||
|
||
### Inductive Step: | ||
|
||
Assume the claim holds true for $h = k$. That is, | ||
|
||
$$ | ||
N_{k} \geq F_{k+2} - 1 \tag{I.H.} | ||
$$ | ||
|
||
For $h = k+1$, we know: | ||
|
||
$$ | ||
N_{k+1} = N_{k} + N_{k-1} + 1 \tag{def. of $N_h$} | ||
$$ | ||
|
||
From the inductive hypothesis, $N_{k} \geq F_{k+2} - 1$ and $N_{k-1} \geq F_{k+1} - 1$. Substituting: | ||
|
||
$$ | ||
N_{k+1} = N_{k} + N_{k - 1} + 1 \geq (F_{k+2} - 1) + (F_{k+1} - 1) + 1 | ||
$$ | ||
|
||
Thus, we get: | ||
|
||
$$ | ||
N_{k+1} \geq F_{k+2} + F_{k+1} - 1 | ||
$$ | ||
|
||
By the definition of Fibonacci numbers: | ||
|
||
$$ | ||
N_{k+1} \geq F_{k+3} - 1 \tag{def. of Fibonacci} | ||
$$ | ||
|
||
By the principle of mathematical induction, the statement holds for all $h \geq 0$. |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
+++ | ||
title = "Shortcodes Demos" | ||
date = 2017-09-24 | ||
|
||
[taxonomies] | ||
categories = ["demo"] | ||
tags = ["gif", "fancy"] | ||
+++ | ||
|
||
"after-dark" comes with some handy shortcodes to make your life easier and | ||
your posts more exciting. | ||
|
||
<!-- more --> | ||
|
||
Here are some examples: | ||
|
||
# GIF-Suport | ||
|
||
Level up your posts with GIFs! | ||
|
||
{{ gif(sources=["assets/video.mp4"], width=50)}} | ||
|
||
# Fancy Notes | ||
|
||
{{ note(body=" | ||
**Note:** Some really insightful note here. | ||
|
||
$$ \sum\_{i=1}^{n} i = \frac{n(n+1)}{2} $$ | ||
")}} | ||
|
||
# YouTube Video Embedding | ||
|
||
{{ youtube(id="ym3y13nA3ew", width=80) }} | ||
|
||
# Audio File Embedding | ||
|
||
{{ audio(source="assets/audio.mp3")}} | ||
|
||
> If you're still falling for this, I don't know what to tell you. |
Oops, something went wrong.