File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,4 +9,29 @@ add_executable(aniparse-example-manga-parser
99
1010set_property (TARGET aniparse-example-manga-parser PROPERTY CXX_STANDARD 23)
1111
12- target_link_libraries (aniparse-example-manga-parser PRIVATE aniparse )
12+ target_link_libraries (aniparse-example-manga-parser PRIVATE aniparse )
13+
14+ # Parsing showcase: loads a saved HTML fixture (no network) and extracts data
15+ # via CSS selectors + JS/JSON. EXAMPLE_DATA_DIR points at the fixtures so the
16+ # binary finds them from any working directory.
17+ add_executable (aniparse-example-parse
18+ "${CMAKE_CURRENT_LIST_DIR } /example_parse.cpp"
19+ )
20+
21+ set_property (TARGET aniparse-example-parse PROPERTY CXX_STANDARD 23)
22+
23+ target_compile_definitions (aniparse-example-parse
24+ PRIVATE EXAMPLE_DATA_DIR= "${CMAKE_CURRENT_LIST_DIR } /data"
25+ )
26+
27+ target_link_libraries (aniparse-example-parse PRIVATE aniparse )
28+
29+ # Networking showcase: makes real HTTP requests through the curl-backed client
30+ # via request() / request_html() / request_json(). Needs network access.
31+ add_executable (aniparse-example-net
32+ "${CMAKE_CURRENT_LIST_DIR } /example_net.cpp"
33+ )
34+
35+ set_property (TARGET aniparse-example-net PROPERTY CXX_STANDARD 23)
36+
37+ target_link_libraries (aniparse-example-net PRIVATE aniparse )
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head > < title > Example Manga List</ title > </ head >
4+ < body >
5+ < div id ="content ">
6+ < div class ="card " data-id ="1 ">
7+ < a class ="card-link " href ="/manga/one-piece "> One Piece</ a >
8+ < div class ="tags ">
9+ < a class ="tag " href ="/tag/action "> Action</ a >
10+ < a class ="tag " href ="/tag/adventure "> Adventure</ a >
11+ </ div >
12+ < span class ="rating "> 9.2</ span >
13+ </ div >
14+ < div class ="card " data-id ="2 ">
15+ < a class ="card-link " href ="/manga/berserk "> Berserk</ a >
16+ < div class ="tags ">
17+ < a class ="tag " href ="/tag/dark-fantasy "> Dark Fantasy</ a >
18+ </ div >
19+ < span class ="rating "> 9.5</ span >
20+ </ div >
21+ </ div >
22+
23+ < script >
24+ // Real sites often ship gallery data as a JS array rather than markup.
25+ var gallery = [ 'https://cdn.example.com/1.jpg' , 'https://cdn.example.com/2.jpg' ] ;
26+ </ script >
27+ </ body >
28+ </ html >
You can’t perform that action at this time.
0 commit comments