Use :: instead of ; for navbar (less conflicts). And update readme.
This commit is contained in:
parent
87bace72a1
commit
1f7ea6a327
24
README.md
24
README.md
@ -2,7 +2,7 @@
|
||||
Generates simple webpages.
|
||||
|
||||
# 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:
|
||||
```
|
||||
**Example**
|
||||
@ -10,21 +10,17 @@ Generates simple webpages.
|
||||
<p>Hello world</p>
|
||||
**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:
|
||||
```
|
||||
<p>**Hello world**<p>
|
||||
```
|
||||
will display as bold.
|
||||
Line before HTML code must be a single character `>` and HTML code below must be indented by 2 spaces.
|
||||
|
||||
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
|
||||
About;About.page
|
||||
External Site;https://example.com
|
||||
Dropdown;#|
|
||||
Site 1;https://example1.com
|
||||
Site 2;https://example2.com
|
||||
FAQ;FAQ.page
|
||||
Home::Home.page
|
||||
About::About.page
|
||||
External Site::https://example.com
|
||||
Dropdown::#|
|
||||
Site 1::https://example1.com
|
||||
Site 2::https://example2.com
|
||||
FAQ::FAQ.page
|
||||
```
|
||||
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.
|
||||
|
||||
# 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)
|
||||
|
@ -1,6 +1,6 @@
|
||||
About;About.page
|
||||
Home;Home.page
|
||||
More;More.page|
|
||||
About;About.page
|
||||
Site 2;https://duckduckgo.com
|
||||
Site 3;https://duckduckgo.com
|
||||
About::About.page
|
||||
Home::Home.page
|
||||
More::More.page|
|
||||
About::About.page
|
||||
Site 2::https://duckduckgo.com
|
||||
Site 3::https://duckduckgo.com
|
||||
|
@ -30,8 +30,8 @@ def generateNavigationBar(lines, pagetitle):
|
||||
|
||||
#parse navigation bar (custom format)
|
||||
if not rawhtml:
|
||||
if ";" in line:
|
||||
title, link = line.split(";", 1)
|
||||
if "::" in line:
|
||||
title, link = line.split("::", 1)
|
||||
|
||||
if line.strip().endswith("|"):
|
||||
dropdown = True
|
||||
|
Loading…
Reference in New Issue
Block a user