rcpp_framework/web_modules/paged_article/paged_articles.h

50 lines
1004 B
C
Raw Permalink Normal View History

2022-02-05 02:45:53 +01:00
#ifndef PAGED_ARTICLES_H
#define PAGED_ARTICLES_H
#include "core/containers/vector.h"
#include "core/string.h"
2022-02-05 16:55:07 +01:00
#include "web/file_cache.h"
#include "web/http/web_node.h"
2022-02-05 02:45:53 +01:00
#include "web/http/request.h"
2022-02-05 02:45:53 +01:00
2022-02-15 00:00:50 +01:00
// 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>
2022-02-05 02:45:53 +01:00
class PagedArticles : public WebNode {
RCPP_OBJECT(PagedArticles, WebNode);
public:
void _handle_request_main(Request *request);
void render_index(Request *request);
2022-02-14 23:20:47 +01:00
void render_preview(Request *request);
2022-02-05 02:45:53 +01:00
void load();
void generate_index_page();
2022-02-05 02:45:53 +01:00
void _notification(const int what);
PagedArticles();
~PagedArticles();
String folder;
protected:
String index_page;
2022-02-05 02:45:53 +01:00
};
#endif