Skip to content
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

增加markmap的配置选项 #55

Open
Tracked by #58
aornus opened this issue Nov 11, 2023 · 7 comments
Open
Tracked by #58

增加markmap的配置选项 #55

aornus opened this issue Nov 11, 2023 · 7 comments

Comments

@aornus
Copy link

aornus commented Nov 11, 2023

注意到在markmap文档里有配置选项,比如自定义颜色、层级、线条宽度、额外的css之类的,咱插件能否给个选项options,让使用者进行个性化配置呢?

@maxchang3
Copy link
Owner

maxchang3 commented Nov 11, 2023

JSON options 当前采取的 markmap-vew 版本并不支持。我想取舍一下是直接全部升级到最新的 markmap 还是引入新的 markmap-view 包,只在转换的时候使用 deriveOptions 函数转换为 markmapOptions。

@maxchang3 maxchang3 mentioned this issue Nov 14, 2023
4 tasks
@maxchang3
Copy link
Owner

maxchang3 commented Nov 19, 2023

先更新了一个 beta 版本,你可以测试一下~

pnpm i hexo-markmap@beta
hexo_markmap:
  katex: true
  prism: true
  userCDN:
    d3_js: https://cdn.staticfile.org/d3/6.7.0/d3.min.js
    hljs_css: https://cdn.staticfile.org/highlight.js/11.8.0/styles/default.min.css
    katex_css: https://cdn.staticfile.org/KaTeX/0.16.8/katex.min.css
  JSONOptions: "{'color': ['blue']}"

image

@aornus
Copy link
Author

aornus commented Nov 19, 2023

速度真快啊,我刚才安装后试了下,有两个消息反馈给你。好的是配置起作用了,坏的是但出现了undefined报错(会不会还是 #7 的问题呢?)

  "devDependencies": {
    "hexo-markmap": "1.3.0-beta.1"
  }

Screenshot_20231119_215809

@maxchang3
Copy link
Owner

maxchang3 commented Nov 19, 2023

markmap-view 的版本更新了,之前的 markmap 的 json 数据可能无法使用。请问你用没有 hexo clean 过?另外使用的 markdown 内容是什么呢?

@aornus
Copy link
Author

aornus commented Nov 19, 2023

是我的问题,配置选项没写全,现在一切正常了。

@maxchang3
Copy link
Owner

maxchang3 commented Nov 20, 2023

是我的问题,配置选项没写全,现在一切正常了。

「配置选项没写全」指的你是上面的配置么,正常来说留空的配置是会被补全的。我本机也是如上配置没问题。这可能也是一个潜在的 bug。

@cuipengfei
Copy link

```yaml
  JSONOptions: "{'color': ['blue']}"

这里的 JSONOptions: "{'color': ['blue']}" 是全局性的吗?

是否可以让每一段

{% markmap %}
{% endmarkmap %}

各自定义自己的options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants