koreader-base icon indicating copy to clipboard operation
koreader-base copied to clipboard

KOPTContext - add comments explaining Leptonica's usage

Open Galunid opened this issue 4 years ago β€’ 4 comments

Work in progress, the idea is to document what I learned so far, so that others interested in this stuff don't have to rediscover America again ;-). For now I'm adding a cheatsheet, with Leptonica's most common functions we use and short explanation how it's used/what it's used for. Later I'll try to add documentation to a few functions. @poire-z Is something like this acceptable? I'm open to suggestions.


This change is Reviewable

Galunid avatar Sep 17 '20 21:09 Galunid

Yep! That kind of doc is great! (I would usually be happy to see that around where it's used, but I guess it's used all over the place, so this cheatsheet :)

I know now about PIX, BOX and SEL, but I don't know (yet) which is usually the input and which are the output, etc... A small intro about what k2pdfopt and leptonica are and do (why we need both, how they interoperate...) would be nice too. (Because really, I have no idea :) I guess what k2pdfopt can do for having used the Windows app, but that's it...)

poire-z avatar Sep 17 '20 21:09 poire-z

image @Frenzie Any advice on how to format this? I can't annotate those functions, since they are part of leptonica and not koptcontext

Galunid avatar Sep 18 '20 12:09 Galunid

Looks pretty good for starters? ^_^

Frenzie avatar Sep 18 '20 15:09 Frenzie

I'd like to hold it for a while, I'll try to work on this soon. It wraps lines strangely and it just looks bad.

Galunid avatar Nov 13 '20 02:11 Galunid

Oh wow, I just realized this is still not merged πŸ˜…. I'll work on this on Monday hopefully.

Galunid avatar May 03 '24 18:05 Galunid

Note to self: make doc is the command.

This looks way better, I'll probably have to move comments above functions, since we are limited to ~80 characters, otherwise ldoc adds vertical scroll. image

Galunid avatar May 06 '24 16:05 Galunid

This is the other version, I'm not sure which is preferred? image

Galunid avatar May 06 '24 19:05 Galunid

Maybe both? By the side for the short ones like all the destroys, and above for the ones that'd have to be split across so many lines?

Frenzie avatar May 06 '24 19:05 Frenzie

Here's the hybrid image

Galunid avatar May 06 '24 20:05 Galunid

I think that's the best of both πŸ‘

Frenzie avatar May 06 '24 20:05 Frenzie

Yup, I think it's good to go, unless someone feels like something needs to be reworded, explained more clearly. I'm open to criticism.

On an unrelated note, I think it's a good idea to block directly pushing to main repos. After this is merged koptcontext-comments branch needs to be deleted ;) It took me a while to figure out why my commits weren't showing πŸ˜…

Galunid avatar May 06 '24 20:05 Galunid

On an unrelated note, I think it's a good idea to block directly pushing to main repos. After this is merged koptcontext-comments branch needs to be deleted ;)

The master branch is protected from direct pushing to prevent mistakes. Besides that I don't think we're particularly concerned, or at least I don't think it's ever really been an issue. :-)

Frenzie avatar May 06 '24 20:05 Frenzie