lapis icon indicating copy to clipboard operation
lapis copied to clipboard

Lack of simple yet complete exemples.

Open ghost opened this issue 7 years ago • 10 comments

The framework does have indeed a good documentation, but... I mean, it's really hard to get used to it, even after reading the documentation. Even better than guides, simple examples would provide a much easier adaptation. For example, a simple blog working with sessions.

The mysql documentation does not show an exemple either, so is the db connection escaped? I mean, does it works like PDO prepare (verbatim)?

ghost avatar Feb 22 '17 00:02 ghost

What kind of examples besides a blog would you want? I'm totally up for working on such examples as practice and to learn the framework better.

TangentFoxy avatar Feb 22 '17 02:02 TangentFoxy

Thank you. I would be grateful if you could write a simple login system using sessions, since I couldn't get it. You don't really have to write a entire blog example, I'm just wondering how files are separated (best practices guideline). For example, app.lua + posts.lua + pages.lua (?).

ghost avatar Feb 22 '17 13:02 ghost

We could borrow some inspiration from Flask. The Flask tutorial has you build an example app from scratch. Perhaps a Lapis tutorial could do the same? The screencast that Leafo put up on their YouTube channel is good, but it's outdated by a few years.

slice avatar Feb 22 '17 22:02 slice

I second that, the Flask tutorial looks really interesting.

ghost avatar Feb 22 '17 23:02 ghost

Streak.club code base is good for examples.

honewatson avatar Feb 23 '17 07:02 honewatson

I second this. Lapis has good documentation for the basic stuff, but users are pretty much left to themselves with anything more complex than that, and figuring out all that stuff takes time.

DarkWiiPlayer avatar Mar 02 '17 14:03 DarkWiiPlayer

@sliceofcode Can you link to that video? Maybe it'll give me an idea for what should be covered.

TangentFoxy avatar Mar 04 '17 06:03 TangentFoxy

I agree with @honewatson that streak.club is a spectacular example. Streak.club would really benefit from code annotations like how underscore does it. Apparently it uses docco although for this usecase it would be more fitting that the lua-flavored locco is used. Would anyone be interested in an idea like this happening?

In retrospect a moonscript-based docco doesn't currently exist and I think that would be a major disqualifier for this idea :\

n3k0lai avatar Jun 23 '17 19:06 n3k0lai

@CatLover91 locco is cool though I also like this style of inline documentation using Markdown:

https://github.com/alexanderGugel/jdi

Shouldn't be too hard to create something for moonscript. I have already started creating some comments in anticipation of creating something like jdi for moonscript at some stage.

-- ## Confirm Anonymous Variable
-- 
-- Check if anonymous value exists.  If it doesn't assign anonymous property with false
check_anonymous = (user) ->
  unless user.anonymous
    user.anonymous = false
  user

honewatson avatar Jun 28 '17 22:06 honewatson

@honewatson I am willing to come up with some kind of hosting and a tld to stand up something like this. I think the lapis community would really benefit from more resources and it would help distribute some of the weight of providing documentation off @leafo's shoulders.

n3k0lai avatar Jun 29 '17 13:06 n3k0lai