File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15+ #include " docfx/doxygen2toc.h"
16+ #include " docfx/doxygen_pages.h"
1517#include " docfx/parse_arguments.h"
18+ #include < fstream>
1619#include < iostream>
1720#include < stdexcept>
1821
1922int main (int argc, char * argv[]) try {
2023 auto config = docfx::ParseArguments ({argv, argv + argc});
24+ pugi::xml_document doc;
25+ auto load = doc.load_file (config.input_filename .c_str ());
26+ if (!load) throw std::runtime_error (" Error loading XML input file" );
27+
28+ std::ofstream (" toc.yml" ) << docfx::Doxygen2Toc (config, doc);
29+ for (auto const & i : doc.select_nodes (" //*[@kind='page']" )) {
30+ auto const & page = i.node ();
31+ auto const filename = std::string{page.attribute (" id" ).as_string ()} + " .md" ;
32+ std::ofstream (filename) << docfx::Page2Markdown (page);
33+ }
34+
2135 return 0 ;
2236} catch (std::exception const & ex) {
2337 std::cerr << " Standard exception thrown: " << ex.what () << " \n " ;
You can’t perform that action at this time.
0 commit comments