diff --git a/README.md b/README.md index 5e4da0c..3fd8e21 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,22 @@ sorry i will write the readme later teh school is closing A small writing machine to experiment the list format. It's again web-to-print, it's again flask, it's again markdown, it's again it's again it's again. I'm 30% sorry. -## How to use +## Add your list + +Add a new file in the `txt` folder! The format is Markdown, so use the `.md` format. + +For example: + +```markdown +- Bread +- Milk +- ![A pic of eggs](img/eggs.jpg) +- Leek +``` + +Your list will appear in the homepage, using the filename as title. + +## How to develop - Clone the repo - Create a virtual environment @@ -18,4 +33,4 @@ A small writing machine to experiment the list format. It's again web-to-print, - Run the script - `python main.py` -It will open a browser window that renders the list from the `list.md` file. You can write there. Put your images in the `img` folder. +It will open a browser window that renders the files from the `txt` folder. You can put a new list in that directory. Put your images in the `img` folder. diff --git a/main.py b/main.py index e9a76a7..f478527 100644 --- a/main.py +++ b/main.py @@ -45,7 +45,7 @@ def list(slug): with open(f'txt/{slug}.md',"r") as f: text = f.read() list = markdown(text) - return render_template('list.html', list = list) + return render_template('list.html', slug=slug, list = list) @app.route('/img/') def send_img(file): diff --git a/static/style.css b/static/style.css index 0b65478..bafefc9 100644 --- a/static/style.css +++ b/static/style.css @@ -84,3 +84,12 @@ code { color: currentColor; text-transform: capitalize; } + +.git { + position: absolute; + color: currentColor; + font-size: 1rem; + background-color: white; + top: 1rem; + right: 1rem; +} diff --git a/templates/home.html b/templates/home.html index 4c48e17..50fd28c 100644 --- a/templates/home.html +++ b/templates/home.html @@ -5,13 +5,16 @@ - list list + wlist

List of lists

+ git diff --git a/templates/list.html b/templates/list.html index 0943da9..e35b238 100644 --- a/templates/list.html +++ b/templates/list.html @@ -4,7 +4,7 @@ - The list + {{slug}}