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

[需求请求] 文档名作为文件名称 #26

Closed
UniploreLJL opened this issue Oct 17, 2022 · 7 comments · Fixed by #27
Closed

[需求请求] 文档名作为文件名称 #26

UniploreLJL opened this issue Oct 17, 2022 · 7 comments · Fixed by #27

Comments

@UniploreLJL
Copy link

作者您好:
该工具目前有一个小缺陷是:1) 文档名会变成一级标题位于文档第一行;2) 文档中的有序列表未连续编号。其他都是准确的。3)markdown的文档名称是一串编码,是否可让markdown的文档的命名与原本的文档命名相同。
由于这个工具对我们团队现在的工作很有帮助,我们团队恳请您帮助我们针对上述三个问题对feishu2md做一些修改,我们团队将会聊表心意。

@Wsine Wsine changed the title 小缺陷 [需求请求] 文档名作为文件名称 Oct 18, 2022
@Wsine Wsine closed this as completed in #27 Oct 24, 2022
@willdla
Copy link

willdla commented Mar 22, 2023

@Wsine 作者您好,想请教一下 这个特性如何启用
试了好几个命令行参数都不能启用..
./feishu2md config TitleAsFilename
./feishu2md config TitleAsFilename=true
./feishu2md config --TitleAsFilename true
./feishu2md config --titleAsFilename=true

@Wsine
Copy link
Owner

Wsine commented Mar 22, 2023

@willdla 你需要手动修改配置文件中的配置项。


配置文件路径参考

生成的配置文件路径为:

Windows: %AppData%/feishu2md/config.json

Linux: $XDG_CONFIG_HOME/feishu2md/config.json

Mac: $XDG_CONFIG_HOME/feishu2md/config.json

如无配置 XDG_CONFIG_HOME 环境变量,则默认为 ~/.config 目录。


相关配置项为 TitleAsFilename 默认为 false,可根据需求更改为 true

@willdla
Copy link

willdla commented Mar 24, 2023

@willdla 你需要手动修改配置文件中的配置项。

配置文件路径参考

生成的配置文件路径为:

Windows: %AppData%/feishu2md/config.json

Linux: $XDG_CONFIG_HOME/feishu2md/config.json

Mac: $XDG_CONFIG_HOME/feishu2md/config.json

如无配置 XDG_CONFIG_HOME 环境变量,则默认为 ~/.config 目录。

相关配置项为 TitleAsFilename 默认为 false,可根据需求更改为 true

image

找不到这个文件夹 o(╥﹏╥)o.. 是不是出现了异常

@Wsine
Copy link
Owner

Wsine commented Mar 24, 2023

@willdla 找到了,如果没有设置 XDG_CONFIG_HOME 环境变量的情况下,在 Mac 环境中,默认位置为 $HOME/Library/Application Support

https://pkg.go.dev/os#UserConfigDir:~:text=On%20Darwin%2C%20it%20returns%20%24HOME/Library/Application%20Support

因为根据你的情况大概为 $HOME/Library/Application Support/feishu2md/config.json

@willdla
Copy link

willdla commented Mar 25, 2023

找到了 对于我来说 是在 以下目录

/Users/meow/Library/Application\ Support/feishu2md

@chenrui333
Copy link

@willdla 找到了,如果没有设置 XDG_CONFIG_HOME 环境变量的情况下,在 Mac 环境中,默认位置为 $HOME/Library/Application Support

https://pkg.go.dev/os#UserConfigDir:~:text=On%20Darwin%2C%20it%20returns%20%24HOME/Library/Application%20Support

因为根据你的情况大概为 $HOME/Library/Application Support/feishu2md/config.json

即使 configure XDG_CONFIG_HOME, config 文件还是写到了

$ export XDG_CONFIG_HOME=/private/tmp/feishu2md-test-20230728-6640-vsbtjg

$ feishu2md config --appId testAppId --appSecret testSecret
Configuration file on: $HOME/Library/Application Support/feishu2md/config.json
{
  "feishu": {
    "app_id": "testAppId",
    "app_secret": "testSecret"
  },
  "output": {
    "image_dir": "static",
    "title_as_filename": false
  }
}

@Wsine
Copy link
Owner

Wsine commented Jul 31, 2023

@chenrui333 这是一个独立的问题,建议新开一个 issue 来讨论,你也可以 refer 这个 issue 表明上文是从这里来的。

我初步看了一下,代码逻辑似乎没有问题,可能需要寻找 golang 团队一起解决。

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

Successfully merging a pull request may close this issue.

4 participants