> As you know T2 and T3 are deprecated. Some time ago I started a
> reimplementation of T3 called cube9. I got stuck. I now re-factored it
> completely
>
> -----
> http://code.google.com/p/cube9/ (requires web2py trunk)
> -----
>
> It uses markmin:
>
> -----
> http://web2py.com/examples/static/markmin.html
> -----
With markmin (or perhaps cu29 -- why that?), how does one reference local wiki pages without using their full URL? For example, in Wikipedia, this is a link: [[web2py]]. But in markmin it creates an anchor.
> The philosophy is the same as T3. Every URL is a wiki.
Would you elaborate a little on that statement, please?
Name suggestion: Cube^2
--
Thadeus
> The idea is that any web app is a set of pages that contain stuff.
> Some are public some are not, some have other permissions, some are
> listed in a hierarchical menu some not. Therefore it should be
> possible to develop as app as one creates a wiki, by adding pages and
> filling the pages.
>
> In web2py every URL is mapped into a action. An action is a function +
> template.
>
> In cu29 every URL (technically only those URL managed by the
> plugin_wiki/page action) is a page. The page is described by the
> markmin syntax and it can contain stuff because markmin allows to
> include high level widgets (not to be confused with
> db.table.field.widget).
>
> You can have both together if you apply plugin_wiki from cu29 to your
> apps.
>
> Hope it makes sense.
Yes, thanks.
One more thing, for those of us who haven't followed the whole history (two more things, I guess): why 'cube'? why '9'?
> you link pages with
>
> [[this is the link text page:this-is-the-slug]]
So page: is recognized by the wiki plugin?
If I'm understanding the syntax, and I may not be, I have a suggestion.
[[name]] and [[name#anchor]] should be wiki links; [[#anchor]] remains a link to a local anchor, wiki or not.
[[=name]] defines an anchor.
So (again if I'm following you), [[name]] would be a shortcut for [[name page:name]].
My reasoning is that [[link]] is so established (and convenient) a wiki notation that it should be preserved, and that defining an anchor is much less frequent, so the extra '=' is not much of a burden.
> Right now you can do links with
>
> url
> [[name url]]
> [[name #anchor]]
> [[name url#anchor]]
> [[name page:slug]]
>
> and define an anchor with
>
> [[anchor]]
>
> If I understand your suggestions:
> 1) also allow
> [[url]]
> [[url#anchor]]
> [[#anchor]]
> [[page:slug]]
> to allow un-named links. Q: how can a link not have a name?
In your notation, I was thinking:
[[slug]] would imply [[slug page:slug]]
'slug' would be used verbatim as the name, and with slug-encoding as the slug.
A link would always have a name; it would just be implicit. That's the Mediawiki convention, though they use a vertical bar to separate an optional name from the slug.
>
> 2) use [[=anchor]] to define an anchor to avoid conflict with 1.
>
> if we do 1, we must do 2 but I would prefer [[!anchor]] then.
Sure.
Or [name:anchor], which corresponds to the html that it generates.
> I do not have a strong opposition and I see the advantages in terms of
> notation but I have two problems:
I'm tied up today, so just a quick note. I understand and generally agree with your caveats. I have a couple of thoughts on the subject that I'll come back with.
--
Álvaro Justen - @turicas
http://blog.justen.eng.br/
21 9898-0141
> I do not have a strong opposition and I see the advantages in terms of
> notation but I have two problems:
>
> The page:slug notation is handled by plugin_wiki, not by markmin.
> markmin just treats url, #anchor, url#anchor, page:slug all in the
> same way. plugin_wiki replaces the page:.. with /app/plugin_wiki/
> page/.... after markmin has done its job.
> This decoupling was intentional to allow markmin to work without
> web2py and without plugin_wiki conventions.
> Your first suggestion would introduce coupling. Moreover it would
> provide a shortcut that encourage users to display the slug as text of
> the link. I am not convinced this is a good idea.
It's pretty common (and useful) in Wikipedia. And it needn't be literally the slug. As in Wikipedia,
[[link]]
would imply that 'link' is the text and slug(link) the slug for the URL. In Wikipedia, that's most commonly the space-to-underscore conversion, so
[[some link]]
becomes
<a href="some_link">some link</a>
I agree that coupling is an issue, but is the answer to make the wiki syntax worse? I think that the wiki should be a first-class user of its syntax. That is, it shouldn't be necessary to compromise its syntax just so markmin can be 100% shared.
How about explicitly initializing markmin (at least optionally)? Give it a base address, that slugs could be appended to. Or subclass markwiki from markmin?
Or at the very least allow a shortcut.
[[name page:slug]]
could use the Wikipedia convention
[[name|slug]]
with [[name|]] implying [[name|name]]
Alternatively (see base addresses below), [[name page:slug]] could be abbreviated [[name :slug]], and [[name :]] would imply [[name page:name]] as above.
One more thing wrt the "base address" idea above. Suppose we were using the new wiki as the basis for a web2py reference wiki. One of the things that the wiki needs to do is to link to some external standard references. This is not an attempt at a real syntax--just something to give the general idea.
[[base:slice http://www.web2pyslices.com/main/slices/take_slice/%(slug)]]
and then:
[[Audit trail slice:35]]
...would do the obvious thing.
So we could have base addresses defined for slices, the manual, the Python reference pages, etc.
Side note: the base address definition format needn't be a command in wiki syntax; it could be an initialization call related to the plugin. In particular, we don't want to have to embed it in every page (though the *ability* to do so would be handy). Or every page could implicitly "include" a master page, if present.
Currently, your markmin seems to be like Texy (http://texy.info/en/)
A look at converters show how is the life could be:
* http://txt2tags.sourceforge.net/
* http://johnmacfarlane.net/pandoc/
So I may suggest to adapt markmin to one of the major lanuages and then
use a converter.
Regards.