Compare commits

...

26 Commits

Author SHA1 Message Date
471f4c59e6 Upload files to "export_tools"
Some checks failed
build / build (push) Has been cancelled
Add note splitting tool
2025-01-30 14:50:04 +01:00
82cee5b15c Update .gitea/workflows/docker.yml
All checks were successful
build / build (push) Successful in 1m30s
2023-07-17 16:13:53 +02:00
b1e7f9a63a Error correction (repo) in actions
Some checks failed
build / build (push) Failing after 1m21s
2023-07-17 15:56:41 +02:00
d41a6adea5 Error correction in actions
Some checks failed
build / build (push) Failing after 12s
2023-07-17 15:55:10 +02:00
bdbed7ec2c Changed branch in actions
Some checks failed
build / build (push) Failing after 25s
2023-07-17 15:53:39 +02:00
1086827cf7 Added actions 2023-07-17 15:52:01 +02:00
71325101e3 Update 'README.md' 2022-04-20 10:50:33 +02:00
d91a42b6c6 Added sunset theme 2022-04-05 15:49:48 +02:00
176948f871 Merge branch 'master' of https://gitea.squi.fr/Python/squi_notes 2022-03-20 21:21:15 +01:00
51775a8d64 Export has newlines 2022-03-20 21:20:50 +01:00
d54fb438c6 Better screenshot 2022-03-20 21:14:27 +01:00
1d5e5f0e9f Added pics in README 2022-03-20 21:13:07 +01:00
18dadc053a Added sshots 2022-03-20 21:10:18 +01:00
6d6db0b0d5 Corrected light theme 2022-03-20 20:57:36 +01:00
d0382a0140 Light theme 2022-03-20 20:51:47 +01:00
8447447ed4 Theme select 2022-03-20 19:33:42 +01:00
efd8622146 Font changed again 2022-03-20 17:58:45 +01:00
049adbed2d Mono font 2022-03-20 13:21:01 +01:00
9828394d30 Changed font to noto 2022-03-20 13:10:59 +01:00
661693a9d1 Update 'README.md'
Updated todo
2022-03-19 22:00:20 +01:00
f2411e3944 Merge branch 'master' of https://gitea.squi.fr/Python/squi_notes 2022-03-19 12:49:07 +01:00
1f288bd583 Readmode, not accidental suppressions anymore 2022-03-19 12:48:54 +01:00
b36e71ba57 Update 'README.md' 2022-03-18 11:35:39 +01:00
5ef2f5fc55 Added deletion confirmation 2022-03-18 01:37:03 +01:00
6f6275cc59 Merge branch 'master' of https://gitea.squi.fr/Python/squi_notes 2022-03-18 01:35:13 +01:00
7e241d857c Confirmation for deletion 2022-03-18 01:34:17 +01:00
28 changed files with 898 additions and 29 deletions

View File

@ -0,0 +1,42 @@
name: build
on:
push:
branches:
- "main"
- "master"
jobs:
build:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # all history for all branches and tags
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to registry
uses: docker/login-action@v2
with:
registry: gitea.squi.fr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
env:
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
with:
context: .
file: ./Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: gitea.squi.fr/justine/squi_notes:latest

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
./data
src/data
src/__pycache__

View File

@ -1,11 +1,20 @@
# squip_notes
This is a *very* basic notes-taking program. It uses python with flask and pickle, to give a really light and simple web interface for note taking.
This is a basic notes-taking program. It uses python with flask and pickle, to give a really light and simple web interface for note taking.
It uses the [dracula](https://github.com/dracula/dracula-theme) colors.
![dark theme screenshot](./ssdark.png)
![light theme screenshot](./sslight.png)
![Screenshot of the application](./squipnotes.png)
# Features
* No accounts : this is made to be used as a single page (you can't have multiple user accounts). This is best suited as a personnal, self-hosted application in your own network (or it could also work for a work team).
* Simplicity: Simply get on the page and start writing. The notes syntax is markdown.
* Themes : As for now, there is a default dark theme (dracula), and an optionnal light theme (loosely based on solarized light). They can be selected via the interface.
# Themes (adding your own)
All themes are in src/static/styles. They are the .css files. If you want to add your own, simply copy one of the existing files to a new one, named after the others. The numbers in the css file names determine the priority (make yours priority 0 to have it be the default).
## Changing the code syntax highlight theme
* Install pygmentyze (it then must be in your path; pip generally installs things in ~/.local/bin when using a Linux OS):
```
@ -24,6 +33,8 @@ pygmentize -S dracula -f html -a .codehilite > styles.css
* Replace all css for .codehilite in src/static/main.css with what's in styles.css
## Run with Docker
Automated images for amd and arm should be included in this repo.
### Using traefik
If you use traefik, you only have to change the url in the label "traefik.http.routers.sqnotes.rule". You can also modify the labels to rename the service from "sqnotes" to anything else.
@ -41,3 +52,7 @@ docker-compose up -d
## Future features, todo
* Replace pickle with sqlite or smth
* Use as a CGI script rather than using flask's in-built server
## Credits
Automation : git.rznet.fr

Binary file not shown.

View File

@ -13,7 +13,7 @@ services:
#ports:
#- 8080:8080
labels:
- "traefik.http.routers.sqnotes.rule=Host(`notes.sq.lan`)"
- "traefik.http.routers.sqnotes.rule=Host(`notes.squi.fr`)"
- "traefik.http.services.sqnotes.loadbalancer.server.port=8080"
- "traefik.docker.network=traefik_traefik"
networks:

91
export_tools/notesplit.py Normal file
View File

@ -0,0 +1,91 @@
#!/usr/bin/env python3
#coding: utf-8
#!---------- notesplit.py ----------
# Used for splitting notes extracted from my note-taking webapp
# into single markdown files.
# It was a good run but I am switching to obsidian.
#-----------------------------------!
#----------! FUNC
def get_args():
'''Gets all the arguments passed to the script and returns them in a parse_args()-type object.
No args
Returns:
-args : an args object containing all the optional arguments passed to the script.
'''
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--file", help = "File to split", action="store", type=str, required=True)
parser.add_argument("-d", "--dest", help = "Folder to put the resulting files in - will overwrite anything already there !", action="store", type=str, required=True)
#Creating the args object
args=parser.parse_args()
return args
def filesplit(file: str):
'''Split the extract file and return a dict name.md : text of the note
takes the path of the file
'''
import re
with open(file, "r") as contents:
contents = contents.read()
res = {}
contents = re.split(r'[^\-]\-\-\-\-\-[^\-]', contents)
i = 0
for note in contents:
n = note.splitlines()
title = f"untitled_{i}"
i += 1
for line in n:
if line.startswith("#"):
title = line[1:]
print(f"FOUND TITLE {title} in {line}")
break
res[title] = note
return res
def sanitize(title):
'''Take a notetitle and make it a valid filename. Add md extension.
'''
title = title.replace("/", "_")
title = title.replace(" ", "_")
title = title.replace("\n", "_")
title = title.replace("?", "_")
title = title.replace("(", "_")
title = title.replace(")", "_")
title = title.replace(":", "_")
title = title.replace(";", "_")
title = title.replace('"', "_")
title = title.replace("'", "_")
title = f"{title}.md"
return title
def savenotes(notes: dict, dest: str):
'''Save notes to files in folder dest
'''
import os
os.chdir(dest)
for title in notes:
text = notes[title]
filename = sanitize(title)
with open(filename, "w") as writer:
writer.write(text)
print(f"Saved {filename} in {dest}")
#----------! MAIN
args = get_args()
file = args.file
notes = filesplit(file)
savenotes(notes, args.dest)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

View File

@ -1,8 +1,9 @@
#!/usr/bin/env python3
#coding: utf-8
from flask import Flask, render_template, Markup, request, redirect, url_for
from flask import Flask, render_template, Markup, request, redirect, url_for, make_response
from classes import note
from funcs import dumpnotes, getnotes, catnotes, delnote, findnote, addnote, mknotedir, exportnotes
from funcs import dumpnotes, getnotes, catnotes, delnote, findnote, addnote, mknotedir, exportnotes, getthemes
from random import choice
#!---------- squiNotes.py ----------
# My notes-taking app
@ -12,12 +13,29 @@ from funcs import dumpnotes, getnotes, catnotes, delnote, findnote, addnote, mkn
#----------! MAIN
app = Flask(__name__)
mknotedir()
#Theme variable will be made global in every flask function
#css path will then be deducted
@app.route('/', methods=['GET'])
def render():
#Does the user have a theme ?
#theme list
themes = getthemes()
#Setting default theme if the user does not have one...
if request.cookies.get('csslink') is None:
csslink = themes[0]
resp = make_response(render_template("homepage.html", nr = catnotes(getnotes()), csslink = csslink))
resp.set_cookie("csslink", csslink)
#...or using their preferred theme if do have one
else:
csslink = request.cookies.get('csslink')
resp = make_response(render_template("homepage.html", nr = catnotes(getnotes()), csslink = csslink))
#Delete has been clicked
try:
todelete = request.args.get("delete")
if todelete is not None:
delnote(int(todelete))
except Exception as e:
pass
@ -30,27 +48,85 @@ def render():
except Exception as e:
pass
return render_template("homepage.html", nr = catnotes(getnotes()))
#Switch theme has been clicked
try:
switchpls = request.args.get("switchpls")
if switchpls is not None:
#Clicking "Change theme" switches to a random (other) theme
current = csslink
while csslink == current:
csslink = choice(themes)
#Commiting new theme, setting cookie for it, return template
#resp = make_response(render_template("homepage.html", nr = catnotes(getnotes()), csslink = csslink))
resp = make_response(redirect(request.path,code=302))
resp.set_cookie('csslink', csslink)
return resp
except Exception as e:
pass
#Read has been clicked
try:
toread = request.args.get("toread")
if toread is not None:
return redirect(url_for('readmode', note=(int(toread))))
except Exception as e:
pass
return resp
#Export mode
@app.route('/export', methods=['GET'])
def rawnotes():
#No theme in export
return render_template("export.html", rawnotes = exportnotes())
#Read mode
@app.route('/readmode', methods=['GET','POST'])
def readmode():
#theme
csslink = request.cookies.get('csslink')
#Render page
if request.method == 'GET':
notenumber = request.args.get("note")
mynote = findnote(int(notenumber))
return render_template("read.html", note=mynote.flaskrender(), csslink = csslink)
#Edition mode
@app.route('/edit', methods=['GET', 'POST'])
def edit():
import time
#theme
csslink = request.cookies.get('csslink')
#Render edition page
if request.method == "GET":
notenumber = request.args.get("notenumber")
mynote = findnote(int(notenumber))
delnote(int(notenumber))
return render_template("edit.html", notenumber=notenumber, ntitle=mynote.title, ntext=mynote.text)
return render_template("edit.html", notenumber=notenumber, ntitle=mynote.title, ntext=mynote.text, csslink = csslink)
if request.method == "POST":
notetitle = request.form['title']
notetext = request.form['text']
notenumber = int(request.form['notenumber'])
delnote(notenumber)
rightnow = int(time.time())
newnote = note(createtime=notenumber, modtime=rightnow, title=notetitle, text=notetext)
addnote(newnote)
return render_template("read.html", note=newnote.flaskrender(), csslink = csslink)
#Basic route, allows note creation
@app.route('/', methods=['POST'])
def homepage():
import time
#theme
csslink = request.cookies.get('csslink')
#New note
try:
notetitle = request.form['title']
@ -60,9 +136,7 @@ def homepage():
addnote(newnote)
except:
pass
return render_template("homepage.html", nr = catnotes(getnotes()))
return render_template("homepage.html", nr = catnotes(getnotes()), csslink = csslink)
if __name__ == '__main__':
app.run(host="0.0.0.0")

View File

@ -26,9 +26,9 @@ class note:
timestamp = timestamp.strftime("%d/%m/%Y-%H:%M:%S")
return timestamp
def flaskrender(self):
def titlerender(self):
"""
Render the note as html for flask, using flask.Markup
Render the note title and details as html for flask, using flask.Markup.
"""
import markdown
from flask import Markup
@ -37,7 +37,25 @@ class note:
<hr>
<div class="notetitle">{Markup.escape(self.title)}</div>
<form action="." method="GET" name="{self.createtime}">
<button type="submit" name="delete" value="{self.createtime}" class="delbutton">Delete</button>|<button type="submit" name="edit" value="{self.createtime}" class="editbutton">Edit</button>
<button type="submit" name="delete" value="{self.createtime}" class="notebutton" onclick="return confirm('Really ?')">Delete</button>|<button type="submit" name="edit" value="{self.createtime}" class="notebutton">Edit</button>|<button type="submit" name="toread" value="{self.createtime}" class="readbutton">Read</button>
</form>
<div class="notetime">Created : {self.rendertime(self.createtime)}
<br>Modified : {self.rendertime(self.modtime)}</div><br>
"""
return Markup(rendered)
def flaskrender(self):
"""
Render the note whole content as html for flask, using flask.Markup
"""
import markdown
from flask import Markup, url_for
rendered = f"""
<hr>
<div class="notetitle">{Markup.escape(self.title)}</div>
<form action="." method="GET" name="{self.createtime}">
<button type="submit" name="delete" value="{self.createtime}" class="notebutton" onclick="return confirm('Really ?')">Delete</button>|<button type="submit" name="edit" value="{self.createtime}" class="notebutton">Edit</button>|<a href="{ url_for('render') }" class="backlink">Back</a>
</form>
<div class="notetime">Created : {self.rendertime(self.createtime)}
<br>Modified : {self.rendertime(self.modtime)}</div><br>

Binary file not shown.

View File

@ -43,7 +43,7 @@ def catnotes(notelist: list):
"""
final = ""
for note in notelist:
final += note.flaskrender()
final += note.titlerender()
return final
@ -94,3 +94,22 @@ def exportnotes():
return
def getthemes():
"""
Find all themes present in our css folder and return a nice list of
css links, for the user to pick into
"""
from flask import url_for
from os import listdir
allfiles = listdir("./static/styles")
themefiles, themes = [], []
for myfile in allfiles:
if myfile.endswith(".css"):
themefiles.append(myfile)
for themefile in themefiles:
themes.append(url_for('static', filename=f'styles/{themefile}'))
return themes

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +1,31 @@
@font-face {
src: {{ url_for('static', filename='sspro-ita.ttf') }};
font-family: "Work Sans";
src: url(WorkSans-Regular.ttf);
}
@font-face {
font-family: "Work Sans";
src: url(WorkSans-Bold.ttf);
font-weight: bold;
}
@font-face {
font-family: "Work Sans";
src: url(WorkSans-Italic.ttf);
font-style: italic;
}
@font-face {
font-family: "Work Sans";
src: url(WorkSans-BoldItalic.ttf);
font-weight: bold;
font-style: italic;
}
html {
background-color: #22242e;
font-family: 'Source Sans Pro';
font-family: 'Work Sans';
color: #f8f8f2;
}
@ -29,7 +50,7 @@ h5 {
}
button {
background-color: #22242e;
background-color: transparent;
border: none;
color: #8be9fd;
padding: 1px 2px;
@ -37,7 +58,7 @@ button {
text-decoration: none;
display: inline-block;
font-size: 1em;
font-style: italic;
font-style: normal;
cursor: pointer;
}
@ -48,21 +69,34 @@ hr {
a {
color: #8be9fd;
text-decoration: underline;
font-style: italic;
font-style: normal;
font-size: 1em;
}
.exportlink {
.topbar {
background-color: #22242e;
border: none;
color: #8be9fd;
text-align: left;
text-decoration: none;
display: block;
}
.topbutton {
float: right;
}
.exportlink {
text-decoration: none;
font-style: normal;
}
.pagetitle {
font-size: 3em;
color: #ff79c6;
float: left;
}
.notetitle {
color: #ff79c6;
font-size: 2em;
@ -73,6 +107,12 @@ a {
font-style: italic;
}
.backlink {
text-decoration: none;
font-style: normal;
}
/*
.title {
background: #44475a;

View File

@ -0,0 +1,245 @@
@font-face {
font-family: "Work Sans";
src: url(WorkSans-Regular.ttf);
}
@font-face {
font-family: "Work Sans";
src: url(WorkSans-Bold.ttf);
font-weight: bold;
}
@font-face {
font-family: "Work Sans";
src: url(WorkSans-Italic.ttf);
font-style: italic;
}
@font-face {
font-family: "Work Sans";
src: url(WorkSans-BoldItalic.ttf);
font-weight: bold;
font-style: italic;
}
html {
background-color: #eee8d5;
font-family: 'Work Sans';
color: #586e75;
}
h1 {
color: #d33682;
}
h2 {
color: #d33682;
}
h3 {
color: #d33682;
}
h4 {
color: #d33682;
}
h5 {
color: #d33682;
}
button {
background-color: transparent;
border: none;
color: #2aa198;
padding: 1px 2px;
text-align: left;
text-decoration: none;
display: inline-block;
font-size: 1em;
font-style: normal;
cursor: pointer;
}
hr {
border: 3px dotted;
}
a {
color: #2aa198;
text-decoration: underline;
font-style: normal;
font-size: 1em;
}
.topbar {
background-color: #eee8d5;
border: none;
color: #586e75;
text-align: left;
text-decoration: none;
font-style: normal;
display: block;
}
.topbutton {
float: right;
text-decoration: none;
color: #2aa198;
}
.exportlink {
text-decoration: none;
}
.pagetitle {
font-size: 3em;
color: #ff79c6;
float: left;
}
.backlink {
text-decoration: none;
}
.notetitle {
color: #ff79c6;
font-size: 2em;
}
.notetime {
color: #6272a4;
font-style: italic;
}
/*
.title {
background: #44475a;
color: #d33682;
font-weight: bold;
font-size: 2em
border-style: none;
border-radius: 1px;
outline: none;
border-width: 1px;
}
*/
.text {
width: 100%;
background: #fdf6e3;
color: #657b83;
border-radius: 5px;
border-style: none;
outline: none;
border-width: 1px;
height: 80%;
font-size: 15px;
-webkit-box-shadow: 0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);
}
.title {
width: 100%;
background: #fdf6e3;
color: #657b83;
border-radius: 5px;
border-style: none;
outline: none;
border-width: 1px;
height: 25px;
margin: 5px 0px 5px 0px;
font-size: 15px;
-webkit-box-shadow: 0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);
}
.rawtext {
white-space: pre-wrap;
}
/* Syntax highlighting */
pre { line-height: 125%; }
td.linenos .normal { color: #93a1a1; background-color: #eee8d5; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #93a1a1; background-color: #eee8d5; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.codehilite .hll { background-color: #eee8d5 }
.codehilite { background: #fdf6e3; color: #657b83 }
.codehilite .c { color: #93a1a1; font-style: italic } /* Comment */
.codehilite .err { color: #657b83; background-color: #dc322f } /* Error */
.codehilite .esc { color: #657b83 } /* Escape */
.codehilite .g { color: #657b83 } /* Generic */
.codehilite .k { color: #859900 } /* Keyword */
.codehilite .l { color: #657b83 } /* Literal */
.codehilite .n { color: #657b83 } /* Name */
.codehilite .o { color: #93a1a1 } /* Operator */
.codehilite .x { color: #657b83 } /* Other */
.codehilite .p { color: #657b83 } /* Punctuation */
.codehilite .ch { color: #93a1a1; font-style: italic } /* Comment.Hashbang */
.codehilite .cm { color: #93a1a1; font-style: italic } /* Comment.Multiline */
.codehilite .cp { color: #d33682 } /* Comment.Preproc */
.codehilite .cpf { color: #93a1a1 } /* Comment.PreprocFile */
.codehilite .c1 { color: #93a1a1; font-style: italic } /* Comment.Single */
.codehilite .cs { color: #93a1a1; font-style: italic } /* Comment.Special */
.codehilite .gd { color: #dc322f } /* Generic.Deleted */
.codehilite .ge { color: #657b83; font-style: italic } /* Generic.Emph */
.codehilite .gr { color: #dc322f } /* Generic.Error */
.codehilite .gh { color: #657b83; font-weight: bold } /* Generic.Heading */
.codehilite .gi { color: #859900 } /* Generic.Inserted */
.codehilite .go { color: #657b83 } /* Generic.Output */
.codehilite .gp { color: #268bd2; font-weight: bold } /* Generic.Prompt */
.codehilite .gs { color: #657b83; font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #657b83; text-decoration: underline } /* Generic.Subheading */
.codehilite .gt { color: #268bd2 } /* Generic.Traceback */
.codehilite .kc { color: #2aa198 } /* Keyword.Constant */
.codehilite .kd { color: #2aa198 } /* Keyword.Declaration */
.codehilite .kn { color: #cb4b16 } /* Keyword.Namespace */
.codehilite .kp { color: #859900 } /* Keyword.Pseudo */
.codehilite .kr { color: #859900 } /* Keyword.Reserved */
.codehilite .kt { color: #b58900 } /* Keyword.Type */
.codehilite .ld { color: #657b83 } /* Literal.Date */
.codehilite .m { color: #2aa198 } /* Literal.Number */
.codehilite .s { color: #2aa198 } /* Literal.String */
.codehilite .na { color: #657b83 } /* Name.Attribute */
.codehilite .nb { color: #268bd2 } /* Name.Builtin */
.codehilite .nc { color: #268bd2 } /* Name.Class */
.codehilite .no { color: #268bd2 } /* Name.Constant */
.codehilite .nd { color: #268bd2 } /* Name.Decorator */
.codehilite .ni { color: #268bd2 } /* Name.Entity */
.codehilite .ne { color: #268bd2 } /* Name.Exception */
.codehilite .nf { color: #268bd2 } /* Name.Function */
.codehilite .nl { color: #268bd2 } /* Name.Label */
.codehilite .nn { color: #268bd2 } /* Name.Namespace */
.codehilite .nx { color: #657b83 } /* Name.Other */
.codehilite .py { color: #657b83 } /* Name.Property */
.codehilite .nt { color: #268bd2 } /* Name.Tag */
.codehilite .nv { color: #268bd2 } /* Name.Variable */
.codehilite .ow { color: #859900 } /* Operator.Word */
.codehilite .w { color: #657b83 } /* Text.Whitespace */
.codehilite .mb { color: #2aa198 } /* Literal.Number.Bin */
.codehilite .mf { color: #2aa198 } /* Literal.Number.Float */
.codehilite .mh { color: #2aa198 } /* Literal.Number.Hex */
.codehilite .mi { color: #2aa198 } /* Literal.Number.Integer */
.codehilite .mo { color: #2aa198 } /* Literal.Number.Oct */
.codehilite .sa { color: #2aa198 } /* Literal.String.Affix */
.codehilite .sb { color: #2aa198 } /* Literal.String.Backtick */
.codehilite .sc { color: #2aa198 } /* Literal.String.Char */
.codehilite .dl { color: #2aa198 } /* Literal.String.Delimiter */
.codehilite .sd { color: #93a1a1 } /* Literal.String.Doc */
.codehilite .s2 { color: #2aa198 } /* Literal.String.Double */
.codehilite .se { color: #2aa198 } /* Literal.String.Escape */
.codehilite .sh { color: #2aa198 } /* Literal.String.Heredoc */
.codehilite .si { color: #2aa198 } /* Literal.String.Interpol */
.codehilite .sx { color: #2aa198 } /* Literal.String.Other */
.codehilite .sr { color: #cb4b16 } /* Literal.String.Regex */
.codehilite .s1 { color: #2aa198 } /* Literal.String.Single */
.codehilite .ss { color: #2aa198 } /* Literal.String.Symbol */
.codehilite .bp { color: #268bd2 } /* Name.Builtin.Pseudo */
.codehilite .fm { color: #268bd2 } /* Name.Function.Magic */
.codehilite .vc { color: #268bd2 } /* Name.Variable.Class */
.codehilite .vg { color: #268bd2 } /* Name.Variable.Global */
.codehilite .vi { color: #268bd2 } /* Name.Variable.Instance */
.codehilite .vm { color: #268bd2 } /* Name.Variable.Magic */
.codehilite .il { color: #2aa198 } /* Literal.Number.Integer.Long */

View File

@ -0,0 +1,294 @@
@font-face {
font-family: "Work Sans";
src: url(WorkSans-Regular.ttf);
}
@font-face {
font-family: "Work Sans";
src: url(WorkSans-Bold.ttf);
font-weight: bold;
}
@font-face {
font-family: "Work Sans";
src: url(WorkSans-Italic.ttf);
font-style: italic;
}
@font-face {
font-family: "Work Sans";
src: url(WorkSans-BoldItalic.ttf);
font-weight: bold;
font-style: italic;
}
html {
background-color: #2e2e2e;
font-family: 'Work Sans';
color: #ffbc80;
}
h1 {
color: #f76e11;
}
h2 {
color: #f76e11;
}
h3 {
color: #f76e11;
}
h4 {
color: #f76e11;
}
h5 {
color: #f76e11;
}
button {
background-color: transparent;
border: none;
color: #b958a5;
padding: 1px 2px;
text-align: left;
text-decoration: none;
display: inline-block;
font-size: 1em;
font-style: normal;
cursor: pointer;
}
hr {
border: 3px dotted;
}
a {
color: #b958a5;
text-decoration: underline;
font-style: normal;
font-size: 1em;
}
.topbar {
background-color: #eee8d5;
border: none;
color: #ff9f45;
text-align: left;
text-decoration: none*;
font-style: normal;
display: block;
}
.topbutton {
float: right;
text-decoration: none;
color: #ff9f45;
}
.exportlink {
text-decoration: none;
}
.pagetitle {
font-size: 3em;
color: #fc4f4f;
float: left;
}
.backlink {
text-decoration: none;
}
.notetitle {
color: #f76e11;
font-size: 2em;
}
.notetime {
color: #ff9f45;
font-style: italic;
}
/*
.title {
background: #44475a;
color: #f76e11;
font-weight: bold;
font-size: 2em
border-style: none;
border-radius: 1px;
outline: none;
border-width: 1px;
}
*/
.text {
width: 100%;
background: #404040;
color: #ff9f45;
border-radius: 5px;
border-style: none;
outline: none;
border-width: 1px;
height: 40%;
font-size: 15px;
-webkit-box-shadow: 0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);
}
.title {
width: 100%;
background: #404040;
color: #ff9f45;
border-radius: 5px;
border-style: none;
outline: none;
border-width: 1px;
height: 25px;
margin: 5px 0px 5px 0px;
font-size: 15px;
-webkit-box-shadow: 0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);
}
.rawtext {
white-space: pre-wrap;
}
/* Coming from SqTodo
.priorityinput {
background-color: #404040;
color: #ff9f45;
border-radius: 5px;
border-style: none;
border-width: 1px;
width: 40px;
}
label {
background-color: transparent;
border: none;
color: #ff9f45;
padding: 1px 2px;
text-align: left;
text-decoration: none;
display: inline-block;
font-size: 1em;
font-style: normal;
cursor: pointer;
}
/* Hide priority select arrows
Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
.donemarkselect {
background-color: #404040;
color: #ff9f45;
border-radius: 5px;
border-style: inset;
border-color: #ff79c6;
border-width: 1px;
width: 40px;
}
.separator {
text-align: center;
}
*/
/* Syntax highlighting */
pre { line-height: 125%; }
td.linenos .normal { color: #5d6262; background-color: #353535; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #5d6262; background-color: #353535; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #7a8080; background-color: #353535; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #7a8080; background-color: #353535; padding-left: 5px; padding-right: 5px; }
.codehilite .hll { background-color: #484848 }
.codehilite { background: #3f3f3f; color: #dcdccc }
.codehilite .c { color: #7f9f7f; font-style: italic } /* Comment */
.codehilite .err { color: #e37170; font-weight: bold } /* Error */
.codehilite .esc { color: #dcdccc } /* Escape */
.codehilite .g { color: #ecbcbc; font-weight: bold } /* Generic */
.codehilite .k { color: #efdcbc } /* Keyword */
.codehilite .l { color: #9fafaf } /* Literal */
.codehilite .n { color: #dcdccc } /* Name */
.codehilite .o { color: #f0efd0 } /* Operator */
.codehilite .x { color: #dcdccc } /* Other */
.codehilite .p { color: #f0efd0 } /* Punctuation */
.codehilite .ch { color: #7f9f7f; font-style: italic } /* Comment.Hashbang */
.codehilite .cm { color: #7f9f7f; font-style: italic } /* Comment.Multiline */
.codehilite .cp { color: #dfaf8f; font-weight: bold; font-style: italic } /* Comment.Preproc */
.codehilite .cpf { color: #cc9393; font-style: italic } /* Comment.PreprocFile */
.codehilite .c1 { color: #7f9f7f; font-style: italic } /* Comment.Single */
.codehilite .cs { color: #dfdfdf; font-weight: bold; font-style: italic } /* Comment.Special */
.codehilite .gd { color: #c3bf9f; font-weight: bold; background-color: #313c36 } /* Generic.Deleted */
.codehilite .ge { color: #ffffff; font-weight: bold } /* Generic.Emph */
.codehilite .gr { color: #ecbcbc; font-weight: bold } /* Generic.Error */
.codehilite .gh { color: #efefef; font-weight: bold } /* Generic.Heading */
.codehilite .gi { color: #709080; font-weight: bold; background-color: #313c36 } /* Generic.Inserted */
.codehilite .go { color: #5b605e; font-weight: bold } /* Generic.Output */
.codehilite .gp { color: #ecbcbc; font-weight: bold } /* Generic.Prompt */
.codehilite .gs { color: #ecbcbc; font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #efefef; font-weight: bold } /* Generic.Subheading */
.codehilite .gt { color: #80d4aa; font-weight: bold; background-color: #2f2f2f } /* Generic.Traceback */
.codehilite .kc { color: #dca3a3 } /* Keyword.Constant */
.codehilite .kd { color: #f0dfaf } /* Keyword.Declaration */
.codehilite .kn { color: #f0dfaf } /* Keyword.Namespace */
.codehilite .kp { color: #efdcbc } /* Keyword.Pseudo */
.codehilite .kr { color: #efdcbc } /* Keyword.Reserved */
.codehilite .kt { color: #dfdfbf; font-weight: bold } /* Keyword.Type */
.codehilite .ld { color: #9fafaf } /* Literal.Date */
.codehilite .m { color: #8cd0d3 } /* Literal.Number */
.codehilite .s { color: #cc9393 } /* Literal.String */
.codehilite .na { color: #efef8f } /* Name.Attribute */
.codehilite .nb { color: #efef8f } /* Name.Builtin */
.codehilite .nc { color: #efef8f } /* Name.Class */
.codehilite .no { color: #dca3a3 } /* Name.Constant */
.codehilite .nd { color: #dcdccc } /* Name.Decorator */
.codehilite .ni { color: #cfbfaf } /* Name.Entity */
.codehilite .ne { color: #c3bf9f; font-weight: bold } /* Name.Exception */
.codehilite .nf { color: #efef8f } /* Name.Function */
.codehilite .nl { color: #dcdccc } /* Name.Label */
.codehilite .nn { color: #dcdccc } /* Name.Namespace */
.codehilite .nx { color: #dcdccc } /* Name.Other */
.codehilite .py { color: #dcdccc } /* Name.Property */
.codehilite .nt { color: #e89393; font-weight: bold } /* Name.Tag */
.codehilite .nv { color: #dcdccc } /* Name.Variable */
.codehilite .ow { color: #f0efd0 } /* Operator.Word */
.codehilite .w { color: #dcdccc } /* Text.Whitespace */
.codehilite .mb { color: #8cd0d3 } /* Literal.Number.Bin */
.codehilite .mf { color: #c0bed1 } /* Literal.Number.Float */
.codehilite .mh { color: #8cd0d3 } /* Literal.Number.Hex */
.codehilite .mi { color: #8cd0d3 } /* Literal.Number.Integer */
.codehilite .mo { color: #8cd0d3 } /* Literal.Number.Oct */
.codehilite .sa { color: #cc9393 } /* Literal.String.Affix */
.codehilite .sb { color: #cc9393 } /* Literal.String.Backtick */
.codehilite .sc { color: #cc9393 } /* Literal.String.Char */
.codehilite .dl { color: #cc9393 } /* Literal.String.Delimiter */
.codehilite .sd { color: #7f9f7f } /* Literal.String.Doc */
.codehilite .s2 { color: #cc9393 } /* Literal.String.Double */
.codehilite .se { color: #cc9393 } /* Literal.String.Escape */
.codehilite .sh { color: #cc9393 } /* Literal.String.Heredoc */
.codehilite .si { color: #dca3a3; font-weight: bold } /* Literal.String.Interpol */
.codehilite .sx { color: #cc9393 } /* Literal.String.Other */
.codehilite .sr { color: #cc9393 } /* Literal.String.Regex */
.codehilite .s1 { color: #cc9393 } /* Literal.String.Single */
.codehilite .ss { color: #cc9393 } /* Literal.String.Symbol */
.codehilite .bp { color: #dcdccc } /* Name.Builtin.Pseudo */
.codehilite .fm { color: #efef8f } /* Name.Function.Magic */
.codehilite .vc { color: #dcdccc } /* Name.Variable.Class */
.codehilite .vg { color: #dcdccc } /* Name.Variable.Global */
.codehilite .vi { color: #dcdccc } /* Name.Variable.Instance */
.codehilite .vm { color: #dcdccc } /* Name.Variable.Magic */
.codehilite .il { color: #8cd0d3 } /* Literal.Number.Integer.Long */

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
<html>
<head>
<link rel="stylesheet" href="{{ url_for('static', filename='styles/main.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ csslink }}" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- <link href='https://fonts.googleapis.com/css?family=Source Sans Pro' rel='stylesheet'> -->
<title>sqnotes</title>
@ -9,9 +9,10 @@
<h1 class="pagetitle">$ ~/sqnotes</h1>
<div class="div1">
<form action="." method="POST">
<form action="{{ url_for('edit') }}" method="POST">
<textarea type="text" name="title" class="title">{{ ntitle }}</textarea><br>
<textarea type="text" name="text" cols = "60*" class="text">{{ ntext }}</textarea><br>
<input type="hidden" name="notenumber" value="{{ notenumber }}" />
<button type="submit" name="submit">OK</button>
<div class="notetime">Note : you can drag the textbox to make it bigger.</div>
</form>

View File

@ -1,6 +1,10 @@
<html>
<head>
<link rel="stylesheet" href="{{ url_for('static', filename='styles/main.css') }}" type="text/css" />
<style>
.rawtext {
white-space: pre-wrap;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!--<link href='https://fonts.googleapis.com/css?family=Source Sans Pro' rel='stylesheet'> -->
<title>sqnotes</title>

View File

@ -1,13 +1,16 @@
<html>
<head>
<link rel="stylesheet" href="{{ url_for('static', filename='styles/main.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ csslink }}" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!--<link href='https://fonts.googleapis.com/css?family=Source Sans Pro' rel='stylesheet'> -->
<title>sqnotes</title>
</head>
<body>
<h1 class="pagetitle">$ ~/sqnotes</h1><a class="exportlink" href="{{ url_for('rawnotes') }}">Raw notes</a>
<div class="topbar">
<h1 class="pagetitle">$ ~/sqnotes</h1>
<form action="." method="GET"><button type="submit" value="switchpls" name="switchpls" class="topbutton">Change theme</button></form>
<button class="topbutton"><a class="exportlink" href="{{ url_for('rawnotes') }}">Raw notes |</a></button>
</div>
<form action="." method="POST">
<input type="text" name="title" class="title" placeholder="Title"><br>
<textarea type="text" name="text" rows = "5" cols = "60*" class="text" placeholder="Text"></textarea><br>

20
src/templates/read.html Normal file
View File

@ -0,0 +1,20 @@
<html>
<head>
<link rel="stylesheet" href="{{ csslink }}" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!--<link href='https://fonts.googleapis.com/css?family=Source Sans Pro' rel='stylesheet'> -->
<title>sqnotes</title>
</head>
<body>
{{ note }}
</body>
<footer>
<hr>
<div class="notetime">
<p>
You've reached the bottom. Made by Squip, 2022.
</p>
</div>
</meta>
</html>

BIN
ssdark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
sslight.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB