mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-24 20:57:18 +01:00
55 lines
1.1 KiB
C++
55 lines
1.1 KiB
C++
#ifndef PAGED_ARTICLES_H
|
|
#define PAGED_ARTICLES_H
|
|
|
|
#include "core/ustring.h"
|
|
#include "core/vector.h"
|
|
|
|
#include "../../http/web_node.h"
|
|
|
|
// This class will load and process all md files from the folder set to it's folder property,
|
|
// and generate one page from them. TThe files are processed in alphabetical order.
|
|
|
|
// The generated HTML looks like:
|
|
|
|
// render_menu()
|
|
// <div class="article_list_entry">
|
|
// Contents of the first md file.
|
|
// </div>
|
|
// <div class="article_list_entry">
|
|
// Contents of the second md file.
|
|
// </div>
|
|
// ...
|
|
// </div>
|
|
|
|
class WebServerRequest;
|
|
|
|
class PagedArticles : public WebNode {
|
|
GDCLASS(PagedArticles, WebNode);
|
|
|
|
public:
|
|
String get_folder();
|
|
void set_folder(const String &val);
|
|
|
|
void _handle_request(Ref<WebServerRequest> request);
|
|
|
|
void _render_index(Ref<WebServerRequest> request);
|
|
void _render_preview(Ref<WebServerRequest> request);
|
|
|
|
void load();
|
|
void generate_index_page();
|
|
|
|
PagedArticles();
|
|
~PagedArticles();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
|
|
static void _bind_methods();
|
|
|
|
String _folder;
|
|
|
|
String _index_page;
|
|
};
|
|
|
|
#endif
|