-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在macos下有办法使用吗? #42
Comments
@obgnail |
尝试了在 index.html 里插入代码改变样式,是生效的,所以是可以改的 <script type="text/javascript" defer>
setTimeout(() => {
const plains = [...document.getElementsByClassName('md-plain')]
plains.map(x => x.style.color = 'red')
}, 1000)
</script> 只是现有的插件代码与 Mac Typora 所用的 WebKit 不兼容,特别是用到了 NodeJS 的库的相关代码,部分插件在小修的情况下应该是可以用的。 const Package = {
Path: reqnode("path"),
Fs: reqnode("fs"),
ChildProcess: reqnode('child_process'),
}; 目前我对 |
@willbchang |
目前是支持Mac端了么? @obgnail |
@obgnail 主力机器是mac,目前能支持了吗 |
@obgnail 我试了下,Typora for Mac 似乎没有办法直接访问 Node API,它甚至有可能不基于 Node. Typora 官方仅提到了 Linux / Windows 版本基于 Electron,而未明确提及 Typora for Mac 使用的技术。在 Typora for Mac 的 Developer Tool 终端里, 如果事情确实符合我的猜测的话,要兼容 macOS, |
期待mac +1 |
提供一个思路,macOS 下暴露了一个全局函数 /**
* 运行 Shell 命令(仅在 macOS 下有效)
*/
const runShellCommand = (command, options) => {
const { cwd } = options ?? {};
return new Promise((resolve, reject) => {
window.bridge.callHandler(
"controller.runCommand",
{ args: command, ...(cwd ? { cwd } : {}) },
([success, stdout, stderr, command]) => {
if (success) resolve(stdout);
else reject(stderr);
},
);
});
};
const nodeVersion = await runShellCommand("node -v"); 如果有一些 Node 库实在没法 Polyfill,可以要求用户安装 Node,然后通过命令行调用 Node,或者后台通过命令行调用 Node 起个服务器,用 WebSocket 去通信😂. 目测兼容 macOS 的工作量很大。如果有人感兴趣可以照这个思路做下去。 另外在 macOS 下模块问题肯定没办法解决,Typora for mac 是不支持 CommonJS 的 require 的,预计要打包成 iife 才能正常使用。我有个项目采用了这种思路以兼容 Typora for macOS,用 Rollup 把项目打包成 iife 单文件,可以参考一下里边的思路:https://github.com/Snowfly-T/typora-copilot |
我木有环境呀,咋整 😂 |
喜欢这个插件,没有windows,同求 mac + 1 |
|
为此插件+1,希望尽早能够解决。 |
+1,真心希望在 macOS 上也能用上这么强大的插件。 |
+1,官方repo的增加vim mode的issue 16年就提出来了(typora/typora-issues#187) ,不知道为什么一直没解决... |
Windows上是会用了,mac谷歌也没搜到有用的插件怎么安装的教程。主力还是用mac的,可以的话求指点一二
The text was updated successfully, but these errors were encountered: