machinatrix
A very silly Matrix bot written in C
Loading...
Searching...
No Matches
wikt.h
Go to the documentation of this file.
1
6#include <stdbool.h>
7
8#include "common.h"
9
10#include <tidy.h>
11
13#define WIKTIONARY_BASE "https://en.wiktionary.org/wiki"
14
16typedef struct {
18 TidyNode toc;
20 TidyNode contents;
21} wikt_page;
22
28bool wikt_parse_page(TidyDoc doc, wikt_page *p);
29
31TidyNode wikt_translation_head(TidyNode node);
32
34TidyNode wikt_translation_body(TidyNode node);
35
40bool wikt_next_section(const char *cls, const char *prefix, TidyNode *node);
41
46bool wikt_next_subsection(const char *cls, const char *prefix, TidyNode *node);
Relevant elements of a page.
Definition wikt.h:16
TidyNode contents
Main content element of the page.
Definition wikt.h:20
TidyNode toc
Table-of-contents element.
Definition wikt.h:18
bool wikt_parse_page(TidyDoc doc, wikt_page *p)
Finds the page elements.
Definition wikt.c:10
bool wikt_next_subsection(const char *cls, const char *prefix, TidyNode *node)
Advances node until the next subsection.
Definition wikt.c:74
bool wikt_next_section(const char *cls, const char *prefix, TidyNode *node)
Advances node until the next section.
Definition wikt.c:70
TidyNode wikt_translation_body(TidyNode node)
Finds the body of a translation element.
Definition wikt.c:29
TidyNode wikt_translation_head(TidyNode node)
Finds the header of a translation element.
Definition wikt.c:25