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

The request for a better error message and better documentation #1398

Open
unnamed42 opened this issue Jan 3, 2018 · 2 comments
Open

The request for a better error message and better documentation #1398

unnamed42 opened this issue Jan 3, 2018 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@unnamed42
Copy link
Contributor

For feature request

I'm a plugin/theme author and I appreciate your excellent work on static blogging.

But I find that both usage and API doc hosted on https://hexo.io are very unclear. Due to the dynamic-typed nature of Javascript, I can find little useful information on listed API function signature without being fully documented: I have no idea what argument I should pass, what type this variable is, what property this argument has, what I should return in callback.

Also the examples provided by doc are trivial and not very helpful. I have to dig into source code or program with the power of console.log, to get it work.

As for the error output, once I did something wrong I can only get an exception with little useful message thrown from a deeeeeeeeeep Promise async call stack. If the error occurs in post rendering I can get some feedback like which line of which file (sometimes not), but I can only get unknown error if error occurs in script/plugin execution.

Probably I'm not able to improve error log, but I'm glad to help improving the docs. Where can I start?

中文版:
我是一个Hexo的主题和插件作者,非常感谢你们打造的博客系统。

但是我在深入的使用中发现了文档的一些问题,比如使用说明和API写的非常不清楚。由于Javascript是一门动态类型语言,所以如果不在文档中详细写明的话,从API的函数签名中我是基本找不到任何有用信息的:不知道该传入什么,不知道类型是什么,不知道属性有哪些,不知道回调该返回什么。

除此之外文档给出的例子也是,太简单,起不到什么作用。这时候就只能深入发掘源码,或者是基于console.log编程。

至于错误输出,只要一步做错了就只能得到抛出来的异常,一长串的调用栈,基本没有用的错误信息。如果错误是发生在帖子渲染阶段,我倒是能得到是哪个文件第几行的错误输出(也不是总有);如果错误发生在脚本/插件执行阶段,就只能得到一个unknown error

错误输出我可能是帮不了什么,不过我是很愿意帮助改进文档的。请问该从哪里开始?

@NoahDragon
Copy link
Member

Thanks for your contribution to Hexo. As Hexo is based on the warehouse, many data type could be found from its doc https://hexo.io/warehouse/ (also not fully documented, but better than nothing).

@Krakob also has made changes on Hexo doc (#510) to add data type, e.g. https://hexo.io/docs/variables.html . You probably could follow the pattern and start from there.

Hope this could help.

@stevenjoezhang stevenjoezhang transferred this issue from hexojs/hexo Apr 27, 2020
@SukkaW SukkaW added the documentation Improvements or additions to documentation label Apr 27, 2020
@DeepSpaceHarbor
Copy link
Contributor

What helped me was reading the source code of different themes, plugins and the published types from DefinitelyTyped.

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/hexo/index.d.ts

@uiolee uiolee pinned this issue Apr 19, 2024
@uiolee uiolee unpinned this issue Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants