Use :: instead of ; for navbar (less conflicts). And update readme.

This commit is contained in:
Govindas 2022-09-06 15:05:08 +03:00
parent 87bace72a1
commit 1f7ea6a327
3 changed files with 18 additions and 22 deletions

View File

@ -2,7 +2,7 @@
Generates simple webpages. Generates simple webpages.
# How to use # How to use
1. Create a file with `.page` extension in the same directory as `generate.py`, the file name will be title of the page, for example: About.page 1. Create a file with `.page` extension, the file name will be title of the page, for example: `About Us.page`
2. Use markdown in the created file, it will be auto-converted to HTML. You can also use raw HTML in the file, with `>` symbol, like this: 2. Use markdown in the created file, it will be auto-converted to HTML. You can also use raw HTML in the file, with `>` symbol, like this:
``` ```
**Example** **Example**
@ -10,21 +10,17 @@ Generates simple webpages.
<p>Hello world</p> <p>Hello world</p>
**Back to just markdown** **Back to just markdown**
``` ```
Line before HTML code must be a single character `>` and HTML code below must be indented by 2 spaces. You can also use Markdown inside HTML, for example: Line before HTML code must be a single character `>` and HTML code below must be indented by 2 spaces.
```
<p>**Hello world**<p>
```
will display as bold.
3. (Optional) Create a file called `navbar` and/or `footer` to have a navigation bar/footer that is added to every generated page file. Example navbar file: (See example/resources/style.css for styling dropdown) 3. (Optional) Create a file called `navbar` and/or `footer` to have a navigation bar/footer that is added to every generated page file. Example navbar file: (See example/resources/style.css for styling dropdown)
``` ```
Home;Home.page Home::Home.page
About;About.page About::About.page
External Site;https://example.com External Site::https://example.com
Dropdown;#| Dropdown::#|
Site 1;https://example1.com Site 1::https://example1.com
Site 2;https://example2.com Site 2::https://example2.com
FAQ;FAQ.page FAQ::FAQ.page
``` ```
It also supports HTML, but HTML code will not be formatted as navigation bar automatically. It also supports HTML, but HTML code will not be formatted as navigation bar automatically.
@ -34,5 +30,5 @@ Note: folder name must be lowercase and spaces must be replaced with `-` charact
5. Run generate.py, it will generate output website files in `website-output` folder. 5. Run generate.py, it will generate output website files in `website-output` folder.
# To-do list # To-do list
- Re-think footer - Re-think footer (it works, but I'm unsure if it is flexible enough)
- Delete removed page files from website-output during next site generation (Last, to be done on release, so it doesn't disturb development) - Delete removed page files from website-output during next site generation (Last, to be done on release, so it doesn't disturb development)

View File

@ -1,6 +1,6 @@
About;About.page About::About.page
Home;Home.page Home::Home.page
More;More.page| More::More.page|
About;About.page About::About.page
Site 2;https://duckduckgo.com Site 2::https://duckduckgo.com
Site 3;https://duckduckgo.com Site 3::https://duckduckgo.com

View File

@ -30,8 +30,8 @@ def generateNavigationBar(lines, pagetitle):
#parse navigation bar (custom format) #parse navigation bar (custom format)
if not rawhtml: if not rawhtml:
if ";" in line: if "::" in line:
title, link = line.split(";", 1) title, link = line.split("::", 1)
if line.strip().endswith("|"): if line.strip().endswith("|"):
dropdown = True dropdown = True