MCPcopy Create free account
hub / github.com/docling-project/docling-parse / create_config

Function create_config

app/parse.cpp:74–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74nlohmann::json create_config(std::filesystem::path ifile,
75 std::filesystem::path ofile,
76 std::optional<std::vector<int>> pages=std::nullopt,
77 std::filesystem::path pdf_resource_dir="../docling_parse/pdf_resources/")
78{
79 nlohmann::json config = nlohmann::json::object({});
80
81 auto data = nlohmann::json::object({});
82 data["pdf-resource-directory"] = pdf_resource_dir;
83
84 auto tasks = nlohmann::json::array({});
85 {
86 auto task = nlohmann::json::object({});
87 task["filename"] = ifile;
88
89 if(ofile.string()!="")
90 {
91 task["output"] = ofile;
92 }
93
94 if(pages.has_value())
95 {
96 task["page-numbers"] = *pages;
97 }
98
99 tasks.push_back(task);
100 }
101
102 config["data"] = data;
103 config["files"] = tasks;
104
105 return config;
106}
107
108int main(int argc, char* argv[]) {
109 int orig_argc = argc;

Callers 1

mainFunction · 0.85

Calls 1

push_backMethod · 0.45

Tested by

no test coverage detected