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

Mastodon documentation has a lot of broken links #764

Closed
GroovinChip opened this issue Apr 9, 2020 · 8 comments · Fixed by #801
Closed

Mastodon documentation has a lot of broken links #764

GroovinChip opened this issue Apr 9, 2020 · 8 comments · Fixed by #801

Comments

@GroovinChip
Copy link
Contributor

#763 touches on this a little bit but it goes beyond broken library links.

Many pages have links to pages that don't exist. It seems that at some point the url naming scheme was changed but the documentation was never updated to reflect that.

Example:
https://docs.joinmastodon.org/entities/account/ has a link to the accounts endpoint at the bottom of the page. That link, and others like it, generally seem to be correct. On the other hand, https://docs.joinmastodon.org/entities/activity/ has a "see also" section which points to https://docs.joinmastodon.org/entities/methods/instance/#weekly-activity, which does not exist.

I am happy to help improve the docs if there isn't enough bandwidth on the tootsuite team to do so.

@GroovinChip
Copy link
Contributor Author

There are also many endpoints that are missing JSON response examples. /api/v1/accounts/:id/statuses is one of them. See https://docs.joinmastodon.org/methods/accounts/.

@aschrijver
Copy link

Just wanted to add that in ActivityPub page, the links to Security page are broken.

The markdown doc activitypub.md however does link well to security.md (page does exist).

@trwnh
Copy link
Member

trwnh commented Jun 14, 2020

so there's a few things going on here...

it was all working fine in gitbook.com where it was originally composed, but after importing back to hugo, there are two competing formats for references:

  • just linking directly to the .md files, which works on github but not in the compiled docs
  • hugo's internal relref, which works in the compiled docs but not on github

i know for a fact that other static site generators like vuepress will just rewrite the .md into a .html on compilation, but for some reason hugo doesn't seem to do this... so there's two options as i see it

  1. change everything to plain markdown links, but add a rewrite rule on the server to rewrite .md out of urls?
  2. change everything to relrefs, and accept that the github repo will have all links broken, as well as being less portable to other static site generators

fwiw this is all i can find on hugo's end... seemingly they supported markdown links at one point, but deprecated it? gohugoio/hugo#1921

@nightpool
Copy link
Member

I think the right move forward here is to make sure the links work correctly on docs.joinmastodon.org—if they work on github as well, that's a bonus, but i'd expect people looking at the documentation on github to understand that they're not getting the full experience and that they may be missing some interactivity, like links.

@trwnh
Copy link
Member

trwnh commented Jun 18, 2020

oof, then someone needs to go through and change everything to a relref... 😬 most of the existing links are in markdown flavor.

@nightpool
Copy link
Member

hmm, then maybe an nginx rewrite rule would be feasible.... that would be in @Gargron's court though

@trwnh
Copy link
Member

trwnh commented Jun 23, 2020

one other thing i just realized is that the API method shortcodes don't generate anchors...

@e1mo
Copy link
Contributor

e1mo commented Jul 23, 2020

I ran linkchecker on https://docs.joinmastodon.org, the result is down below in this gist: https://gist.github.com/e1mo/a6eaeed48cd7a6f0c6d91361e77862f4.

Later on or during the next days I would set aside some time to fix these broken links. But I also agree with @nightpool that for backwards compatibility, some nginx redirects should be in place for the old urls.

e1mo added a commit to e1mo/documentation that referenced this issue Aug 10, 2020
As discussed in mastodon#764 there are quite a lot of outdated links in the
mastodon documentation. In basically all cases this was resolved by
simply wrapping the old plain markdown link in hugos `relref`
function[^0].

While quite a lot of links on the `/zh-cn/` also appear to be broken,
these can not be fixed by just wrapping them in `relref`[^0]. Those are
all links to `/spec/` subpages which are just not translated to `/zh-cn/`
version. Therefore, `/zh-cn/spec/` has been excluded from the automated
checking as described in the next section.

The page has been checked using the linkchecker[^1] utility. One process
is running `hugo serve` in order to see all changes in real time and
notice errors directly in your browser. In a separate command prompt the
command `linkchecker http:https://localhost:1313 --ignore-url=/zh-cn/spec` is
being fired up. Note the `--ignore-url=/zh-cn/spe` to exclude the just
not existing parts of the page as mentioned in the previous paragraph.

There still is some ToDo on the table since quite a lot of the anchors
appear to not be set or at least differ from previous versions. One
example: on `/client/authorized/` is a link to
`/client/token/#creating-our-application` while the id of referenced
heading is `app`. These changes **do not** fix those Issues as it would
require way more time.

[^0]: https://gohugo.io/functions/relref/
[^1]: https://github.com/linkchecker/linkchecker

Close mastodon#764
Gargron pushed a commit that referenced this issue Aug 10, 2020
As discussed in #764 there are quite a lot of outdated links in the
mastodon documentation. In basically all cases this was resolved by
simply wrapping the old plain markdown link in hugos `relref`
function[^0].

While quite a lot of links on the `/zh-cn/` also appear to be broken,
these can not be fixed by just wrapping them in `relref`[^0]. Those are
all links to `/spec/` subpages which are just not translated to `/zh-cn/`
version. Therefore, `/zh-cn/spec/` has been excluded from the automated
checking as described in the next section.

The page has been checked using the linkchecker[^1] utility. One process
is running `hugo serve` in order to see all changes in real time and
notice errors directly in your browser. In a separate command prompt the
command `linkchecker http:https://localhost:1313 --ignore-url=/zh-cn/spec` is
being fired up. Note the `--ignore-url=/zh-cn/spe` to exclude the just
not existing parts of the page as mentioned in the previous paragraph.

There still is some ToDo on the table since quite a lot of the anchors
appear to not be set or at least differ from previous versions. One
example: on `/client/authorized/` is a link to
`/client/token/#creating-our-application` while the id of referenced
heading is `app`. These changes **do not** fix those Issues as it would
require way more time.

[^0]: https://gohugo.io/functions/relref/
[^1]: https://github.com/linkchecker/linkchecker

Close #764
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

Successfully merging a pull request may close this issue.

5 participants