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

Broken links in some .org files #4399

Closed
xfq opened this issue Jan 5, 2016 · 47 comments
Closed

Broken links in some .org files #4399

xfq opened this issue Jan 5, 2016 · 47 comments

Comments

@xfq
Copy link
Contributor

xfq commented Jan 5, 2016

The TOC links in the following files are broken (404):

I think the broken links were introduced in 13c5b1d (Nov 2, 2015).

PS: the TOC links in https://github.com/syl20bnr/spacemacs/blob/master/CONTRIBUTING.org are not broken.


Update: Not only TOC links, but most (if not all) internal links.

@syl20bnr
Copy link
Owner

syl20bnr commented Jan 5, 2016

This is a known issue and we have yet to find a solution for this.

@TheBB
Copy link
Collaborator

TheBB commented Jan 5, 2016

I thought we landed on wontfix for this, and to have http://spacemacs.org be the "official" way to view documentation online.

@StreakyCobra
Copy link
Contributor

I thought we landed on wontfix for this, and to have http://spacemacs.org be the "official" way to view documentation online.

We landed on this yes, but imho this is not a viable long-term solution. Search engines are indexing those pages, some users read the documentation on github, some users use the github search box to find information in the project, etc.

@robbyoconnor
Copy link
Contributor

Add the wont fix label :D

@StreakyCobra
Copy link
Contributor

Nah, we need a better solution. Discussing with @TheBB recently we were seeing a potential solution to have links working everywhere, but we are both kind of busy those days.

@louwers
Copy link

louwers commented Jan 21, 2016

Add a custom id to every header and link to those like so:

* Spacemacs documentation                                   :TOC_4_org:noexport:
 - [[#core-pillars][Core Pillars]]
   - [[#mnemonic][Mnemonic]]
   - [[#discoverable][Discoverable]]
   - [[#consistent][Consistent]]
   - [[#crowd-configured][Crowd-Configured]]
 - [[#highlighted-feature][Highlighted feature]]
 - [[#screenshots][Screenshots]]
 - [[#who-can-benefit-from-this][Who can benefit from this?]]

Then it works from org-mode (export) and on GitHub.

It is not optimal I have to admit.

@TheBB
Copy link
Collaborator

TheBB commented Jan 21, 2016

Yeah, those drawers become an eyesore when reading from within Emacs.

@louwers
Copy link

louwers commented Jan 21, 2016

By the way, if you want people to read the documentation on http://spacemacs.org you could at least link to that from the README.

@xfq
Copy link
Contributor Author

xfq commented Jan 22, 2016

@louwers I submitted a PR (#4737) for that just now.

@JAremko
Copy link
Collaborator

JAremko commented Jan 26, 2016

Came across this issues. Absolutely had to use my favorite Emacs feature #4811

@TheBB
Copy link
Collaborator

TheBB commented Feb 10, 2016

Never mind exporting. I can't even find a way to make a link to a heading in another file work well across github and Emacs.

I really, really, really don't want to spend my time working on this. Are we so sure this is a blocker? I can't see any solutions that are not going to be very flimsy.

@TheBB
Copy link
Collaborator

TheBB commented Feb 10, 2016

And no, I'm pretty sure the links we had that pointed to specific headings in other files were already broken in the previous versions.

@JAremko
Copy link
Collaborator

JAremko commented Mar 3, 2016

So this is my plan how to fix it:

  • Try stupid stuff
  • Try even more stupid stuff
  • Understand that the stupid stuff is stupid and try to come up with something less stupid
  • Come up with a bold plan:
    Instead of trying to shoehorn some kind of insanity into the org files or Spacemacs to make .org stuff almost work both on GitHub and in the Spacemacs - with all kind of ugliness like # everywhere or broken links here and there - we can simply fix the org files for GitHub when they are on GitHub and for Spacemacs when they are in Spacemacs! With all kind of benefits.
    TODO:

@syl20bnr I need a feedback before I spent all of my free time on this 😄

@a13ph
Copy link

a13ph commented Mar 5, 2016

Or to toc-org, if that's the issue 😮

@JAremko
Copy link
Collaborator

JAremko commented Mar 5, 2016

@a13ph Well. GitHub can't allow all kind of symbols in URLs so the fix will be some kind of band-Aid in js that will probably move it too far away from how markdown works. Or they will have to sanitize TOC on their end i.e. changing user's content. It will be too much hassle and will take ages to push trough. Or it will be simply rejected because it's up to users to submit properly formatted content.

@JAremko
Copy link
Collaborator

JAremko commented Mar 5, 2016

Also the solution for handling links in Spacmacs relies on some specific stuff like that the local files will start with https://github.com/syl20bnr/spacemacs/ and then we can rewrite them (or redirect via hooks) to the local copies and open them in the org mode.

@a13ph
Copy link

a13ph commented Mar 5, 2016

I'm unsure, but isn't this relevant? snosov1/toc-org#3

@a13ph
Copy link

a13ph commented Mar 5, 2016

Those hooks and specific stuff - it's an ugly hack, IMO. If it can be done cleanly - fine.

But i'm not sure we are the only ones with this issue and it wouldn't hurt to ask those who are responsible even if we do pursue workarounds.

Kinda strange not even opening an issue, considering where we are and who this issue is with.

@JAremko
Copy link
Collaborator

JAremko commented Mar 5, 2016

Kinda strange not even opening an issue, considering where we are and who this issue is with.

I'm not sure if GitHub has an issue(nor that it's not opened 😄 ). links like #foo/bar are working. And you can use them to link other documents. Sure it doesn't provide all of org utilities like text links with a search and stuff, but it is the cost of being in the web environment. It will be hard to make them do something about it.

Those hooks and specific stuff - it's an ugly hack, IMO. If it can be done cleanly - fine.

I also think that it's a bit meh. We probably could handle it without the magic by simply formatting(removing github fixes and making links local) org files when they are opened. But we can go with toc-org if syl20bnr says so.

I need to write some tests and dig into the link magic.

@JAremko
Copy link
Collaborator

JAremko commented Mar 7, 2016

Created a pull request snosov1/toc-org/pull/13 it should make toc-org more reliable(or, knowing me, somehow in someway broken 😄 )

@JAremko
Copy link
Collaborator

JAremko commented Mar 13, 2016

I'm halfway there. It will be epic PR. I only hope not too epic 😄

Also I have found a surprisingly reasonably way to make it all work with the site.

So far it looks like we can fix all the links. Even links to headings in different files.

@a13ph
Copy link

a13ph commented Mar 18, 2016

@JAremko thanks, I think this will make reading docs much more tolerable [at least for me!] if all links work (less mental load than jumping or searching through whole file)

@JAremko
Copy link
Collaborator

JAremko commented Mar 19, 2016

Looks like tomorrow is the day :shipit:

@JAremko
Copy link
Collaborator

JAremko commented Mar 20, 2016

Here it is... #5545

@d12frosted
Copy link
Collaborator

Fixed with released of Spacemacs v0.200. Let us know if you still have any problems with this issue.

@alphapapa
Copy link

FYI, if this is still relevant, you may find this useful in generating tables of contents more flexibly: https://github.com/alphapapa/org-make-toc

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

No branches or pull requests

10 participants