[fossil-users] how to link to other pages in the wiki, wiki-link syntax
Hi, Is there a syntax I can use to link from one wiki page to another? I can't find in either of these pages how to do it: http://fossil-scm.org/index.html/wiki_rules http://fossil-scm.org/index.html/md_rules I've tried the usual [[other wiki page]], OtherWikiPage, [other wiki page][], and so on, but the only thing I can get to work is to write out the link like so (in markdown): [other wiki page](/wiki?name=other+wiki+page) Is there a shorthand for that? Thanks, -- John ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Jan 25, 2016, at 12:37 PM, John Gabriele wrote: > > Is there a syntax I can use to link from one wiki page to another? It depends on the markup language you’ve selected for that page. >[other wiki page](/wiki?name=other+wiki+page) That will work just fine in a Markdown-formatted wiki page. For Fossil wiki, the same thing is spelled: [/wiki?name=other+wiki+page|other wiki page] and in HTML it is other wiki page ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Mon, Jan 25, 2016, at 02:56 PM, Warren Young wrote: > On Jan 25, 2016, at 12:37 PM, John Gabriele > wrote: > > > > Is there a syntax I can use to link from one wiki page to another? > > It depends on the markup language you’ve selected for that page. > > >[other wiki page](/wiki?name=other+wiki+page) > > That will work just fine in a Markdown-formatted wiki page. Ok, that may work well enough. Thanks, Warren! -- John ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On 1/25/16, Warren Young wrote: > For Fossil wiki, the same thing is spelled: > > [/wiki?name=other+wiki+page|other wiki page] > In the Fossil wiki it suffices to simply put the page name in [...]. For example: some text [other wiki page] more text -- D. Richard Hipp d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Mon, Jan 25, 2016, at 03:50 PM, Richard Hipp wrote: > On 1/25/16, Warren Young wrote: > > For Fossil wiki, the same thing is spelled: > > > > [/wiki?name=other+wiki+page|other wiki page] > > > > In the Fossil wiki it suffices to simply put the page name in [...]. > For example: > > some text [other wiki page] more text > Hm. I'm using "This is fossil version 1.34 [62dcb00e68] 2015-11-02 17:35:44 UTC" and that isn't working for me. It just renders as is (not as a link). This is when accessing the wiki via firefox (on Debian Testing) after running `fossil ui my-proj.fossil`. -- John ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On 1/25/16, John Gabriele wrote: > On Mon, Jan 25, 2016, at 03:50 PM, Richard Hipp wrote: >> On 1/25/16, Warren Young wrote: >> > For Fossil wiki, the same thing is spelled: >> > >> > [/wiki?name=other+wiki+page|other wiki page] >> > >> >> In the Fossil wiki it suffices to simply put the page name in [...]. >> For example: >> >> some text [other wiki page] more text >> > > Hm. I'm using > "This is fossil version 1.34 [62dcb00e68] 2015-11-02 17:35:44 UTC" > and that isn't working for me. It just renders as is (not as a link). > > This is when accessing the wiki via firefox (on Debian Testing) after > running `fossil ui my-proj.fossil`. The page must already exist. Is that the problem? It works on the Fossil self-hosting webpage: https://www.fossil-scm.org/fossil/wiki?name=Sandbox -- D. Richard Hipp d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Mon, Jan 25, 2016, at 04:34 PM, Richard Hipp wrote: > On 1/25/16, John Gabriele wrote: > > On Mon, Jan 25, 2016, at 03:50 PM, Richard Hipp wrote: > >> On 1/25/16, Warren Young wrote: > >> > For Fossil wiki, the same thing is spelled: > >> > > >> > [/wiki?name=other+wiki+page|other wiki page] > >> > > >> > >> In the Fossil wiki it suffices to simply put the page name in [...]. > >> For example: > >> > >> some text [other wiki page] more text > >> > > > > Hm. I'm using > > "This is fossil version 1.34 [62dcb00e68] 2015-11-02 17:35:44 UTC" > > and that isn't working for me. It just renders as is (not as a link). > > > > This is when accessing the wiki via firefox (on Debian Testing) after > > running `fossil ui my-proj.fossil`. > > The page must already exist. Is that the problem? > > It works on the Fossil self-hosting webpage: > https://www.fossil-scm.org/fossil/wiki?name=Sandbox No, the page that I'm trying to link to does already exist. I thought it might be because there were spaces in the name, but I tried it for a page with no spaces, and that doesn't work either. I also tried it with a [CamelCase] named page, but that doesn't work either. -- John ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On 1/25/16, John Gabriele wrote: >> >> It works on the Fossil self-hosting webpage: >> https://www.fossil-scm.org/fossil/wiki?name=Sandbox > > No, the page that I'm trying to link to does already exist. > > I thought it might be because there were spaces in the name, but I tried > it for a page with no spaces, and that doesn't work either. I also tried > it with a [CamelCase] named page, but that doesn't work either. > And you are doing this using the Fossil wiki format? Notice that it does not work with Markdown, only with Fossil's native wiki format. -- D. Richard Hipp d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Mon, Jan 25, 2016, at 04:40 PM, Richard Hipp wrote: > On 1/25/16, John Gabriele wrote: > >> > >> It works on the Fossil self-hosting webpage: > >> https://www.fossil-scm.org/fossil/wiki?name=Sandbox > > > > No, the page that I'm trying to link to does already exist. > > > > I thought it might be because there were spaces in the name, but I tried > > it for a page with no spaces, and that doesn't work either. I also tried > > it with a [CamelCase] named page, but that doesn't work either. > > > > And you are doing this using the Fossil wiki format? Notice that it > does not work with Markdown, only with Fossil's native wiki format. Ah. No, I was using markdown. Ok. Thank you. -- John ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Mon, Jan 25, 2016, at 04:49 PM, John Gabriele wrote: > On Mon, Jan 25, 2016, at 04:40 PM, Richard Hipp wrote: > > On 1/25/16, John Gabriele wrote: > > >> > > >> It works on the Fossil self-hosting webpage: > > >> https://www.fossil-scm.org/fossil/wiki?name=Sandbox > > > > > > No, the page that I'm trying to link to does already exist. > > > > > > I thought it might be because there were spaces in the name, but I tried > > > it for a page with no spaces, and that doesn't work either. I also tried > > > it with a [CamelCase] named page, but that doesn't work either. > > > > > > > And you are doing this using the Fossil wiki format? Notice that it > > does not work with Markdown, only with Fossil's native wiki format. > > Ah. No, I was using markdown. > > Ok. Thank you. By the way, I think it would be very helpful if, when using Markdown, the Fossil wiki had built-in syntax for linking to other pages in the wiki. Many popular wikis (MediaWiki (Wikipedia), moinmoin, Usemod, PmWiki, ikiwiki) use [[this style]] syntax. -- John ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Jan 26, 2016, at 12:36 PM, John Gabriele wrote: > > I think it would be very helpful if, when using Markdown, > the Fossil wiki had built-in syntax for linking to other pages in the > wiki. Agreed. > Many popular wikis (MediaWiki (Wikipedia), moinmoin, Usemod, > PmWiki, ikiwiki) use [[this style]] syntax. I think you’re mixing two things that ought not be mixed. Fossil Wiki syntax already supports this, as drh pointed out up-thread: [Other Wiki Article|plus optional descriptive text] When adding such a feature to the Fossil Markdown processor, it should be within the existing syntax, not by borrowing wiki syntax. Currently, if you say something like this in Fossil Markdown: [some descriptive text](Other Wiki Article) you get broken HTML: some descriptive text The only trick required here is for Fossil’s Markdown formatter to realize that “Other Wiki Article” is an existing wiki article title and rewrite the URL appropriately. There is an advantage to [[this syntax]] in wikis: it can point to articles that don’t exist yet, implicitly requesting someone to write that article. I don’t see that Fossil should provide such a feature. Fossil Wiki is intended for well-scoped wikis, not encyclopedia wikis, so there is no need for dangling links. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Tue, Jan 26, 2016, at 03:10 PM, Warren Young wrote: > On Jan 26, 2016, at 12:36 PM, John Gabriele > wrote: > > > > I think it would be very helpful if, when using Markdown, > > the Fossil wiki had built-in syntax for linking to other pages in the > > wiki. > > Agreed. > > > Many popular wikis (MediaWiki (Wikipedia), moinmoin, Usemod, > > PmWiki, ikiwiki) use [[this style]] syntax. > > I think you’re mixing two things that ought not be mixed. > > Fossil Wiki syntax already supports this, as drh pointed out up-thread: > > [Other Wiki Article|plus optional descriptive text] > > When adding such a feature to the Fossil Markdown processor, it should be > within the existing syntax, not by borrowing wiki syntax. Ok. One (minor) drawback to [this style] is that it's something that might come up in regular prose content, so you'd have to remember to \[backslash escape] when you don't want it to form an intra-wiki link. > Currently, if you say something like this in Fossil Markdown: > > [some descriptive text](Other Wiki Article) > > you get broken HTML: > > some descriptive text > > The only trick required here is for Fossil’s Markdown formatter to > realize that “Other Wiki Article” is an existing wiki article title and > rewrite the URL appropriately. I see. You want to be able to have both of these link to the same wiki page: [fettuccine alfredo] [you might like this](fettuccine alfredo) That last line above doesn't look good to me; since this is markdown, that thing in parens should be a url or path to an html file. I see this as a drawback to re-using the [descriptive text](wiki page name) syntax for intra-wiki-links. Incidentally: Fossil's markdown --- and, I'm guessing, most markdowns --- allow you to write [this] to indicate a link (rather thank having to write `[this][]`), and it assumes that somewhere else you have a line that looks like: [this]: http://example.com or [this]: /wiki?name=mumble so it knows where the link should point to. I find it quite handy, and better looking without the trailing `[]`. The gitit wiki uses Pandoc under the hood, and Markdown for markup syntax, and it uses [this style]() for intra-wiki links. I like that pretty well, and it doesn't interfere with the above-mentioned [shorthand]. What do you think of `[descriptive text|wiki page name]()`? > There is an advantage to [[this syntax]] in wikis: it can point to > articles that don’t exist yet, implicitly requesting someone to write > that article. I don’t see that Fossil should provide such a feature. > Fossil Wiki is intended for well-scoped wikis, not encyclopedia wikis, so > there is no need for dangling links. Actually, I see that if I include a link to a non-existent page using Fossil markdown, ex. [Moose](/wiki?name=Moos), then save the wiki page, it actually does make a link for me to follow, and I can click that link and be taken to a page, the content of which is "Empty Page" (in italics). And I can then click the "Edit" link and start editing it. So, as-is, it seems to already provide that "autovivification" feature. -- John ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Jan 26, 2016, at 2:06 PM, John Gabriele wrote: > > On Tue, Jan 26, 2016, at 03:10 PM, Warren Young wrote: >> The only trick required here is for Fossil’s Markdown formatter to >> realize that “Other Wiki Article” is an existing wiki article title and >> rewrite the URL appropriately. > > I see. You want to be able to have both of these link to the same wiki > page: > >[fettuccine alfredo] >[you might like this](fettuccine alfredo) Yes. > That last line above doesn't look good to me; since this is markdown, > that thing in parens should be a url or path to an html file. It would be straightforward for Fossil to test whether the link text is a Fossil wiki article text before writing it literally into the HTML. If it isn’t, it can simply fall back to its current HTML generation logic. The only risk is that there’s a wiki article with that title, but you *don’t* want Fossil to make the link. Do you see that as a significant risk? While I’m thinking about it, Fossil should also auto-link artifact IDs and tag names when used as link targets, for the same reason: See the [original bug report](f86d58fe11). Here, f86d58fe11 is explicitly the link text. If it matches a Fossil artifact ID, Fossil should auto-link it. This design error was fixed in [the v5 branch](v5.0.0). Same thing, only with a tag name instead of an artifact ID. This design extends a partial fix already committed. ([f86d58fe11]) There is a tiny risk of ambiguity here, since the descriptive text and the link target are the same thing. But, all that’s needed to resolve it is a clear precedence hierarchy. I propose: 1. Try to treat it as a link reference. (e.g. [foo] in a document that also contains [foo]: target) 2. Try to find a tag or branch with the same name. 3. Try to find a wiki article with the same name. 4. If it’s hexadecimal, try to treat it as an artifact ID. 5. Failing all that, do what it does now. Your challenge: find a sane use case where the precedence rules above give surprising results. You will notice that I have ordered the rules to give a controlled expansion of the search scope. Rules 2 and 3 could swap, but rule 4 must certainly follow the other three, and rule 1 must be first. > Incidentally: Fossil's markdown --- and, I'm guessing, most markdowns > --- allow you to write [this] to indicate a link (rather thank having to > write `[this][]`), and it assumes that somewhere else you have a line > that looks like: > >[this]: http://example.com > or >[this]: /wiki?name=mumble > > so it knows where the link should point to. I find it quite handy, and > better looking without the trailing `[]`. The only risk there I see is that you may use a link tag that happens to have the same text as an existing Fossil wiki document. That sounds like a clear case of “so don’t do that, then.” > [gitit] uses [this style]() for intra-wiki links I can live with that. I just don’t see it as necessary protection. It sounds like a solution in search of a problem. > What do you think of `[descriptive text|wiki page name]()`? That’s again trying to mix Fossil Wiki with Fossil Markdown. Let Markdown be Markdown. > [Fossil] seems to already provide that > "autovivification" feature. Good to know. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
Re: [fossil-users] how to link to other pages in the wiki, wiki-link syntax
On Tue, Jan 26, 2016, at 04:48 PM, Warren Young wrote: > On Jan 26, 2016, at 2:06 PM, John Gabriele wrote: > > > > I see. You want to be able to have both of these link to the same wiki > > page: > > > >[fettuccine alfredo] > >[you might like this](fettuccine alfredo) > > Yes. > > > That last line above doesn't look good to me; since this is markdown, > > that thing in parens should be a url or path to an html file. > > It would be straightforward for Fossil to test whether the link text is a > Fossil wiki article text before writing it literally into the HTML. If > it isn’t, it can simply fall back to its current HTML generation logic. Ok. I now think I was mistaken. Your suggestion makes sense to me in terms of "[descriptive text](where you should go for that)": [descriptive text](http://example.com) [descriptive text](foo.jpg) [descriptive text](path/to/foo.html) [descriptive text](some wiki page) > The only risk is that there’s a wiki article with that title, but you > *don’t* want Fossil to make the link. > > Do you see that as a significant risk? I think there's two separate issues: 1. you want to write "[sic]" and not have the wiki try and link to a "sic" page. You can avoid this by backslash escaping the open bracket ( \[sic] ). 2. you write "[go here]", then later there's a line "[go here]: http://example.com";, but there's also a "go here" wiki page. Where does the link point to? [Oh, you addressed this below in your numbered list.] I'd say that if you took the trouble to create that link target line, then the wiki should honor that before trying to link to a wiki page. > While I’m thinking about it, Fossil should also auto-link artifact IDs > and tag names when used as link targets, for the same reason: > > See the [original bug report](f86d58fe11). > > Here, f86d58fe11 is explicitly the link text. If it matches a Fossil > artifact ID, Fossil should auto-link it. > > This design error was fixed in [the v5 branch](v5.0.0). > > Same thing, only with a tag name instead of an artifact ID. > > This design extends a partial fix already committed. ([f86d58fe11]) > > There is a tiny risk of ambiguity here, since the descriptive text and > the link target are the same thing. But, all that’s needed to resolve it > is a clear precedence hierarchy. I propose: > > 1. Try to treat it as a link reference. (e.g. [foo] in a document that > also contains [foo]: target) > > 2. Try to find a tag or branch with the same name. > > 3. Try to find a wiki article with the same name. > > 4. If it’s hexadecimal, try to treat it as an artifact ID. > > 5. Failing all that, do what it does now. (Well, using markdown syntax *now*, it doesn't create a link at all -- you just get the plain text with brackets around it. If the feature were implemented though, I'd say the default last-case behaviour should be to create the link to an empty wiki page, so the author can click it, create the new page, and keep writing.) > Your challenge: find a sane use case where the precedence rules above > give surprising results. > > You will notice that I have ordered the rules to give a controlled expansion > of the search scope. Rules 2 and 3 could swap [snip] Looks good to me. Though I'm not yet familiar with fossil, my hunch is that you'll run into cases where there's branches and wiki pages with the same name. Don't know which would make more sense to come first. -- John ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users