Skip to content
This repository has been archived by the owner on Nov 4, 2019. It is now read-only.

Wiki links should use relative addressing #14

Open
cabalamat opened this issue Dec 19, 2013 · 4 comments
Open

Wiki links should use relative addressing #14

cabalamat opened this issue Dec 19, 2013 · 4 comments

Comments

@cabalamat
Copy link

Consider if I am in page [[foo/bar]] and I add a link [[baz]]. This points to the page /baz.md not /foo/baz.md as I would prefer.

The advantage of relative addressing is that one could have a whole load of pages in a directory, all pointing to each other, and that directory can be moved anywhere in the wiki directory tree and it would still work.

@mblayman
Copy link
Owner

Good idea. To do this would require doing more checking during page rendering. Currently, rendering is very unintelligent. It takes whatever text is there and make a hyperlink out of it. Later, when the hyperlink is clicked, MarkWiki checks if the pages exist to determine whether to show it or show the create page view.

Your suggestion would require checking the existence of a page during rendering for this reason: if you add [[baz]] to your [[foo/bar]] page /baz.md already exists, did you mean [[baz]] or [[foo/baz]]?

The same kind of issue occurs when you want to create a new page. When you create a new [[biz]] link on [[foo/bar]], how does MarkWiki know if you wanted /biz.md or foo/biz.md?

I'll have to think about the implications to the modeling and user experience to see if there is a clean and consistent way to handle this. I'm open to suggestions.

@cabalamat
Copy link
Author

If you add [[baz]] to your [[foo/bar]] page /baz.md already exists, did you mean [[baz]] or [[foo/baz]]?

My intention is that [[baz]] inside [[foo/bar]] always means [[foo/baz]] and never [[baz]], even if [[baz]] already exists.

@mblayman
Copy link
Owner

ok, that seems like a reasonable answer for viewing. There is still the challenge for page creation. Any ideas for what that would look like?

One idea would be if that I add [[baz]] while I'm editing the foo/bar.md page, then the following create page could put foo/baz into the title by default and a user could delete foo/ if they meant a baz page at the root.

@cabalamat
Copy link
Author

then the following create page could put foo/baz into the title by default and a user could delete foo/ if they meant a baz page at the root.

That sounds sensible; I think that would be intuitive behaviour.

It also might make sense if what you've called "title" was labelled "address" or "identifier" on the edit page since that's what it is. (While we're about talking names, "Create a Wiki" doesn't create a wiki, it creates a page in a wiki, and "Save Wiki" saves a page not a wiki so maybe those names should be changed).

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

No branches or pull requests

2 participants