Skip to content

Commit

Permalink
Merge pull request #136 from abap34/feat/#135
Browse files Browse the repository at this point in the history
`md_to_html` のみを提供するように変更
  • Loading branch information
abap34 authored Jun 20, 2024
2 parents 1fd4702 + 1952741 commit 1cec61d
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions src/pyalmo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,11 @@
#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);
}


std::string md_to_json(std::string md_content) {
almo::Block ast = almo::parse_rest(split(md_content, "\n"));
return ast.to_json();
}


std::string md_to_dot(std::string md_content) {
almo::Block ast = almo::parse_rest(split(md_content, "\n"));
return ast.to_dot(true);
std::string md_to_html(std::vector<std::string> md_content, std::map<std::string, std::string> meta_data) {
almo::Markdown ast;
almo::MarkdownParser parser(md_content, meta_data);
parser.process(ast);
return ast.to_html();
}


Expand All @@ -28,10 +18,7 @@ namespace py = pybind11;
PYBIND11_MODULE(almo, m) {
m.doc() = "almo interface for python.";

m.def("md_to_html", &md_to_html, "md to html");
m.def("md_to_json", &md_to_json, "md to json");
m.def("md_to_dot", &md_to_dot, "md to dot");

m.def("md_to_html", &md_to_html, "Convert markdown to html.");

#ifdef VERSION_INFO
m.attr("__version__") = VERSION_INFO;
Expand Down

0 comments on commit 1cec61d

Please sign in to comment.