zepinglee / citeproc-lua

A Lua implementation of the Citation Style Language (CSL)
MIT License
62 stars 7 forks source link

Refine the API #5

Closed zepinglee closed 2 years ago

zepinglee commented 2 years ago

I was new to Lua when starting project so I followed https://www.lua.org/pil/16.2.html to design the API: CiteProc:new() is used to create a new processor instance and citeproc.lua returns the class table. However the API looks bad after I read https://github.com/luarocks/lua-style-guide and http://hisham.hm/2014/01/02/how-to-write-lua-modules-in-a-post-module-world/. I decide to refactor the code to follow the LuaRocks style.

@michal-h21 do you have any suggestions?

michal-h21 commented 2 years ago

@zepinglee it sounds good, I think. Especially the fact that the module will be returned instead of the object itself.

zepinglee commented 2 years ago

@zepinglee it sounds good, I think. Especially the fact that the module will be returned instead of the object itself.

Thanks! I've finished most of this work.