Added a paged article and a paged articles demo.

This commit is contained in:
Relintai 2023-06-14 16:23:16 +02:00
parent c9bb63e742
commit 3364b333c7
30 changed files with 447 additions and 0 deletions

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://WebServerSimple.gd" type="Script" id=1]
[node name="Main" type="Node"]
[node name="WebServerSimple" type="WebServerSimple" parent="."]
script = ExtResource( 1 )
[node name="PagedArticleWebPage" type="PagedArticleWebPage" parent="WebServerSimple"]
uri_segment = "/"
articles_folder = "res://article/"

View File

@ -0,0 +1,16 @@
extends WebServerSimple
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
start()
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass

View File

@ -0,0 +1,11 @@
# First page
## Gets rendered as proper markdown
First page content.
![IMage](article_img.png)

View File

@ -0,0 +1,12 @@
# Second page
## Gets rendered as proper markdown
Second page content.
![IMage](article_img.png)

View File

@ -0,0 +1,12 @@
# Third page
## Gets rendered as proper markdown
Third page content.
![IMage](article_img.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/article_img.png-64f7234b37c39150631b87bf861fe4b9.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://article/files/article_img.png"
dest_files=[ "res://.import/article_img.png-64f7234b37c39150631b87bf861fe4b9.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,16 @@
# This is a paged article summary page
summary.md
## Gets rendered as proper markdown
First page content.
Here's an image:
![Image](files/article_img.png)
[Start reading](01_page.md)

View File

@ -0,0 +1,7 @@
[gd_resource type="Environment3D" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

BIN
web/paged_article/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,25 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
[application]
config/name="Paged Article"
run/main_scene="res://Main.tscn"
config/icon="res://icon.png"
[physics]
common/enable_pause_aware_picking=true
[rendering]
vram_compression/import_etc=true
vram_compression/import_etc2=false
environment/default_environment="res://default_env.tres"

View File

@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://WebServerSimple.gd" type="Script" id=1]
[node name="Main" type="Node"]
[node name="WebServerSimple" type="WebServerSimple" parent="."]
script = ExtResource( 1 )
[node name="PagedArticlesWebPage" type="PagedArticlesWebPage" parent="WebServerSimple"]
folder = "res://articles/"

View File

@ -0,0 +1,16 @@
extends WebServerSimple
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
start()
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass

View File

@ -0,0 +1,11 @@
# First page
## Gets rendered as proper markdown
First page content.
![IMage](article_img.png)

View File

@ -0,0 +1,12 @@
# Second page
## Gets rendered as proper markdown
Second page content.
![IMage](article_img.png)

View File

@ -0,0 +1,12 @@
# Third page
## Gets rendered as proper markdown
Third page content.
![IMage](article_img.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/article_img.png-bb0705ec07e0bd0461041125c4ba874a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://articles/article1/files/article_img.png"
dest_files=[ "res://.import/article_img.png-bb0705ec07e0bd0461041125c4ba874a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,16 @@
# This is a paged article summary page
summary.md
## Gets rendered as proper markdown
First page content.
Here's an image:
![Image](files/article_img.png)
[Start reading](01_page.md)

View File

@ -0,0 +1,11 @@
# First page
## Gets rendered as proper markdown
First page content.
![IMage](article_img.png)

View File

@ -0,0 +1,12 @@
# Second page
## Gets rendered as proper markdown
Second page content.
![IMage](article_img.png)

View File

@ -0,0 +1,12 @@
# Third page
## Gets rendered as proper markdown
Third page content.
![IMage](article_img.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/article_img.png-3b736821a974ec63ea3a43a88f59890f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://articles/article2/files/article_img.png"
dest_files=[ "res://.import/article_img.png-3b736821a974ec63ea3a43a88f59890f.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,16 @@
# This is a paged article summary page
summary.md
## Gets rendered as proper markdown
First page content.
Here's an image:
![Image](files/article_img.png)
[Start reading](01_page.md)

View File

@ -0,0 +1,7 @@
[gd_resource type="Environment3D" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

BIN
web/paged_articles/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,25 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
[application]
config/name="Paged Article"
run/main_scene="res://Main.tscn"
config/icon="res://icon.png"
[physics]
common/enable_pause_aware_picking=true
[rendering]
vram_compression/import_etc=true
vram_compression/import_etc2=false
environment/default_environment="res://default_env.tres"