diff --git a/_tools/pdocs/.gitignore b/_tools/pdocs/.gitignore new file mode 100644 index 0000000..cb12c8c --- /dev/null +++ b/_tools/pdocs/.gitignore @@ -0,0 +1,3 @@ + +www/ +.import/ diff --git a/_tools/pdocs/Main.tscn b/_tools/pdocs/Main.tscn new file mode 100644 index 0000000..7707580 --- /dev/null +++ b/_tools/pdocs/Main.tscn @@ -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 ) diff --git a/_tools/pdocs/WebRoot.gd b/_tools/pdocs/WebRoot.gd new file mode 100644 index 0000000..0731bd2 --- /dev/null +++ b/_tools/pdocs/WebRoot.gd @@ -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() diff --git a/_tools/pdocs/default_env.tres b/_tools/pdocs/default_env.tres new file mode 100644 index 0000000..8419635 --- /dev/null +++ b/_tools/pdocs/default_env.tres @@ -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 ) diff --git a/_tools/pdocs/icon.png b/_tools/pdocs/icon.png new file mode 100644 index 0000000..5eaa3d1 Binary files /dev/null and b/_tools/pdocs/icon.png differ diff --git a/_tools/pdocs/icon.png.import b/_tools/pdocs/icon.png.import new file mode 100644 index 0000000..a4c02e6 --- /dev/null +++ b/_tools/pdocs/icon.png.import @@ -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 diff --git a/_tools/pdocs/project.pandemonium b/_tools/pdocs/project.pandemonium new file mode 100644 index 0000000..3e0a7db --- /dev/null +++ b/_tools/pdocs/project.pandemonium @@ -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"