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

Links #7

Open
pablomayobre opened this issue May 5, 2015 · 3 comments
Open

Links #7

pablomayobre opened this issue May 5, 2015 · 3 comments

Comments

@pablomayobre
Copy link
Collaborator

As discussed in the forum thread, having local links pointing to other sections of the doc would be nice, also having external links wouldnt hurt either. I would love to work on this feature, just wanted to know what format should we use for the links.

I was thinking that maybe using

`local link`

to enclose the text would be nice for local links and something like markdown []() syntax for external links.

What do you say?

Also there should be a method to get the url for a link (parse the text?), and a method to completely unformat the text (delete the characters [](), ` and links in order to make it clearer)

@pablomayobre
Copy link
Collaborator Author

Other option would be to use tables, but I'm not really sure about that

description = {
    "This is the description of some function and it has some wild",
    {text="links.", url="https://www.love2d.org/"},
    "It can also have links that redirect to functions like:",
    {text="love.filesystem.getDirectoryItems", function={"filesystem","getDirectoryItems"}}
}

This makes the function pretty simple though:

function (description)
    result = ""
    for i=1, #description do
        if type(description[i]) == "string" then
            result = result .. " " .. description[i] --Not sure about the space there
        else
            result = result .. " " .. description[i].text
        end
    end
    return result
end

@rm-code
Copy link
Collaborator

rm-code commented Sep 3, 2015

Adding urls from the wiki would be nice for docs too.

                {
                    name = 'getContactFilter',
                    description = 'Returns the function for collision filtering.',
                    url = 'https://love2d.org/wiki/World:getContactFilter',
                    variants = {
                        {
                            returns = {
                                {
                                    type = 'function',
                                    name = 'contactFilter',
                                    description = 'The function that handles the contact filtering.'
                                }
                            }
                        }
                    }
                },

@hahawoo
Copy link
Contributor

hahawoo commented Aug 19, 2017

I added automatic linking to functions and types to the reference generator code, you can see the output here: http://love2d-community.github.io/love-api/test/#Body_getLinearVelocity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants