Skip to content

Commit

Permalink
本体と共有ライブラリを別に生成できるように分割
Browse files Browse the repository at this point in the history
  • Loading branch information
abap34 committed May 17, 2024
1 parent 23a857c commit 8d9530f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/almo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
#include <string>
#include "utils.hpp"

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace py = pybind11;

class Config {
public:
std::string template_file = "__default__";
Expand Down Expand Up @@ -179,14 +174,3 @@ int main(int argc, char* argv[]) {
return 0;
}

std::string md_to_html(std::string md_content, std::map<std::string, std::string> meta_data) {
almo::Block ast = almo::parse_rest(split(md_content, "\n"));
return ast.render(meta_data);
}


PYBIND11_MODULE(almo, m) {
m.doc() = "almo library";

m.def("md_to_html", &md_to_html, "md to html");
}
18 changes: 18 additions & 0 deletions src/pyalmo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "almo.cpp"


std::string md_to_html(std::string md_content, std::map<std::string, std::string> meta_data) {
almo::Block ast = almo::parse_rest(split(md_content, "\n"));
return ast.render(meta_data);
}

namespace py = pybind11;

PYBIND11_MODULE(almo, m) {
m.doc() = "almo library";

m.def("md_to_html", &md_to_html, "md to html");
}

0 comments on commit 8d9530f

Please sign in to comment.