From 5b162311283d4906b1dde34f6af946776a6c637a Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 21 Aug 2022 23:04:56 +0200 Subject: [PATCH] Added docs for FolderServeWebPage, and BrowsableFolderServeWebPage. --- .../doc_classes/BrowsableFolderServeWebPage.xml | 15 +++++++++++++++ modules/web/doc_classes/FolderServeWebPage.xml | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/modules/web/doc_classes/BrowsableFolderServeWebPage.xml b/modules/web/doc_classes/BrowsableFolderServeWebPage.xml index b01e2593a..39b2558dc 100644 --- a/modules/web/doc_classes/BrowsableFolderServeWebPage.xml +++ b/modules/web/doc_classes/BrowsableFolderServeWebPage.xml @@ -1,8 +1,22 @@ + The [BrowsableFolderServeWebPage] class adds folder listing functionality on top of [FolderServeWebPage]. + The [BrowsableFolderServeWebPage] class adds folder listing functionality on top of [FolderServeWebPage]. Fundamentally it's the same as the Apache webserver's directory listing. + As an example let's take this folder: + [code]content_folder/ + -- ct/ + ---- ctf.jpg + -- file1.md + -- test.jpg[/code] + A [FolderServeWebPage] is pointed to the [code]content_folder[/code] folder, it's set as a child of a [WebRoot], and it's uri segment is [code]served_files[/code]: + [code]Opening: http://127.0.0.1/served_files will send a generated html directory listing. + Opening: http://127.0.0.1/served_files/file1.md will send page1.md. + Opening: http://127.0.0.1/served_files/test.jpg will send page2.md. + Opening: http://127.0.0.1/served_files/ct will send a generated html directory listing. + Opening: http://127.0.0.1/served_files/ct/ctf.jpg will send ctf.jpg.[/code] @@ -10,6 +24,7 @@ + Whether to call [code]render_menu()[/code] when a directory listing is returned. diff --git a/modules/web/doc_classes/FolderServeWebPage.xml b/modules/web/doc_classes/FolderServeWebPage.xml index d985f923c..208b65580 100644 --- a/modules/web/doc_classes/FolderServeWebPage.xml +++ b/modules/web/doc_classes/FolderServeWebPage.xml @@ -1,8 +1,22 @@ + The [FolderServeWebPage] class serves files. + The [FolderServeWebPage] class just serves files found in [code]serve_folder[/code], and it's subfolders. If a file does not exists, it sends a 404 error. + As an example let's take this folder: + [code]content_folder/ + -- ct/ + ---- ctf.jpg + -- file1.md + -- test.jpg[/code] + A [FolderServeWebPage] is pointed to the [code]content_folder[/code] folder, it's set as a child of a [WebRoot], and it's uri segment is [code]served_files[/code]: + [code]Opening: http://127.0.0.1/served_files will send a 404 error. + Opening: http://127.0.0.1/served_files/file1.md will send page1.md. + Opening: http://127.0.0.1/served_files/test.jpg will send page2.md. + Opening: http://127.0.0.1/served_files/ct will send a 404 error. + Opening: http://127.0.0.1/served_files/ct/ctf.jpg will send ctf.jpg.[/code] @@ -10,11 +24,13 @@ + Refresh the internal [FileCache]. + The folder that will get served.