This is a demo project showcasing how to use the html-parser
library in a C++ project. The html-parser
library allows you to parse HTML files in your C applications.
Please note the -fpermissive
flag that needs to be compiled with to allow the 'unsafe' C-casts in the html-parser
. Moreover, I am constructing the memory arena manually instead of using the utility, flo_html_createArena
. Dependent on your C++ guidelines, the casts used in the library may or may not be permitted in your project.
Follow these steps to set up and run the demo project:
-
Clone the Repository: Clone this repository to your project folder using the following command:
git clone https://github.com/florianmarkusse/html-parser-demo-cpp.git
-
Install CMake: Ensure that you have CMake installed on your system. If not, you can find installation instructions here.
-
Download the
html-parser
Library: Navigate to thehtml-parser-demo-cpp
folder and create alibs
directory. Then, clone thehtml-parser
library in the new folder:mkdir libs cd libs git clone https://github.com/florianmarkusse/html-parser.git
-
Build the
html-parser
Library:Build the
html-parser
library based on your platform. Use the appropriate method below:-
For All Operating Systems:
cd html-parser cmake -S . -B build/ -D CMAKE_BUILD_TYPE="Release" -D BUILD_SHARED_LIBS="false" -D BUILD_TESTS="false" -D BUILD_BENCHMARKS="false" cmake --build build/
-
For Linux or macOS: If you are on Linux or macOS, you can use the provided
build.sh
script. Run the script with the-h
flag to view all available build options:./build.sh
-
-
Build the Demo Project:
Build the demo project located in the
html-parser-demo-cpp
folder. Use the following commands based on your operating system:- For All Operating Systems:
cd ../.. cmake -S . -B build/ -D CMAKE_BUILD_TYPE="Release" cmake --build build/
- For All Operating Systems:
-
Run the Demo Project:
Execute the demo project in the
html-parser-demo-cpp
folder with the following command:build/html-parser-demo-cpp-Release
If you encounter any challenges or have suggestions related to the functionalities provided by this library, please do not hesitate to:
- Open an issue, or;
- Open a PR.
This project is licensed under the MIT License. See the LICENSE file for details.