add docs + args on script
Signed-off-by: Superkooka <aymeric.gueracague@gmail.com>
This commit is contained in:
parent
a7c63fcea0
commit
efd2bb1df8
16
README.md
16
README.md
|
|
@ -2,23 +2,13 @@
|
||||||
|
|
||||||
> Under construction, may not working
|
> Under construction, may not working
|
||||||
|
|
||||||
## Table of contents
|
|
||||||
|
|
||||||
- [Setup](#setup)
|
|
||||||
- [License](#license)
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
This project require only perl, janet and a web server.
|
This project require only janet to build and a webserver to be served.
|
||||||
|
|
||||||
> You can use ``perl blog --help`` to see all command available.
|
You can build a page like that: `janet page.janet raw/~blog/blog.md public/~blog/blog.html`
|
||||||
|
|
||||||
To build your differents file into ``public`` directory, just run ``perl blog build``. Now just have to serve static file 🥳.
|
|
||||||
|
|
||||||
Note: In developpement, you can use Vagrant with the provided Vagrantfile
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
- Color for code block are heavly inspired by [paste.artemix.org](paste.artemix.org). You can find source code on [Artemis's sourcehut](https://git.sr.ht/~artemis/paste-go)
|
This program is inspired by [sidey theme](https://github.com/ronv/sidey), [aphrodite.dev source code](https://git.sr.ht/~artemis/aphrodite.dev/tree/1e4c18597c0dae8f41a28b42e6261a71e34c5b54) and [atom 'one light syntax' color theme](https://github.com/atom/one-light-syntax).
|
||||||
|
|
||||||
This program is distributed under AGPL3, see LICENSE file for more information.
|
This program is distributed under AGPL3, see LICENSE file for more information.
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env janet
|
#!/usr/bin/env janet
|
||||||
|
|
||||||
(def to-ast
|
(def to-ast
|
||||||
"A custom markdown flavored grammar"
|
"PHP Grammar"
|
||||||
~{
|
~{
|
||||||
:end-of-line (* (? "\r") "\n")
|
:end-of-line (* (? "\r") "\n")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
""))
|
""))
|
||||||
|
|
||||||
(defn pp-ast
|
(defn pp-ast
|
||||||
"Pretty prints the Mardown AST (as provided by (peg/match md-to-ast))"
|
"Pretty prints the AST (as provided by (peg/match {lang}/to-ast))"
|
||||||
[ast]
|
[ast]
|
||||||
(if ast
|
(if ast
|
||||||
(do
|
(do
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
(print "]"))))
|
(print "]"))))
|
||||||
|
|
||||||
(defn main [bin & args]
|
(defn main [bin & args]
|
||||||
(write-to-file "test4.html" (string
|
(write-to-file (get args 1) (string
|
||||||
```
|
```
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
@ -97,7 +97,7 @@
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400&display=swap" rel="stylesheet">
|
||||||
<link href="public/highlight-style.css" rel="stylesheet">
|
<link href="../../public/highlight-style.css" rel="stylesheet">
|
||||||
<script src="https://cdn.tailwindcss.com/3.3.7"></script>
|
<script src="https://cdn.tailwindcss.com/3.3.7"></script>
|
||||||
<script>
|
<script>
|
||||||
tailwind.config = {
|
tailwind.config = {
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
</nav>
|
</nav>
|
||||||
<main class="my-8 ml-24 mr-[38rem] w-[100%] p-4">
|
<main class="my-8 ml-24 mr-[38rem] w-[100%] p-4">
|
||||||
```
|
```
|
||||||
(page-ast-to-html (peg/match markdown-page/to-ast (read-from-file "raw/~blog/blog.md")))
|
(page-ast-to-html (peg/match markdown-page/to-ast (read-from-file (get args 0))))
|
||||||
```
|
```
|
||||||
</main>
|
</main>
|
||||||
<footer class="w-full fixed m-1 left-0 bottom-0 flex justify-center">
|
<footer class="w-full fixed m-1 left-0 bottom-0 flex justify-center">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue