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

Type links are invalid #38

Closed
eproxus opened this issue Dec 5, 2022 · 12 comments
Closed

Type links are invalid #38

eproxus opened this issue Dec 5, 2022 · 12 comments

Comments

@eproxus
Copy link

eproxus commented Dec 5, 2022

When using the {@type mytype()} syntax, a link is generated to #type-mytype but the ExDoc equivalent should be #t:mytype/0 it seems.

@paulo-ferraz-oliveira
Copy link
Collaborator

paulo-ferraz-oliveira commented Aug 15, 2023

@eproxus, I'm not sure this is dealt with by the plugin. I also have a similar issue when using {@link ...}. I'm not sure this is an ex_doc issue, tbh. Maybe @starbelly knows best if this is from the chunk generation, or something else (?)

@paulo-ferraz-oliveira
Copy link
Collaborator

@starbelly, tested this again, and, as-is, this throws an exception with ex_doc but generates a proper link with EDoc.

@starbelly
Copy link
Owner

I will take a gander.

@paulo-ferraz-oliveira
Copy link
Collaborator

Yeah, I'm also setting this up to see if it's easily fixable next to ex_doc.

@starbelly
Copy link
Owner

@paulo-ferraz-oliveira An example would be good, it works for me, but @eproxus is referencing a form with curly brackets, which I'm not familar with. Also, edoc complains saying @type is deprecated btw.

@paulo-ferraz-oliveira
Copy link
Collaborator

Yeah, I can't get all of EDoc to work as per its documentation either.

The form @eproxus is mentioning is indeed deprecated, but still supported by EDoc...

@starbelly
Copy link
Owner

Technically speaking @type period is deprecated AFAIK. The {@type {option, thing()@}} I could only find used in edoc itself and two places in epp_dodger. Its use seems limited to when you have a property list for options, but maybe there's other uses for it? A tad off subject from the fact that it can cause a crash, but still interesting and all simply a "FWIW".

@paulo-ferraz-oliveira
Copy link
Collaborator

Yeah, I'll let you decide on this one. If the ex_doc fix lands maybe we can close this, unless @eproxus is interested in writing some tests cases for which we'd need to see the code pass 😉

@paulo-ferraz-oliveira
Copy link
Collaborator

paulo-ferraz-oliveira commented Oct 5, 2023

The pull request mentioned above was merged. No further changes regarding {@type ...} are expected. I don't think that this addresses your issue, but ex_doc's maintainers preferred a simpler solution (simply not crash).

I referred "Links are not usable, because generated HTML..." and ultimate we got "I'd strip out the <a> and just leave <code> but it definitely doesn't hurt to keep it this way for now."

@paulo-ferraz-oliveira
Copy link
Collaborator

The mentioned pull request is already merged, tagged, released (ex_doc) and imported and released here (rebar3_ex_doc). Closing...

@eproxus
Copy link
Author

eproxus commented Oct 18, 2023

Didn't exactly understand what was said here. What would the alternative to {@type ...} be to achieve type links using EDoc + the ex_doc plugin?

@paulo-ferraz-oliveira
Copy link
Collaborator

paulo-ferraz-oliveira commented Oct 18, 2023

@eproxus, there is no alternative, as of this moment.

ex_doc (via the pull request) didn't accept that valid links were generated: elixir-lang/ex_doc#1787 (comment) (here's the test I wrote to make sure generation created at least "a" link, and that's what was accepted).

So I don't think that, at least now, the plugin can move much more forward on this.

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