luaprettydoc/luafile.py
def create_function(self, data: dict) -> None:
        """Creates a Function's markdown data"""

        __args = ", ".join(data["args"])

        __call = None
        __brief, __params = None, ""
        __notes, __returns = list(), ""

        __generate_function = True
        for comment in data["comments"]:
            if CommentTag.COMMENT_TAG_BRIEF in comment:
                if __brief is None:
                    __brief = get_tag_line(comment, 1)
            elif CommentTag.COMMENT_TAG_PARAM in comment:
                __params += self.handle_parameter_returns(comment)
            elif CommentTag.COMMENT_TAG_RETURN in comment:
                __returns += self.handle_parameter_returns(comment)
            elif CommentTag.COMMENT_TAG_NOTE in comment:
                __notes.append(self.handle_note(comment))
            elif CommentTag.COMMENT_TAG_DEFINE in comment:
                if __call is None:
                    __call = Templates.TEMPLATE_DEFINE.format(
                        get_tag_line(comment, 1))
            elif CommentTagSingle.COMMENT_TAG_SINGLE_EXCLUDE in comment:
                __generate_function = False

        if __generate_function:
            if __call is None:
                __call = Templates.TEMPLATE_FUNC.format(
                    source=data["source"], index=data["notation"],
                    name=data["name"], args=__args)

            self.buffer += __call

            if __brief is None:
                __brief = "No description available."

            self.buffer += Templates.TEMPLATE_FUNC_BRIEF.format(__brief)

            if __params:
                self.buffer += Templates.TEMPLATE_PARAMS.format(__params)

            if __returns:
                self.buffer += Templates.TEMPLATE_RETURNS.format(__returns)

            if __notes:
                __notes_joined = " ".join(__notes)
                self.buffer += Templates.TEMPLATE_NOTES.format(__notes_joined)

            self.buffer += Templates.TEMPLATE_ENDING
Creates a Function's markdown data
Creates a Function's markdown data
Creates a Function ' s markdown data
def create_function(self, data: dict) -> None:
        __args = ", ".join(data["args"])
        __call = None
        __brief, __params = None, ""
        __notes, __returns = list(), ""
        __generate_function = True
        for comment in data["comments"]:
            if CommentTag.COMMENT_TAG_BRIEF in comment:
                if __brief is None:
                    __brief = get_tag_line(comment, 1)
            elif CommentTag.COMMENT_TAG_PARAM in comment:
                __params += self.handle_parameter_returns(comment)
            elif CommentTag.COMMENT_TAG_RETURN in comment:
                __returns += self.handle_parameter_returns(comment)
            elif CommentTag.COMMENT_TAG_NOTE in comment:
                __notes.append(self.handle_note(comment))
            elif CommentTag.COMMENT_TAG_DEFINE in comment:
                if __call is None:
                    __call = Templates.TEMPLATE_DEFINE.format(
                        get_tag_line(comment, 1))
            elif CommentTagSingle.COMMENT_TAG_SINGLE_EXCLUDE in comment:
                __generate_function = False
        if __generate_function:
            if __call is None:
                __call = Templates.TEMPLATE_FUNC.format(
                    source=data["source"], index=data["notation"],
                    name=data["name"], args=__args)
            self.buffer += __call
            if __brief is None:
                __brief = "No description available."
            self.buffer += Templates.TEMPLATE_FUNC_BRIEF.format(__brief)
            if __params:
                self.buffer += Templates.TEMPLATE_PARAMS.format(__params)
            if __returns:
                self.buffer += Templates.TEMPLATE_RETURNS.format(__returns)
            if __notes:
                __notes_joined = " ".join(__notes)
                self.buffer += Templates.TEMPLATE_NOTES.format(__notes_joined)
            self.buffer += Templates.TEMPLATE_ENDING
def create_function ( self , data : dict ) -> None : __args = ", " . join ( data [ "args" ] ) __call = None __brief , __params = None , "" __notes , __returns = list ( ) , "" __generate_function = True for comment in data [ "comments" ] : if CommentTag . COMMENT_TAG_BRIEF in comment : if __brief is None : __brief = get_tag_line ( comment , 1 ) elif CommentTag . COMMENT_TAG_PARAM in comment : __params += self . handle_parameter_returns ( comment ) elif CommentTag . COMMENT_TAG_RETURN in comment : __returns += self . handle_parameter_returns ( comment ) elif CommentTag . COMMENT_TAG_NOTE in comment : __notes . append ( self . handle_note ( comment ) ) elif CommentTag . COMMENT_TAG_DEFINE in comment : if __call is None : __call = Templates . TEMPLATE_DEFINE . format ( get_tag_line ( comment , 1 ) ) elif CommentTagSingle . COMMENT_TAG_SINGLE_EXCLUDE in comment : __generate_function = False if __generate_function : if __call is None : __call = Templates . TEMPLATE_FUNC . format ( source = data [ "source" ] , index = data [ "notation" ] , name = data [ "name" ] , args = __args ) self . buffer += __call if __brief is None : __brief = "No description available." self . buffer += Templates . TEMPLATE_FUNC_BRIEF . format ( __brief ) if __params : self . buffer += Templates . TEMPLATE_PARAMS . format ( __params ) if __returns : self . buffer += Templates . TEMPLATE_RETURNS . format ( __returns ) if __notes : __notes_joined = " " . join ( __notes ) self . buffer += Templates . TEMPLATE_NOTES . format ( __notes_joined ) self . buffer += Templates . TEMPLATE_ENDING
Creates a Function's markdown data
Creates a Function ' s markdown data
"""Creates a Function's markdown data"""
self
data
dict