Skip to content

Commit

Permalink
Major Refactor and Codebase Reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhRowjee committed Dec 30, 2022
1 parent 613f2bf commit bd03832
Show file tree
Hide file tree
Showing 14 changed files with 919 additions and 149 deletions.
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"

[dependencies]
gray_matter = "0.2.4"
minijinja = "0.27.0"
minijinja = {version = "0.27.0", features = ["source"]}
pulldown-cmark = { version = "0.9.2", default-features = false, features = ["simd"] }
serde = { version = "1.0.150", features = ["derive"]}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ SAARU -> StAtic Almanac Renderer and Unifier
- [x] URGENT: Remove frontmatter from being rendered in the HTML

- [ ] Make templates readable from a single directory
- [ ] URGENT: This is probably a good time to add
- [ ] Reference folder structure
- [ ] Command Line Arguments (to pass in path to reference folder structure)
- [ ] Make template readable from frontmatter
- [ ] Solve for nested templates

Expand Down
215 changes: 215 additions & 0 deletions example_source/build/output.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
<head>
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/styles/monokai-sublime.min.css">
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/highlight.min.js"></script>
<style>
.container {
padding: 1em;
margin: 1em;
}
.frontmatter {
border: 1px dashed black;
padding: 0.5em;
}
</style>
</head>

<body>
<main class="container">
<div class="frontmatter">
<h2> what can this blog do? </h2>
<h5> just a small feature demonstration of the capabilites of this blog </h5>
<p>
Tags:
look

ma

i

can

use

tags

</p>
</div>
<div class="post">
<h1>Markdown Test Blog Post</h1>
<p>This is a test markdown file.
It <em>should</em> <em>parse</em> <strong>soon</strong>.</p>
<pre><code class="language-python">print(&quot;Hello, world!&quot;)
</code></pre>
<h1>An h1 header</h1>
<p>Paragraphs are separated by a blank line.
2nd paragraph. <em>Italic</em>, <strong>bold</strong>, and <code>monospace</code>. Itemized lists
look like:</p>
<ul>
<li>this one</li>
<li>that one</li>
<li>the other one
Note that — not considering the asterisk — the actual text
content starts at 4-columns in.</li>
</ul>
<blockquote>
<p>Block quotes are
written like so.</p>
<p>They can span multiple paragraphs,
if you like.
Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., “it’s all
in chapters 12–14”). Three dots … will be converted to an ellipsis.
Unicode is supported. ☺</p>
</blockquote>
<h2>An h2 header</h2>
<p>Here’s a numbered list:</p>
<ol>
<li>first item</li>
<li>second item</li>
<li>third item
Note again how the actual text starts at 4 columns in (4 characters
from the left side). Here’s a code sample:</li>
</ol>
<pre><code># Let me re-iterate ...
for i in 1 .. 10 { do-something(i) }
</code></pre>
<p>As you probably guessed, indented 4 spaces. By the way, instead of
indenting the block, you can use delimited blocks, if you like:</p>
<pre><code>define foobar() {
print &quot;Welcome to flavor country!&quot;;
}
</code></pre>
<p>NOW FOR SYNTAX HIGHLIGHTING!</p>
<pre><code class="language-python">import time
# Quick, count to ten!
for i in range(10):
# (but not *too* quick)
time.sleep(0.5)
print(i)
</code></pre>
<p>some more python highlighting</p>
<pre><code class="language-py:index.py">@requires_authorization
def somefunc(param1='', param2=0):
r'''A docstring'''
if param1 &gt; param2: # interesting
print 'Gre\'ater'
return (param2 - param1 + 1 + 0b10l) or None
class SomeClass:
pass
&gt;&gt;&gt; message = '''interpreter
... prompt'''
</code></pre>
<p>Here is some text which is large</p>
<pre><code class="language-js">module.exports = {
dest: 'docs',
title: 'Hello VuePress World',
description: 'VuePress install config',
head: [
['link', { rel: 'icon', href: `/logo.png` }],
['link', { rel: 'manifest', href: '/manifest.json' }],
['meta', { name: 'theme-color', content: '#3eaf7c' }],
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
['link', { rel: 'apple-touch-icon', href: `/icons/apple-touch-icon-152x152.png` }],
['link', { rel: 'mask-icon', href: '/icons/safari-pinned-tab.svg', color: '#3eaf7c' }],
['meta', { name: 'msapplication-TileImage', content: '/icons/msapplication-icon-144x144.png' }],
['meta', { name: 'msapplication-TileColor', content: '#000000' }]
],
serviceWorker: true,
ga: 'UA-109510157-1',
</code></pre>
<h3>An h3 header</h3>
<p>Now a nested list:</p>
<ol>
<li>First, get these ingredients:
<ul>
<li>carrots</li>
<li>celery</li>
<li>lentils</li>
</ul>
</li>
<li>Boil some water.</li>
<li>Dump everything in the pot and follow
this algorithm:
find wooden spoon
uncover pot
stir
cover pot
balance wooden spoon precariously on pot handle
wait 10 minutes
goto first step (or shut off burner when done)
Do not bump wooden spoon or it will fall.
Notice again how text always lines up on 4-space indents (including
that last line which continues item 3 above).
Here’s a link to <a href="http://foo.bar">a website</a>, to a <a href="local-doc.html">local
doc</a>, and to a <a href="#an-h2-header">section heading in the current
doc</a>
What about footnotes?<sup class="footnote-reference"><a href="#1">1</a></sup>
Tables can look like this:
| Name | Size | Material | Color |
| ———— | –– | ———– | ———– |
| All Business | 9 | leather | brown |
| Roundabout | 10 | hemp canvas | natural |
| Cinderella | 11 | glass | transparent |
Table: Shoes sizes, materials, and colors.
A horizontal rule follows.</li>
</ol>
<hr />
<p>And images can be specified like so:
<img src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Ftse1.mm.bing.net%2Fth%3Fid%3DOIP.XBuTOZYvrMgYELZ9HzJNZQHaEK%26pid%3DApi&amp;f=1" alt="example image “this is nice”" title="An exemplary image" />
Inline math equation: $\omega = d\phi / dt$. Display
math should get its own line like so:
$$I = \int \rho R^{2} dV$$
And note that you can backslash-escape any punctuation characters
which you wish to be displayed literally, ex.: `foo`, *bar*, etc.
What if I want to embed a video?
Nice, isn’t it?
Here’s to some good writing! :champagne: I’ll see y’all around.
==Adios!==</p>
<div class='adm adm_info'>
<p class="title"> **ℹ️ INFO** This is a info admonition </p>
<div class="body">
here is where I'll show you what you need to know.
I can even add a code block in here!
```rust
println!("This is nice.");
```
</div>
</div>
<div class='adm adm_warning'>
<p class="title"> **⚠️ WARNING** This is a warning admonition </p>
<div class="body">
nice, **this** is nice
</div>
</div>
<div class='adm adm_note'>
<p class="title">**✍️ NOTE** This is a note admonition </p>
<div class="body">
Here is where i'll tell you to take note of something.
</div>
</div>
<div class='adm adm_remember'>
<p class="title"> **🧠 REMEMBER** This is for you to remember something.</p>
<div class="body">
nice, **this** is nice
</div>
</div>
<div class='adm adm_bug'>
<p class="title"> **🐞 BUG** Here's a bug! </p>
<div class="body">
The issue's on line 10 of this code.
```c
#include <stdio.h>
int main() {
printf("hello, world!\n");
}
```
</div>
[^1]: footnotes are fun!
</div>
</main>
<script>hljs.highlightAll();</script>
</body>
Empty file removed example_source/index.md
Empty file.
Empty file removed example_source/post1.md
Empty file.
Empty file removed example_source/post2.md
Empty file.
Loading

0 comments on commit bd03832

Please sign in to comment.