Set up simple host test project.

This commit is contained in:
Relintai 2024-05-04 14:54:07 +02:00
parent 736177dcac
commit 177e63e383
7 changed files with 134 additions and 0 deletions

3
_tools/pdocs/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
www/
.import/

30
_tools/pdocs/Main.tscn Normal file
View File

@ -0,0 +1,30 @@
[gd_scene load_steps=2 format=3]
[ext_resource path="res://WebRoot.gd" type="Script" id=1]
[node name="Main" type="Node"]
[node name="PanelContainer" type="PanelContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
[node name="CC" type="CenterContainer" parent="PanelContainer"]
margin_left = 7.0
margin_top = 7.0
margin_right = 1017.0
margin_bottom = 593.0
[node name="LinkButton" type="LinkButton" parent="PanelContainer/CC"]
margin_left = 437.0
margin_top = 286.0
margin_right = 573.0
margin_bottom = 300.0
text = "http://127.0.0.1:8080"
uri = "http://127.0.0.1:8080"
[node name="WebServerSimple" type="WebServerSimple" parent="."]
start_on_ready = true
[node name="WebRoot" type="WebRoot" parent="WebServerSimple"]
www_root_path = "res://www/"
script = ExtResource( 1 )

34
_tools/pdocs/WebRoot.gd Normal file
View File

@ -0,0 +1,34 @@
extends WebRoot
var markdown_renderer : MarkdownRenderer = null
func serve_md(request: WebServerRequest) -> void:
var path : String = request.get_path_full()
var fabs : String = www_root_file_cache.wwwroot_get_file_abspath(path)
if fabs == "":
request.send_error(HTTPServerEnums.HTTP_STATUS_CODE_404_NOT_FOUND)
return
var f : File = File.new()
if f.open(fabs, File.READ) != OK:
request.send_error(HTTPServerEnums.HTTP_STATUS_CODE_404_NOT_FOUND)
return
request.body += markdown_renderer.render(f.get_as_text())
f.close()
request.compile_and_send_body()
func _handle_request_main(request: WebServerRequest) -> void:
if request.get_path_full().ends_with(".md"):
serve_md(request)
return
._handle_request_main(request)
func _ready() -> void:
markdown_renderer = MarkdownRenderer.new()

View File

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

BIN
_tools/pdocs/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 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="Pandemonium Docs"
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"