Git Product home page Git Product logo

Comments (8)

miracleyoo avatar miracleyoo commented on September 5, 2024

请问您方便把您在转换的droplet.md文件邮箱传一份吗?根据错误信息来看应该是某个公式被错误解析了,具体需要看文件内容而定。若有隐私顾虑,您可以将文件文字内容全部换成随机字符。谢谢!

from markdown4zhihu.

q1anzhen avatar q1anzhen commented on September 5, 2024

你好,我觉得不是我自己markdown的问题,因为我测试你Data里的测试文档,也是有同样的问题。
$ python3 zhihu-publisher.py --input="./Data/一个测试文档.md" {'encoding': 'utf-8', 'confidence': 0.99, 'language': ''} Traceback (most recent call last): File "zhihu-publisher.py", line 123, in <module> process_for_zhihu() File "zhihu-publisher.py", line 35, in process_for_zhihu lines = image_ops(lines) File "zhihu-publisher.py", line 73, in image_ops _lines = re.sub(r'<img src="(.*?)"',functools.partial(rename_image_ref, original=False), _lines) File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 192, in sub return _compile(pattern, flags).sub(repl, string, count) File "zhihu-publisher.py", line 50, in rename_image_ref if os.path.getsize(image_folder_path.parent/m.group(1+int(original)))>COMPRESS_THRESHOLD: File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/genericpath.py", line 50, in getsize return os.stat(filename).st_size FileNotFoundError: [Errno 2] No such file or directory: 'Data/https:/www.zhihu.com/equation?tex=Sum=\\sum_{i=0}^{n}{\\sqrt{x_i^2+y_i^2}}'
不知道是不是我python版本的问题。

from markdown4zhihu.

miracleyoo avatar miracleyoo commented on September 5, 2024

是我这边的问题。之前更新了一个模块功能但是会对链接式图片不兼容。刚才修复了这个问题,您可以再试试看。

from markdown4zhihu.

q1anzhen avatar q1anzhen commented on September 5, 2024

感谢你的更新,现在可以成功执行了。
我还是有一个问题和建议:

  1. 现在成功执行了后,也自动把相应的图片上传至Github/Data,但是在知乎编辑器里,它不能访问,显示是上传失败,也没有重新上传的按钮,我试了你的测试文档也有这样的问题。(不过图片重新上传一下倒是不累....)

  2. 我觉得现在产生知乎公式的格式可能有点问题,在md中行内公式和行间公式是有明显区分的($$与$),但我到知乎编辑器中发现生成的公式全部都是行间公式(知乎中似乎没有区分这两个),或者说我手动给几个换行符变成 ”行正确“ 的公式后,也存在着 ”行正确“ 公式没有居中的问题。
    如果要居中它也是可以,需要我再编辑一下,给公式结尾加上 ' \\' 换行,这一点往往是在md单行公式中没有加的。
    我认为这一点可以修改一下,把产生知乎公式格式调整一下,行间公式后面都补上 ' \\',使其在知乎编辑器中可以居中。

https://zhuanlan.zhihu.com/p/31188118

谢谢:)

from markdown4zhihu.

Magica-Chen avatar Magica-Chen commented on September 5, 2024

我这边直接运行这个例子也有些问题哈,不知道如何解决,能不能帮忙看看哈
(base) D:\Markdown4Zhihu>python zhihu-publisher.py --input="./Data/一个测试文档.md" {'encoding': 'utf-8', 'confidence': 0.99, 'language': ''} Traceback (most recent call last): File "zhihu-publisher.py", line 126, in <module> process_for_zhihu() File "zhihu-publisher.py", line 35, in process_for_zhihu lines = image_ops(lines) File "zhihu-publisher.py", line 76, in image_ops _lines = re.sub(r'<img src="(.*?)"',functools.partial(rename_image_ref, original=False), _lines) File "C:\Users\user\anaconda3\lib\re.py", line 192, in sub return _compile(pattern, flags).sub(repl, string, count) File "zhihu-publisher.py", line 51, in rename_image_ref if not (Path(image_folder_path.parent/m.group(1)).is_file() or Path(image_folder_path.parent/m.group(2)).is_file()): File "C:\Users\user\anaconda3\lib\site-packages\pathlib2\__init__.py", line 1663, in is_file return S_ISREG(self.stat().st_mode) File "C:\Users\user\anaconda3\lib\site-packages\pathlib2\__init__.py", line 1436, in stat return self._accessor.stat(self) File "C:\Users\user\anaconda3\lib\site-packages\pathlib2\__init__.py", line 585, in wrapped return strfunc(str(pathobj), *args) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'Data\\https:\\www.zhihu.com\\equation?tex=Sum=\\sum_{i=0}^{n}{\\sqrt{x_i^2+y_i^2}}'

from markdown4zhihu.

RshStone avatar RshStone commented on September 5, 2024

我这边直接运行这个例子也有些问题哈,不知道如何解决,能不能帮忙看看哈
(base) D:\Markdown4Zhihu>python zhihu-publisher.py --input="./Data/一个测试文档.md" {'encoding': 'utf-8', 'confidence': 0.99, 'language': ''} Traceback (most recent call last): File "zhihu-publisher.py", line 126, in <module> process_for_zhihu() File "zhihu-publisher.py", line 35, in process_for_zhihu lines = image_ops(lines) File "zhihu-publisher.py", line 76, in image_ops _lines = re.sub(r'<img src="(.*?)"',functools.partial(rename_image_ref, original=False), _lines) File "C:\Users\user\anaconda3\lib\re.py", line 192, in sub return _compile(pattern, flags).sub(repl, string, count) File "zhihu-publisher.py", line 51, in rename_image_ref if not (Path(image_folder_path.parent/m.group(1)).is_file() or Path(image_folder_path.parent/m.group(2)).is_file()): File "C:\Users\user\anaconda3\lib\site-packages\pathlib2\__init__.py", line 1663, in is_file return S_ISREG(self.stat().st_mode) File "C:\Users\user\anaconda3\lib\site-packages\pathlib2\__init__.py", line 1436, in stat return self._accessor.stat(self) File "C:\Users\user\anaconda3\lib\site-packages\pathlib2\__init__.py", line 585, in wrapped return strfunc(str(pathobj), *args) OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'Data\\https:\\www.zhihu.com\\equation?tex=Sum=\\sum_{i=0}^{n}{\\sqrt{x_i^2+y_i^2}}'

请问你解决了吗

from markdown4zhihu.

Pearlzju avatar Pearlzju commented on September 5, 2024

你好,我这边遇到这个问题,不知道如何解决,能否帮忙看下,感谢

(python3) ➜ /Users/shanglin/pearl/tool/Markdown4Zhihu git:(master) ✗ python zhihu-publisher.py --input="./Data/一个测试文档.md"
{'encoding': 'utf-8', 'confidence': 0.99, 'language': ''}
1 ('这里是一个测试图片', '一个测试文档/image-01.png')
2 False
1 ('https://www.zhihu.com/equation?tex=Sum=\\sum_{i=0}^{n}{\\sqrt{x_i^2+y_i^2}}',)
2 False
Traceback (most recent call last):
File "/Users/shanglin/pearl/tool/Markdown4Zhihu/zhihu-publisher.py", line 129, in
process_for_zhihu()
File "/Users/shanglin/pearl/tool/Markdown4Zhihu/zhihu-publisher.py", line 35, in process_for_zhihu
lines = image_ops(lines)
File "/Users/shanglin/pearl/tool/Markdown4Zhihu/zhihu-publisher.py", line 79, in image_ops
_lines = re.sub(r'<img src="(.*?)"',functools.partial(rename_image_ref, original=False), _lines)
File "/usr/local/Cellar/[email protected]/3.9.1_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 210, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "/Users/shanglin/pearl/tool/Markdown4Zhihu/zhihu-publisher.py", line 54, in rename_image_ref
if not (Path(image_folder_path.parent/m.group(1)).is_file() or Path(image_folder_path.parent/m.group(2)).is_file()):
IndexError: no such group

from markdown4zhihu.

SUNRISEFLY avatar SUNRISEFLY commented on September 5, 2024

@Pearlzju 我也遇到了相同的问题

from markdown4zhihu.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.