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

link generator: fixed leading colon [closes #72] #92

Closed
wants to merge 1 commit into from

Conversation

ondrakub
Copy link

No description provided.

@fprochazka
Copy link
Contributor

The link is always absolute. Wouldn't it be better to throw exceptions?

@janedbal
Copy link

@fprochazka Leading colon is not used for absolute URL, but for referencing different module.

@fprochazka
Copy link
Contributor

@janedbal I wrote "link" not a "URL". In presenters, you always write relative links, but there is no ../, so : exists and therefore you can write absolute links to module. In LinkGenerator, there are no relative links. Therefore makes no sense a syntax for absolute links - it's always absolute.

The question is.. should we ignore the colon for compatibility's sake, or forbit it because it makes no sense?

@Majkl578
Copy link
Contributor

This is pretty much the same as prefixing namespaces with \. Would you throw an exception for that or use ltrim?

@fprochazka
Copy link
Contributor

I'm not sure :) But compatibility with presenter's ->link() is pretty strong argument. I just wanned to raise the question.

@JanTvrdik
Copy link
Contributor

For compatibility with presenters you would need to NOT support links without the leading colon as the meaning may now be different.

I'm 👎 on this.

@hrach
Copy link
Contributor

hrach commented Sep 15, 2015

This is not about compatibility but usability. Neon also accepts FQN with the leading slash, although it requires FQN by design.

@ondrakub ondrakub changed the title link generator: fixed heading colon [closes #72] link generator: fixed leading colon [closes #72] Sep 15, 2015
@dg
Copy link
Member

dg commented Sep 15, 2015

Once someone asked me: what is the difference between {block #name} and {block name}? I replied that there is no difference. And he asked me „So why there are two ways to do one thing?“

There should be one-- and preferably only one --obvious way to do it. https://www.python.org/dev/peps/pep-0020/

@Majkl578
Copy link
Contributor

There should be one-- and preferably only one --obvious way to do it.

👍 But as with namespaces and FQCN \ prefix, even though leading \ does not make any sense e.g. in configuration, people are lazy and don't want to care, especially if the meaning is the same.

@hrach
Copy link
Contributor

hrach commented Sep 16, 2015

@dg

  • neon has two options; this is much more similar to the namespace case than to the block case.
  • if you are linking zen of python, you probably know, that you are breaking the second rule: "Explicit is better than implicit.".

@JanTvrdik
Copy link
Contributor

neon has two options

Maybe we should remove one.

@dg dg force-pushed the master branch 5 times, most recently from 8e097dc to e4eb640 Compare October 2, 2015 14:25
@dg dg force-pushed the master branch 2 times, most recently from 7f051bf to f87df33 Compare December 3, 2015 04:09
@dg dg force-pushed the master branch 2 times, most recently from 9725b1d to 9869e52 Compare January 13, 2016 18:03
@dg dg force-pushed the master branch 4 times, most recently from 18f376d to 3fe619f Compare January 22, 2016 03:07
@dg dg force-pushed the master branch 2 times, most recently from 20a93ca to 08cbdeb Compare February 8, 2016 13:39
@dg dg closed this Feb 29, 2016
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 this pull request may close these issues.

None yet

7 participants