huacnlee / autocorrect

A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean).
https://huacnlee.github.io/autocorrect
MIT License
896 stars 31 forks source link

增加对notebook的支持 #121

Closed yangtzech closed 1 year ago

yangtzech commented 1 year ago

VSCode 插件现在对 VSCode Notebook 中 markdown 不支持,如果可以的话,希望能增加对 Notebook 的支持

yangtzech commented 1 year ago

感谢作者的支持,但是使用时好像有bug

def test_installation():
    try:
        import filterpy
    except:
        print("请通过运行命令来安装FilterPy:\n\t$ pip install filterpy\n有关说明,请参见《附录A-安装》。")

在python .py文件中会有错误提示: image

但将同样的文字放在.ipynb中就不会有提示 1)放在代码框中;2)放在Markdown中 image

huacnlee commented 1 year ago

因为 Notebook 目前仅处理了 Markdown 的部分

yangtzech commented 1 year ago

因为 Notebook 目前仅处理了 Markdown 的部分

即使放置在Markdown的cell中也不会有提示 image

huacnlee commented 1 year ago

不是。

在 Markdown 里面得是 Markdown 格式才能处理,直接的代码 AutoCorrect 可能会错误识别。你可以看看测试文件:

https://github.com/huacnlee/autocorrect/blob/main/autocorrect/tests/fixtures/jupyter.ipynb

yangtzech @.***>于2023年1月28日 周六下午5:55写道:

因为 Notebook 目前仅处理了 Markdown 的部分

即使放置在Markdown的cell中也不会有提示 [image: image] https://user-images.githubusercontent.com/41911522/215259957-f92687f3-3876-4d32-84db-9073f08af452.png

— Reply to this email directly, view it on GitHub https://github.com/huacnlee/autocorrect/issues/121#issuecomment-1407362386, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABLDS4FDJDMKLD5OACDMDWUTUJVANCNFSM6AAAAAAS4BE57I . You are receiving this because you modified the open/close state.Message ID: @.***>

yangtzech commented 1 year ago

测试文件中好像也不起作用,但将同样的内容复制到Markdown中插件可以起作用

jupyter.ipynb

image

jupyter.md image

huacnlee commented 1 year ago

应该是 VS Code 这个 Jupyter Notebook 预览模式的问题。

你试试 CLI 里面检查

yangtzech @.***>于2023年1月28日 周六下午8:40写道:

测试文件中好像也不起作用,但将同样的内容复制到Markdown中插件可以起作用

jupyter.ipynb

[image: image] https://user-images.githubusercontent.com/41911522/215266334-67bf243f-b9a4-4cc4-bbb1-df612c3cd895.png

jupyter.md [image: image] https://user-images.githubusercontent.com/41911522/215266418-fe674b6b-deb1-4cc7-8280-4c4214543498.png

— Reply to this email directly, view it on GitHub https://github.com/huacnlee/autocorrect/issues/121#issuecomment-1407390574, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABLDU5DCTKKSMCD6JJPKLWUUHSJANCNFSM6AAAAAAS4BE57I . You are receiving this because you modified the open/close state.Message ID: @.***>

yangtzech commented 1 year ago

通过cli检查没问题,多谢