From dc292817d626265897d9ebdc64f801d59288209b Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Sat, 8 Mar 2025 12:01:12 -0500 Subject: Initial Go Rewrite --- .DS_Store | Bin 6148 -> 0 bytes __pycache__/db.cpython-313.pyc | Bin 2033 -> 0 bytes db.py | 22 ------- go.mod | 5 ++ go.sum | 2 + loadarticle.py | 34 ----------- main.go | 102 +++++++++++++++++++++++++++++++++ main.py | 81 -------------------------- requirements.txt | 4 -- static/.DS_Store | Bin 6148 -> 6148 bytes static/404.md | 4 -- static/business_card | 13 ----- static/card | 13 +++++ static/favicon.ico | Bin 15406 -> 0 bytes static/images/LOGO_21x127.png | Bin 1218 -> 0 bytes static/images/LOGO_21x127.svg | 78 ------------------------- static/images/LOGO_Transparent.png | Bin 800 -> 0 bytes static/images/LOGO_Transparent.svg | 74 ------------------------ static/images/SideFlareGreen.svg | 3 - static/images/SideFlarePurple.svg | 3 - static/images/favicon.xcf | Bin 102074 -> 0 bytes static/images/menu.svg | 3 - static/images/wave.svg | 3 - static/logo/FirstInitialLogo.svg | 60 ------------------- static/logo/FullNameLogo.svg | 60 ------------------- static/logo/favicon.png | Bin 2494 -> 0 bytes static/logo/favicon.svg | 67 ---------------------- static/logo/favicon16.png | Bin 777 -> 0 bytes static/logo/favicon32.png | Bin 1676 -> 0 bytes static/logos/FirstInitialLogo.svg | 60 +++++++++++++++++++ static/logos/FullNameLogo.svg | 60 +++++++++++++++++++ static/logos/favicon.png | Bin 0 -> 2494 bytes static/logos/favicon.svg | 67 ++++++++++++++++++++++ static/logos/favicon16.png | Bin 0 -> 777 bytes static/logos/favicon32.png | Bin 0 -> 1676 bytes static/notes.html | 10 ---- static/old/favicon.ico | Bin 0 -> 15406 bytes static/old/images/LOGO_21x127.png | Bin 0 -> 1218 bytes static/old/images/LOGO_21x127.svg | 78 +++++++++++++++++++++++++ static/old/images/LOGO_Transparent.png | Bin 0 -> 800 bytes static/old/images/LOGO_Transparent.svg | 74 ++++++++++++++++++++++++ static/old/images/SideFlareGreen.svg | 3 + static/old/images/SideFlarePurple.svg | 3 + static/old/images/favicon.xcf | Bin 0 -> 102074 bytes static/old/images/menu.svg | 3 + static/old/images/wave.svg | 3 + static/testpage.html | 75 ------------------------ templates/404.html | 25 -------- templates/error.html | 24 ++++++++ templates/template.html | 48 ++++++++-------- 50 files changed, 521 insertions(+), 643 deletions(-) delete mode 100644 .DS_Store delete mode 100644 __pycache__/db.cpython-313.pyc delete mode 100755 db.py create mode 100644 go.mod create mode 100644 go.sum delete mode 100755 loadarticle.py create mode 100644 main.go delete mode 100755 main.py delete mode 100644 requirements.txt delete mode 100755 static/404.md delete mode 100755 static/business_card create mode 100755 static/card delete mode 100755 static/favicon.ico delete mode 100755 static/images/LOGO_21x127.png delete mode 100755 static/images/LOGO_21x127.svg delete mode 100755 static/images/LOGO_Transparent.png delete mode 100755 static/images/LOGO_Transparent.svg delete mode 100755 static/images/SideFlareGreen.svg delete mode 100755 static/images/SideFlarePurple.svg delete mode 100755 static/images/favicon.xcf delete mode 100755 static/images/menu.svg delete mode 100755 static/images/wave.svg delete mode 100644 static/logo/FirstInitialLogo.svg delete mode 100644 static/logo/FullNameLogo.svg delete mode 100644 static/logo/favicon.png delete mode 100644 static/logo/favicon.svg delete mode 100644 static/logo/favicon16.png delete mode 100644 static/logo/favicon32.png create mode 100644 static/logos/FirstInitialLogo.svg create mode 100644 static/logos/FullNameLogo.svg create mode 100644 static/logos/favicon.png create mode 100644 static/logos/favicon.svg create mode 100644 static/logos/favicon16.png create mode 100644 static/logos/favicon32.png delete mode 100644 static/notes.html create mode 100755 static/old/favicon.ico create mode 100755 static/old/images/LOGO_21x127.png create mode 100755 static/old/images/LOGO_21x127.svg create mode 100755 static/old/images/LOGO_Transparent.png create mode 100755 static/old/images/LOGO_Transparent.svg create mode 100755 static/old/images/SideFlareGreen.svg create mode 100755 static/old/images/SideFlarePurple.svg create mode 100755 static/old/images/favicon.xcf create mode 100755 static/old/images/menu.svg create mode 100755 static/old/images/wave.svg delete mode 100755 static/testpage.html delete mode 100755 templates/404.html create mode 100755 templates/error.html diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 7ece749..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/__pycache__/db.cpython-313.pyc b/__pycache__/db.cpython-313.pyc deleted file mode 100644 index ed85aa1..0000000 Binary files a/__pycache__/db.cpython-313.pyc and /dev/null differ diff --git a/db.py b/db.py deleted file mode 100755 index ea42c73..0000000 --- a/db.py +++ /dev/null @@ -1,22 +0,0 @@ -import redis - -class DB: - def __init__(self, host='localhost', port=6379): - self.db = redis.Redis(host=host, port=port, decode_responses=True) - - def add_article(r, article): - r.db.hset(f"articles:{article['url']}", mapping=article) - - def get_article(r, name): - return r.db.hgetall(f"articles:{name}") - - def get_all_articles(r): - keys = r.get_all_articles_keys() - return [r.db.hgetall(key) for key in keys] - - def get_all_articles_keys(r): - return [key for key in r.db.scan_iter(f"articles:*")] - - def get_all_keys(r): - return [key for key in r.db.scan_iter("*")] - diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..32baa23 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module jacobmcdonnell.com/web + +go 1.24.1 + +require github.com/gomarkdown/markdown v0.0.0-20250207164621-7a1f277a159e diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..bb41396 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/gomarkdown/markdown v0.0.0-20250207164621-7a1f277a159e h1:ESHlT0RVZphh4JGBz49I5R6nTdC8Qyc08vU25GQHzzQ= +github.com/gomarkdown/markdown v0.0.0-20250207164621-7a1f277a159e/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= diff --git a/loadarticle.py b/loadarticle.py deleted file mode 100755 index d776ae3..0000000 --- a/loadarticle.py +++ /dev/null @@ -1,34 +0,0 @@ -import db -import sys -import datetime - -path = input("Enter path to db entry backup: ") -sys.path.append(path) -import dbbak - -r = db.DB() -r.add_article(dbbak.db_entry) -print(r.get_all_keys()) -print(r.get_article(dbbak.db_entry['url'])) - -def gen_item(article): - date = article["date"].split("/") - date = datetime.date(int(date[2]), int(date[0]), int(date[1])) - item = [ '', f'{article["title"]}', f'https://jacobmcdonnell.com/articles/{article["url"]}/', f'https://jacobmcdonnell.com/articles/{article["url"]}/', f'{date.strftime("%d %b %Y")} 00:00:00 -0500', '', '' ] - return "\n".join(item) - -def gen_rss(): - rss = ['', '', '', 'Jacob McDonnell', 'Articles from Jacob McDonnell.', 'en-us', 'https://jacobmcdonnell.com/rss.xml', '', '', 'Jacob McDonnell', 'https://jacobmcdonnell.com/favicon.ico', 'https://jacobmcdonnell.com/rss.xml', '' ] - articles = sorted(r.get_all_articles(), reverse=True, key=lambda d: d['id']) - for article in articles: - rss.append(gen_item(article)) - rss.append("") - rss = "\n".join(rss) - file = open("static/rss.xml", "w") - file.write(rss) - file.close() - -rss = input("Do you want to generate a new rss file? [y or n]: ") -if rss == 'y': - gen_rss() - diff --git a/main.go b/main.go new file mode 100644 index 0000000..20deaff --- /dev/null +++ b/main.go @@ -0,0 +1,102 @@ +package main + +import ( + "fmt" + "github.com/gomarkdown/markdown" + "github.com/gomarkdown/markdown/html" + "github.com/gomarkdown/markdown/parser" + "html/template" + "io" + "log" + "net/http" + "os" + "slices" +) + +func GetHome(w http.ResponseWriter, r *http.Request) { + log.Println("Request for:", r.URL.String()) + + if r.URL.String() != "/" { + ErrorPage(w, "Page Not Found.", 404) + return + } + + t := template.Must(template.ParseFiles("templates/template.html")) + + html, err := MarkdownToHTML("static/home.md") + if err != nil { + ErrorPage(w, "Internal Server Error", 500) + } else { + t.Execute(w, template.HTML(html)) + } +} + +func GetFiles(w http.ResponseWriter, r *http.Request) { + log.Println("Request for:", r.URL.String()) + url := fmt.Sprintf("static%s", r.URL.String()) + + allowed := []string{ + "static/rss.xml", + "static/card", + "static/css/main.css", + "static/logos/FirstInitialLogo.svg", + "static/logos/FullNameLogo.svg", + "static/logos/favicon.png", + "static/logos/favicon.svg", + "static/logos/favicon16.png", + "static/logos/favicon32.png", + "static/robots.txt", + } + + if slices.Contains(allowed, url) { + http.ServeFile(w, r, url) + } else { + ErrorPage(w, "Page Not Found.", 404) + } +} + +func MarkdownToHTML(path string) (string, error) { + extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock + p := parser.NewWithExtensions(extensions) + + f, err := os.Open(path) + if err != nil { + return "", err + } + defer f.Close() + + md, err := io.ReadAll(f) + if err != nil { + return "", err + } + + doc := p.Parse(md) + + htmlFlags := html.CommonFlags | html.HrefTargetBlank + opts := html.RendererOptions{Flags: htmlFlags} + renderer := html.NewRenderer(opts) + + return string(markdown.Render(doc, renderer)), nil +} + +func ErrorPage(w http.ResponseWriter, message string, code int) { + log.Println(code, message) + t := template.Must(template.ParseFiles("templates/error.html")) + t.Execute(w, struct { + Code int + Message string + }{ + Code: code, + Message: message, + }) +} + +func main() { + http.HandleFunc("/robots.txt", GetFiles) + http.HandleFunc("/rss.xml", GetFiles) + http.HandleFunc("/card", GetFiles) + http.HandleFunc("/css/", GetFiles) + http.HandleFunc("/logos/", GetFiles) + http.HandleFunc("/", GetHome) + log.Fatal(http.ListenAndServe(":8000", nil)) +} diff --git a/main.py b/main.py deleted file mode 100755 index 3b9b5a6..0000000 --- a/main.py +++ /dev/null @@ -1,81 +0,0 @@ -from flask import Flask, render_template, send_file -from markdown import markdown -from db import DB -from werkzeug.middleware.proxy_fix import ProxyFix - -app = Flask(__name__) -app.wsgi_app = ProxyFix( - app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1 -) -r = DB() - -@app.route('/') -def home(): - return render_template("template.html", body=markdown(read_file("static/home.md"))) - -@app.route('/articles//') -def load_article(site): - '''Capture a given article page and load it''' - article = r.get_article(site) - body = markdown(read_file(article["file"])) - return render_template("articletemplate.html", body=body) - -@app.route('/articles/
/img/') -def get_article_images(article, image): - '''Capture a url for an image in an article and return the file''' - return send_file(f"static/articles/{article}/img/{image}", mimetype='image/png') - -@app.route('/articles/') -def articles_page(): - '''Render the main articles page''' - articles = sorted(r.get_all_articles(), reverse=True, key=lambda d: d['id']) - html = ['
'] - for article in articles: - html.append(f'

{article["title"]}

{article["date"]}
{article["desc"]}

') - html.append("
") - return render_template("articletemplate.html", body="".join(html)) - -@app.route("/card") -def get_card(): - return send_file("static/business_card") - -@app.route("/rss.xml") -@app.route("/rss") -def get_rss(): - return send_file("static/rss.xml") - -@app.route('/css/') -def get_css(file): - return send_file(f"static/css/{file}", mimetype='text/css') - -@app.route('/logos/') -def get_logo(image): - return send_file(f"static/logo/{image}", mimetype='image/svg') - -@app.route('/icons/') -def get_favicon(image): - return send_file(f"static/logo/{image}", mimetype='image/png') - -@app.route('/robots.txt') -def get_robots(): - return send_file("static/robots.txt", mimetype='text/text') - -@app.route("/testpage") -def test_page(): - return render_template("template.html", body=read_file("static/testpage.html")) - -@app.errorhandler(404) -@app.errorhandler(500) -def page_not_found(e): - return render_template('template.html', body=markdown(read_file("static/404.md"))) - -def read_file(file): - '''Read a given html file and return string''' - file = open(file, "r") - body = file.read() - file.close() - return body - -if __name__ == "__main__": - app.run(host="0.0.0.0") - diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 3fc1f39..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -Flask==2.2.3 -Markdown==3.4.3 -redis==4.5.4 -Werkzeug==2.2.3 diff --git a/static/.DS_Store b/static/.DS_Store index 4ce87e9..14762ed 100644 Binary files a/static/.DS_Store and b/static/.DS_Store differ diff --git a/static/404.md b/static/404.md deleted file mode 100755 index 39aa110..0000000 --- a/static/404.md +++ /dev/null @@ -1,4 +0,0 @@ -
-# 404 Page Not Found -Maybe you want to go to one of the pages in nav bar instead. -
diff --git a/static/business_card b/static/business_card deleted file mode 100755 index 1f838b9..0000000 --- a/static/business_card +++ /dev/null @@ -1,13 +0,0 @@ -╭──────────────────────────────────────────────────────────────╮ -│ │ -│ Jacob McDonnell │ -│ │ -│ Email: jacob@jacobmcdonnell.com │ -│ Web: https://jacobmcdonnell.com/ │ -│ │ -│ GitHub: https://github.com/JacobMcDonnell │ -│ LinkedIn: https://linkedin.com/JacobMcDonnell │ -│ │ -│ Card: curl -sL https://jacobmcdonnell.com/card │ -│ │ -╰──────────────────────────────────────────────────────────────╯ diff --git a/static/card b/static/card new file mode 100755 index 0000000..1f838b9 --- /dev/null +++ b/static/card @@ -0,0 +1,13 @@ +╭──────────────────────────────────────────────────────────────╮ +│ │ +│ Jacob McDonnell │ +│ │ +│ Email: jacob@jacobmcdonnell.com │ +│ Web: https://jacobmcdonnell.com/ │ +│ │ +│ GitHub: https://github.com/JacobMcDonnell │ +│ LinkedIn: https://linkedin.com/JacobMcDonnell │ +│ │ +│ Card: curl -sL https://jacobmcdonnell.com/card │ +│ │ +╰──────────────────────────────────────────────────────────────╯ diff --git a/static/favicon.ico b/static/favicon.ico deleted file mode 100755 index 2224936..0000000 Binary files a/static/favicon.ico and /dev/null differ diff --git a/static/images/LOGO_21x127.png b/static/images/LOGO_21x127.png deleted file mode 100755 index 22e3daf..0000000 Binary files a/static/images/LOGO_21x127.png and /dev/null differ diff --git a/static/images/LOGO_21x127.svg b/static/images/LOGO_21x127.svg deleted file mode 100755 index c888b2f..0000000 --- a/static/images/LOGO_21x127.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/static/images/LOGO_Transparent.png b/static/images/LOGO_Transparent.png deleted file mode 100755 index 43e6e4f..0000000 Binary files a/static/images/LOGO_Transparent.png and /dev/null differ diff --git a/static/images/LOGO_Transparent.svg b/static/images/LOGO_Transparent.svg deleted file mode 100755 index c4eb9c6..0000000 --- a/static/images/LOGO_Transparent.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/static/images/SideFlareGreen.svg b/static/images/SideFlareGreen.svg deleted file mode 100755 index 130f9f1..0000000 --- a/static/images/SideFlareGreen.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/static/images/SideFlarePurple.svg b/static/images/SideFlarePurple.svg deleted file mode 100755 index 2249c62..0000000 --- a/static/images/SideFlarePurple.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/static/images/favicon.xcf b/static/images/favicon.xcf deleted file mode 100755 index 344fd42..0000000 Binary files a/static/images/favicon.xcf and /dev/null differ diff --git a/static/images/menu.svg b/static/images/menu.svg deleted file mode 100755 index 7f1a394..0000000 --- a/static/images/menu.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/static/images/wave.svg b/static/images/wave.svg deleted file mode 100755 index 130f9f1..0000000 --- a/static/images/wave.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/static/logo/FirstInitialLogo.svg b/static/logo/FirstInitialLogo.svg deleted file mode 100644 index d2d13f9..0000000 --- a/static/logo/FirstInitialLogo.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - diff --git a/static/logo/FullNameLogo.svg b/static/logo/FullNameLogo.svg deleted file mode 100644 index 4ee480b..0000000 --- a/static/logo/FullNameLogo.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - diff --git a/static/logo/favicon.png b/static/logo/favicon.png deleted file mode 100644 index e403c28..0000000 Binary files a/static/logo/favicon.png and /dev/null differ diff --git a/static/logo/favicon.svg b/static/logo/favicon.svg deleted file mode 100644 index dfe4bb9..0000000 --- a/static/logo/favicon.svg +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - diff --git a/static/logo/favicon16.png b/static/logo/favicon16.png deleted file mode 100644 index e830c36..0000000 Binary files a/static/logo/favicon16.png and /dev/null differ diff --git a/static/logo/favicon32.png b/static/logo/favicon32.png deleted file mode 100644 index eed6d11..0000000 Binary files a/static/logo/favicon32.png and /dev/null differ diff --git a/static/logos/FirstInitialLogo.svg b/static/logos/FirstInitialLogo.svg new file mode 100644 index 0000000..d2d13f9 --- /dev/null +++ b/static/logos/FirstInitialLogo.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + diff --git a/static/logos/FullNameLogo.svg b/static/logos/FullNameLogo.svg new file mode 100644 index 0000000..4ee480b --- /dev/null +++ b/static/logos/FullNameLogo.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + diff --git a/static/logos/favicon.png b/static/logos/favicon.png new file mode 100644 index 0000000..e403c28 Binary files /dev/null and b/static/logos/favicon.png differ diff --git a/static/logos/favicon.svg b/static/logos/favicon.svg new file mode 100644 index 0000000..dfe4bb9 --- /dev/null +++ b/static/logos/favicon.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + diff --git a/static/logos/favicon16.png b/static/logos/favicon16.png new file mode 100644 index 0000000..e830c36 Binary files /dev/null and b/static/logos/favicon16.png differ diff --git a/static/logos/favicon32.png b/static/logos/favicon32.png new file mode 100644 index 0000000..eed6d11 Binary files /dev/null and b/static/logos/favicon32.png differ diff --git a/static/notes.html b/static/notes.html deleted file mode 100644 index 1653551..0000000 --- a/static/notes.html +++ /dev/null @@ -1,10 +0,0 @@ -
- - -
- - -
- -
- diff --git a/static/old/favicon.ico b/static/old/favicon.ico new file mode 100755 index 0000000..2224936 Binary files /dev/null and b/static/old/favicon.ico differ diff --git a/static/old/images/LOGO_21x127.png b/static/old/images/LOGO_21x127.png new file mode 100755 index 0000000..22e3daf Binary files /dev/null and b/static/old/images/LOGO_21x127.png differ diff --git a/static/old/images/LOGO_21x127.svg b/static/old/images/LOGO_21x127.svg new file mode 100755 index 0000000..c888b2f --- /dev/null +++ b/static/old/images/LOGO_21x127.svg @@ -0,0 +1,78 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/static/old/images/LOGO_Transparent.png b/static/old/images/LOGO_Transparent.png new file mode 100755 index 0000000..43e6e4f Binary files /dev/null and b/static/old/images/LOGO_Transparent.png differ diff --git a/static/old/images/LOGO_Transparent.svg b/static/old/images/LOGO_Transparent.svg new file mode 100755 index 0000000..c4eb9c6 --- /dev/null +++ b/static/old/images/LOGO_Transparent.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/static/old/images/SideFlareGreen.svg b/static/old/images/SideFlareGreen.svg new file mode 100755 index 0000000..130f9f1 --- /dev/null +++ b/static/old/images/SideFlareGreen.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/old/images/SideFlarePurple.svg b/static/old/images/SideFlarePurple.svg new file mode 100755 index 0000000..2249c62 --- /dev/null +++ b/static/old/images/SideFlarePurple.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/old/images/favicon.xcf b/static/old/images/favicon.xcf new file mode 100755 index 0000000..344fd42 Binary files /dev/null and b/static/old/images/favicon.xcf differ diff --git a/static/old/images/menu.svg b/static/old/images/menu.svg new file mode 100755 index 0000000..7f1a394 --- /dev/null +++ b/static/old/images/menu.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/old/images/wave.svg b/static/old/images/wave.svg new file mode 100755 index 0000000..130f9f1 --- /dev/null +++ b/static/old/images/wave.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/testpage.html b/static/testpage.html deleted file mode 100755 index 382cbf2..0000000 --- a/static/testpage.html +++ /dev/null @@ -1,75 +0,0 @@ -

Projects

-

Jed is my own version of jed, currently written in java.

-

Ticalcprograms are a set of small programs written in C for the TI-84 Pluse CE graphing calculator.

-

About

-

I'm Jacob McDonnell. I have been interested in computers since I was young. My father has been in the technology field since before I was born, so I guess that interest came from him.

My interests, with respect to computers, are programming, UNIX/Plan9, and electronics/hardware. I know how to program in Java thanks to a high school course, and I like the language for somethings. Currently I am learning the C programming language with the hopes to write my own operating system one day. In my free time I like to play basketball, row, practice German and Russian, and play guitar.

I do not know what I will do with this website just yet, maybe I will write articles about projects that I am working on.

-
-
-#include <stdio.h>
-
-int
-main(void) {
-printf("hello world\n");
-return 0;
-}
-
-
-
-

JED - Jacob's ed

-

Jed is a line mode text editor written in Java. It is similar to ed but not a clone, infact the commands are changed. It currently works but has much room for improvement.

-

Commands

-

-Jed commands:
-
-q: quits.
-
-w: writes the file.
-
-w: filename: writes with inputted name.
-
-o: filename: opens the file.
-
-a: appends user input to the end of the file.
-
-A: appends user input after the current line.
-
-p: prints the file.
-
-n: prints the file with line numbers.
-
-c: deletes and changes the current line.
-
-d: deletes the current line.
-
-Any integer: changes to that line number.
-
-g/expression/: finds and prints the expression.
-
-%s/expression/newExpression/: replaces an expression
-with new user input through the whole file.
-
-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
-
-<integer, integer>: prefix works with d
-and s/ex/nex/ for a range of line.
-
-s/expression/newExpression/: replaces an
-expression with new user input in the current line.
-
-h: prints the commands and their description.
-
-

Building Jed

-

-make
-sudo cp jed /usr/bin/jed && sudo cp jed.jar /usr/bin/jed.jar
-
-

TODO

-
    -
  • Add Regex support
  • -
  • check and rewrite poorly written functions
  • -
-
-

Test of Equations

- -
-

diff --git a/templates/404.html b/templates/404.html deleted file mode 100755 index 69a2259..0000000 --- a/templates/404.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - 404 Page Not Found - - - - - - - -
-
-

404 Page Not Found

-

Maybe you want to go to one of the pages in nav bar instead.

-
-
- - diff --git a/templates/error.html b/templates/error.html new file mode 100755 index 0000000..385835b --- /dev/null +++ b/templates/error.html @@ -0,0 +1,24 @@ + + + + + + {{.Code}} {{.Message}} + + + + + + + +
+
+

{{.Code}} {{.Message}}

+
+
+ + diff --git a/templates/template.html b/templates/template.html index b6af29a..12ca6c5 100755 --- a/templates/template.html +++ b/templates/template.html @@ -1,27 +1,27 @@ - - - - - - - - Jacob McDonnell - - - - - - - -
- {{body|safe}} -
- + + + + + + + + Jacob McDonnell + + + + + + + +
+ {{.}} +
+ -- cgit v1.2.3