Skip to content

Commit b9eda58

Browse files
committed
changed default file_type .txt -> .sswg. improved settings input parsing and added option for custom output folder. fixed css file getting recreated for each file instead of once. fixed copy code button on webkit(safari).
1 parent 4e16e1e commit b9eda58

File tree

5 files changed

+200
-173
lines changed

5 files changed

+200
-173
lines changed
Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,97 @@
1-
# left, bold, width 1000, size 5
2-
Simple Static Website Generator
3-
# size 1.5, normal
4-
5-
A Markdown inspired markup language.
6-
Converts the text files in a folder into web pages.
7-
Use the tags below to style it.
8-
9-
10-
## Installation
11-
12-
1) Install Python
13-
14-
2) Install sswg:
15-
16-
```
17-
pip install https://github.com/pokepetter/sswg/archive/refs/heads/master.zip
18-
```
19-
20-
## How to Run
21-
22-
cd into the folder where your text files are and run:
23-
24-
```
25-
python -m sswg
26-
```
27-
28-
29-
## Tags
30-
31-
```
32-
- # size 1.25
33-
- # width 900
34-
- # left, right, center
35-
- # normal, bold, bolder, lighter
36-
- # image imagename
37-
- # arial, times, helvetica, courier, verdana, tahoma, bookman, monospace
38-
- # background colorname
39-
- # code (start code block)
40-
- # text (end code block)
41-
- # insert some_file.txt
42-
- ## (create header with size 2)
43-
- ### (create header with size 3)
44-
- #### (create header with size 6)
45-
- [Button Name, https://pokepetter.github.io/sswg/]
46-
- [Button Name, https://pokepetter.github.io/sswg/, image_name.jpg] (big button)
47-
- [Button Name, header name]
48-
- # insert other_file.txt
49-
- # index other_file.text (creates links to all the headers(##) in the file)
50-
```
51-
52-
53-
## Style Override
54-
55-
Create a style.css file and it will get loaded automatically.
56-
This will style all the pages in the project.
57-
58-
To style a specific page, you can include the style inside < style > tags at
59-
the top of the document
60-
61-
## Example Website
62-
63-
```
64-
# center, bold, arial, size 5
65-
66-
ursina engine
67-
ʕ •ᴥ•ʔゝ□
68-
# size 1.25, bold
69-
--------------------------------------
70-
# normal
71-
pip install ursina
72-
# bold
73-
--------------------------------------
74-
75-
# left, width 900, size 2
76-
Powered by Python
77-
# normal, size 1
78-
79-
Lorem Ipsum sit dolor et amet.
80-
```
81-
82-
# image example_website.jpg
83-
84-
85-
## Made with sswg
86-
87-
https://www.ursinaengine.org/
88-
89-
https://pokepetter.github.io/sswg/
90-
91-
https://pokepetter.github.io/taptapir/website/sunsnake.html
92-
93-
94-
95-
(\_/)
96-
(>.<)
97-
(")_(")
1+
# left, bold, width 1000, size 5
2+
Simple Static Website Generator
3+
# size 1.5, normal
4+
5+
A Markdown inspired markup language.
6+
Converts the text files in a folder into web pages.
7+
Use the tags below to style it.
8+
9+
10+
## Installation
11+
12+
1) Install Python
13+
14+
2) Install sswg:
15+
16+
```
17+
pip install https://github.com/pokepetter/sswg/archive/refs/heads/master.zip
18+
```
19+
20+
## How to Run
21+
22+
cd into the folder where your text files are and run:
23+
24+
```
25+
python -m sswg
26+
```
27+
28+
29+
## Tags
30+
31+
```
32+
- # size 1.25
33+
- # width 900
34+
- # left, right, center
35+
- # normal, bold, bolder, lighter
36+
- # image imagename
37+
- # arial, times, helvetica, courier, verdana, tahoma, bookman, monospace
38+
- # background colorname
39+
- # code (start code block)
40+
- # text (end code block)
41+
- # insert some_file.txt
42+
- ## (create header with size 2)
43+
- ### (create header with size 3)
44+
- #### (create header with size 6)
45+
- [Button Name, https://pokepetter.github.io/sswg/]
46+
- [Button Name, https://pokepetter.github.io/sswg/, image_name.jpg] (big button)
47+
- [Button Name, header name]
48+
- # insert other_file.txt
49+
- # index other_file.text (creates links to all the headers(##) in the file)
50+
```
51+
52+
53+
## Style Override
54+
55+
Create a style.css file and it will get loaded automatically.
56+
This will style all the pages in the project.
57+
58+
To style a specific page, you can include the style inside < style > tags at
59+
the top of the document
60+
61+
## Example Website
62+
63+
```
64+
# center, bold, arial, size 5
65+
66+
ursina engine
67+
ʕ •ᴥ•ʔゝ□
68+
# size 1.25, bold
69+
--------------------------------------
70+
# normal
71+
pip install ursina
72+
# bold
73+
--------------------------------------
74+
75+
# left, width 900, size 2
76+
Powered by Python
77+
# normal, size 1
78+
79+
Lorem Ipsum sit dolor et amet.
80+
```
81+
82+
# image example_website.jpg
83+
84+
85+
## Made with sswg
86+
87+
https://www.ursinaengine.org/
88+
89+
https://pokepetter.github.io/sswg/
90+
91+
https://pokepetter.github.io/taptapir/website/sunsnake.html
92+
93+
94+
95+
(\_/)
96+
(>.<)
97+
(")_(")

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "sswg"
7+
version = "3.0.0"
8+
description = "A Simple Static Website Generator that converts a markdown inspired markup language into web pages."
9+
authors = [
10+
{name = "Petter Amland", email = "pokepetter@gmail.com"}
11+
]
12+
license = {text = "MIT"}
13+
keywords = ["website", "generator"]
14+
readme = "README.md"
15+
requires-python = ">=3.6"
16+
17+
[project.urls]
18+
Homepage = "https://github.com/pokepetter/sswg"

setup.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

sswg.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mark {background: #ccff99;}
1616
span {background-color: rgba(0, 0, 0, 0.55); padding: .1em; line-height: 1.35em;}
1717
img {max-width: 100%; vertical-align: top;}
1818
.code_block {background-color: whitesmoke; padding: 10px; margin: 0; position: relative; font-family: monospace; font-size: 20px; font-weight: normal; white-space: pre; overflow: auto; border-radius:4px; scrollbar-color:red;}
19-
.copy_code_button {position:absolute; right:10px; border:none; border-radius:5px; font-family:inherit; color:gray; user-select:none;}
19+
.copy_code_button {position:absolute; right:10px; border:none; border-radius:5px; font-family:inherit; color:gray; user-select:none; -webkit-user-select:none;}
2020
/* Hide scrollbar for Chrome, Safari and Opera */
2121
.code_block::-webkit-scrollbar {
2222
}

0 commit comments

Comments
 (0)