Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii committed Oct 17, 2023
1 parent ad6eaef commit 6ad24e6
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 43 deletions.
2 changes: 1 addition & 1 deletion bin/config_wasm
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ xrepo install -y $emsdk_pkg
var pkg_info = (xrepo fetch --json $emsdk_pkg | from-json)
var emsdk_path = $pkg_info[0][artifacts][installdir]

xmake config -p wasm --emsdk=$emsdk_path --yes -vD
xmake config -p wasm --emsdk=$emsdk_path --yes -vD --qt=$E:HOME/6.5.3/wasm_singlethread/
61 changes: 61 additions & 0 deletions src/Scheme/Plugins/glue_html.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
-------------------------------------------------------------------------------
--
-- MODULE : glue_html.lua
-- DESCRIPTION : Generating glue on HTML/MathML
-- COPYRIGHT : (C) 1999-2023 Joris van der Hoeven
-- 2023 jingkaimori
-- 2023 Darcy Shen
--
-- This software falls under the GNU general public license version 3 or later.
-- It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
-- in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.

function main()
return {
binding_object = "",
initializer_name = "initialize_glue_xml",
glues = {
{
scm_name = "parse-html",
cpp_name = "parse_html",
ret_type = "scheme_tree",
arg_list = {
"string"
}
},
{
scm_name = "clean-html",
cpp_name = "clean_html",
ret_type = "tree",
arg_list = {
"content"
}
},
{
scm_name = "upgrade-tmml",
cpp_name = "tmml_upgrade",
ret_type = "tree",
arg_list = {
"scheme_tree"
}
},
{
scm_name = "upgrade-mathml",
cpp_name = "upgrade_mathml",
ret_type = "tree",
arg_list = {
"content"
}
},
{
scm_name = "retrieve-mathjax",
cpp_name = "retrieve_mathjax",
ret_type = "tree",
arg_list = {
"int"
}
},
}
}
end

42 changes: 1 addition & 41 deletions src/Scheme/Plugins/glue_xml.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-------------------------------------------------------------------------------
--
-- MODULE : glue_xml.lua
-- DESCRIPTION : Generating glue on XML/HTML/MathML
-- DESCRIPTION : Generating glue on XML
-- COPYRIGHT : (C) 1999-2023 Joris van der Hoeven
-- 2023 jingkaimori
-- 2023 Darcy Shen
Expand Down Expand Up @@ -73,46 +73,6 @@ function main()
"string"
}
},
{
scm_name = "parse-html",
cpp_name = "parse_html",
ret_type = "scheme_tree",
arg_list = {
"string"
}
},
{
scm_name = "clean-html",
cpp_name = "clean_html",
ret_type = "tree",
arg_list = {
"content"
}
},
{
scm_name = "upgrade-tmml",
cpp_name = "tmml_upgrade",
ret_type = "tree",
arg_list = {
"scheme_tree"
}
},
{
scm_name = "upgrade-mathml",
cpp_name = "upgrade_mathml",
ret_type = "tree",
arg_list = {
"content"
}
},
{
scm_name = "retrieve-mathjax",
cpp_name = "retrieve_mathjax",
ret_type = "tree",
arg_list = {
"int"
}
},
}
}
end
10 changes: 9 additions & 1 deletion src/Scheme/Plugins/init_glue_plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
#include "Database/database.hpp"
#include "glue_tmdb.cpp"

#include "Html/html.hpp"
#include "Xml/xml.hpp"
#include "glue_xml.cpp"

#ifdef USE_PLUGIN_HTML
#include "Html/html.hpp"
#include "glue_html.cpp"
#endif

bool
use_plugin_updater () {
#ifdef USE_PLUGIN_SPARKLE
Expand Down Expand Up @@ -108,6 +112,10 @@ initialize_glue_plugins () {
initialize_glue_tmdb ();
initialize_glue_xml ();

#ifdef USE_PLUGIN_HTML
initialize_glue_html ();
#endif

#ifdef USE_PLUGIN_SPARKLE
initialize_glue_updater ();
#endif
Expand Down
1 change: 1 addition & 0 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ set_configvar("USE_PLUGIN_LATEX_PREVIEW", true)
set_configvar("USE_PLUGIN_TEX", true)
set_configvar("USE_PLUGIN_ISPELL", true)
set_configvar("USE_PLUGIN_SPARKLE", false)
set_configvar("USE_PLUGIN_HTML", true)
set_configvar("TM_DYNAMIC_LINKING", false)

if is_plat("mingw", "windows") then
Expand Down
1 change: 1 addition & 0 deletions xmake/code.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function add_target_code()
USE_PLUGIN_LATEX_PREVIEW = false,
USE_PLUGIN_TEX = false,
USE_PLUGIN_ISPELL = false,
USE_PLUGIN_HTML = false,
QTPIPES = is_plat("linux"),
USE_QT_PRINTER = is_plat("linux"),
NOMINMAX = is_plat("windows"),
Expand Down
1 change: 1 addition & 0 deletions xmake/draw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function add_target_draw()
USE_PLUGIN_TEX = false,
USE_PLUGIN_ISPELL = false,
USE_PLUGIN_SPARKLE = false,
USE_PLUGIN_HTML = false,
QTPIPES = is_plat("linux"),
USE_QT_PRINTER = is_plat("linux"),
NOMINMAX = is_plat("windows"),
Expand Down

0 comments on commit 6ad24e6

Please sign in to comment.