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

Proposal: Link Definition and Disambiguation #122

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Explain autocompletion entry format
  • Loading branch information
jevakallio committed Jul 15, 2020
commit 11c65d7bda63d4a29303b32ba3617ebe53720150
2 changes: 2 additions & 0 deletions docs/proposal-link-definition-and-disambiguation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
Let's say we have two documents in the workspace with the same title "Some Title"

- We would have autocompletion base on title of the document
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could autocomplete always be done with a combination of title and file path within the workspace - in a style of "My title - foo/bar/my-title.md"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Added this now.

- Each autocompletion entry could be in format:
**Document title** - *path/to/document.md*
- This generates a link (typically a title, but could also have e.g. `:2` to disambiguate multiple links in the same file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would prefer the local links to use style [[foo/bar/my-title]] - would this be configurable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jojanaho, to clarify, do you mean you prefer foo/bar/my-title for just the disambiguated links in case of title conflicts, or always?

It could be configurable, since it's an arbitrary label. Options could include:

  • file-name.md
  • Title Cased File Name
  • Document Title
  • Arbitrary Label you write yourself

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always, since in my case it would improve readability - e.g [[book-summaries/war-and-peace]]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And to be exact, we have the freedom for arbitrary labels only when link ref defs are in use :)

- The label doesn't matter, it could be used as a display label. We'll just auto-generate something sensible. Could even be a user setting.
- They would look like this:
Expand Down