Moodle Community Sites

New filter for moodle.org to easily make links to the docs

Details

Description

Can someone please cook up a little Moodle filter for me to convert links like this:

[[GSOC/2007]] ---> <a href="http://docs.moodle.org/en/GSOC/2007" title="Moodle Docs">GSOC/2007</a>

and

[[GSOC/2007|Google Summer of Code 2007]] ---> <a href="http://docs.moodle.org/en/GSOC/2007" title="Moodle Docs">Google Summer of Code 2007</a>

This would be really useful on http://moodle.org!

Issue Links

Activity

Hide
Martin Dougiamas added a comment - - edited

Helen, please expand the spec if you think of anything. I was considering using the current language to link to the appropriate page in Moodle Docs but that might not be a good idea (different people going to different pages).

Show
Martin Dougiamas added a comment - - edited Helen, please expand the spec if you think of anything. I was considering using the current language to link to the appropriate page in Moodle Docs but that might not be a good idea (different people going to different pages).
Hide
Martin Dougiamas added a comment -

As Severin point out, we can do direct language links like this:

[[fr:Installation de Moodle]] --> <a href="http://docs.moodle.org/fr/Installation_de_Moodle" title="Moodle Docs">Installation de Moodle</a>

Show
Martin Dougiamas added a comment - As Severin point out, we can do direct language links like this: [[fr:Installation de Moodle]] --> <a href="http://docs.moodle.org/fr/Installation_de_Moodle" title="Moodle Docs">Installation de Moodle</a>
Hide
Helen Foster added a comment -

I think a filter for linking to documentation pages is a great idea!

My only suggestion for improvement is to consider making the link text clearer. There are so many filters used on moodle.org (see http://docs.moodle.org/en/Filters_used_on_the_Moodle.org_forums) that it can be confusing not knowing whether a highlighted link will take you to a glossary entry, a database entry, another activity etc. Having title text is a help, of course, but I'm wondering about including the word "documentation" in the link text, for example

[[Installing Moodle]] ---> <a href="http://docs.moodle.org/en/Installing Moodle" title="Moodle Docs">Installing Moodle documentation</a>

I'm not sure how this would work in other languages, or indeed whether it makes sense to always append the word "documentation", so comments on my suggestion would be appreciated.

Show
Helen Foster added a comment - I think a filter for linking to documentation pages is a great idea! My only suggestion for improvement is to consider making the link text clearer. There are so many filters used on moodle.org (see http://docs.moodle.org/en/Filters_used_on_the_Moodle.org_forums) that it can be confusing not knowing whether a highlighted link will take you to a glossary entry, a database entry, another activity etc. Having title text is a help, of course, but I'm wondering about including the word "documentation" in the link text, for example [[Installing Moodle]] ---> <a href="http://docs.moodle.org/en/Installing Moodle" title="Moodle Docs">Installing Moodle documentation</a> I'm not sure how this would work in other languages, or indeed whether it makes sense to always append the word "documentation", so comments on my suggestion would be appreciated.
Hide
Martin Dougiamas added a comment -

That probably wouldn't work for all languages, but how about a little icon: Installing Moodle [D] (Where [D] is a little Docs icon)

Show
Martin Dougiamas added a comment - That probably wouldn't work for all languages, but how about a little icon: Installing Moodle [D] (Where [D] is a little Docs icon)
Hide
Martin Dougiamas added a comment -

Well, I'll be ....

Valery pointed out this exists already. Why didn't I check the modules database? :-P

http://moodle.org/mod/data/view.php?d=13&rid=602

Show
Martin Dougiamas added a comment - Well, I'll be .... Valery pointed out this exists already. Why didn't I check the modules database? :-P http://moodle.org/mod/data/view.php?d=13&rid=602
Hide
Helen Foster added a comment -

Yes, a little Docs icon could be used. Alternatively, we could prefix the page title with "Moodle Docs - ", for example

[[Installing Moodle]] ---> <a href="http://docs.moodle.org/en/Installing Moodle" title="Moodle Docs">Moodle Docs - Installing Moodle</a>

It's great that Valery has created a Wikipedia filter already

Show
Helen Foster added a comment - Yes, a little Docs icon could be used. Alternatively, we could prefix the page title with "Moodle Docs - ", for example [[Installing Moodle]] ---> <a href="http://docs.moodle.org/en/Installing Moodle" title="Moodle Docs">Moodle Docs - Installing Moodle</a> It's great that Valery has created a Wikipedia filter already
Hide
Eloy Lafuente (stronk7) added a comment -

Can this be considered resolved, then? What's the final syntax for filtering? Is it installed in moodle.org?

Show
Eloy Lafuente (stronk7) added a comment - Can this be considered resolved, then? What's the final syntax for filtering? Is it installed in moodle.org?
Hide
Helen Foster added a comment -

Eloy, no, it's not yet installed on moodle.org.

Show
Helen Foster added a comment - Eloy, no, it's not yet installed on moodle.org.
Hide
Eloy Lafuente (stronk7) added a comment -

Uhm...following the work done by the multimovie filter (http://moodle.org/mod/data/view.php?d=13&rid=624)... what about to create one filter using this syntax (to have it more or less uniform):

[[docs:pagename|title]]

I think I can do it in 1 hour or so. FYC.

Show
Eloy Lafuente (stronk7) added a comment - Uhm...following the work done by the multimovie filter (http://moodle.org/mod/data/view.php?d=13&rid=624)... what about to create one filter using this syntax (to have it more or less uniform): [[docs:pagename|title]] I think I can do it in 1 hour or so. FYC.
Hide
Eloy Lafuente (stronk7) added a comment -

Done. You can see it here:

http://cvs.moodle.org/contrib/plugins/filter/moodledocs/

syntax: http://cvs.moodle.org/contrib/plugins/filter/moodledocs/README.txt?view=markup

it also respects $CFG->docroot and $CFG->doctonewwindow

FYC, ciao

Show
Eloy Lafuente (stronk7) added a comment - Done. You can see it here: http://cvs.moodle.org/contrib/plugins/filter/moodledocs/ syntax: http://cvs.moodle.org/contrib/plugins/filter/moodledocs/README.txt?view=markup it also respects $CFG->docroot and $CFG->doctonewwindow FYC, ciao
Hide
Martin Dougiamas added a comment -

I was really hoping to use the same syntax on moodle.org as we use on docs.moodle.org ... can we just make it so that both work? ie if the prefix is missing then it defaults to making a docs link?

Show
Martin Dougiamas added a comment - I was really hoping to use the same syntax on moodle.org as we use on docs.moodle.org ... can we just make it so that both work? ie if the prefix is missing then it defaults to making a docs link?
Hide
Eloy Lafuente (stronk7) added a comment -

Main problem leaving the prefix out is that it can cause conflict with other filters, more where colons (the prefix separator) are often used in page names (all the "Development:xxxxx" for example). There is no way to differentiate that colon from a prefix one.

That's the cause I added the prefix to the first multimovie filter and now to the moodledocs filter. To avoid conflicts between filters sharing that wediawiki-like syntax. Imagine they are the prefixes used by interwiki links.

Anyway, I can make a stripped version of the filter, ignoring prefixes completely. Just be 100% sure it will be "incompatible" with other filters using that sort of syntax (plus leading people to confusion if the syntax in moodle.org is different from the syntax in their own sites).

Your decision,

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Main problem leaving the prefix out is that it can cause conflict with other filters, more where colons (the prefix separator) are often used in page names (all the "Development:xxxxx" for example). There is no way to differentiate that colon from a prefix one. That's the cause I added the prefix to the first multimovie filter and now to the moodledocs filter. To avoid conflicts between filters sharing that wediawiki-like syntax. Imagine they are the prefixes used by interwiki links. Anyway, I can make a stripped version of the filter, ignoring prefixes completely. Just be 100% sure it will be "incompatible" with other filters using that sort of syntax (plus leading people to confusion if the syntax in moodle.org is different from the syntax in their own sites). Your decision, Ciao
Hide
Martin Dougiamas added a comment -

I know having a docs prefix is a technically perfect solution but I think it's not as usable as it could be in this case.

I think it'll be a good compromise if you make it detect prefixes like this:

if "mm:" then exit now
if "xxx:" where xxx is any other filter prefix we know about about then exit now
if "docs:" then strip "docs:" and continue
make it into a link as above

Could you do that please?

Show
Martin Dougiamas added a comment - I know having a docs prefix is a technically perfect solution but I think it's not as usable as it could be in this case. I think it'll be a good compromise if you make it detect prefixes like this: if "mm:" then exit now if "xxx:" where xxx is any other filter prefix we know about about then exit now if "docs:" then strip "docs:" and continue make it into a link as above Could you do that please?
Hide
Eloy Lafuente (stronk7) added a comment -

Done.

Now prefix is optional in the syntax.

If nothing or "docs" is found, the filter will process the link.

If anything else, being 2-4cc lowercase, is found (like "mm"), assume it's another link and skip it to be processed by another filter (like multimovie).

I think this is ok with your plan above and save us to hardcode the list ok known prefixes. Anything 2-4cc lowercase will be considered prefix.

http://cvs.moodle.org/contrib/plugins/filter/moodledocs/README.txt?view=markup

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Done. Now prefix is optional in the syntax. If nothing or "docs" is found, the filter will process the link. If anything else, being 2-4cc lowercase, is found (like "mm"), assume it's another link and skip it to be processed by another filter (like multimovie). I think this is ok with your plan above and save us to hardcode the list ok known prefixes. Anything 2-4cc lowercase will be considered prefix. http://cvs.moodle.org/contrib/plugins/filter/moodledocs/README.txt?view=markup Ciao
Hide
Martin Dougiamas added a comment -

THANKS, great!

I've got it on moodle.org - works great!

Show
Martin Dougiamas added a comment - THANKS, great! I've got it on moodle.org - works great!
Hide
Helen Foster added a comment -

Yes, thanks a lot, Eloy

I've just tested it and found all your README examples working fine, apart from [[Manual de Estilo de Código||es]], which was displayed as

Manual de Estilo de Código">Manual de Estilo de Código

where the word "Manual" linked to the Manual module in the modules and plugins database.

Show
Helen Foster added a comment - Yes, thanks a lot, Eloy I've just tested it and found all your README examples working fine, apart from [[Manual de Estilo de Código||es]], which was displayed as Manual de Estilo de Código">Manual de Estilo de Código where the word "Manual" linked to the Manual module in the modules and plugins database.
Hide
Eloy Lafuente (stronk7) added a comment -

Ah, I guess we need to put the "moodledocs" filter BEFORE the "database", "glossary" and so on... doing that now in moodle.org...

Show
Eloy Lafuente (stronk7) added a comment - Ah, I guess we need to put the "moodledocs" filter BEFORE the "database", "glossary" and so on... doing that now in moodle.org...
Hide
Helen Foster added a comment -

Duh! Thanks Eloy

Just writing some documentation on the new filter before posting in the documentation forum.

Show
Helen Foster added a comment - Duh! Thanks Eloy Just writing some documentation on the new filter before posting in the documentation forum.
Hide
Eloy Lafuente (stronk7) added a comment -

Done. Now moodledocs filter has precedence over glossary, database and activity names. Resolving as fixed.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Done. Now moodledocs filter has precedence over glossary, database and activity names. Resolving as fixed. Ciao
Hide
Helen Foster added a comment -
Show
Helen Foster added a comment - Moodle Docs auto-linking filter documentation added: http://docs.moodle.org/en/Filters_used_on_the_Moodle.org_forums http://docs.moodle.org/en/Moodle.org_FAQ Forum post: http://moodle.org/mod/forum/discuss.php?d=104437 Thanks again guys
Hide
Chris Collman added a comment -

Awesome and definitely a wowie zowie for me. Side benefit: Hope it encourages others to link to MoodleDocs.

Double brackets on each end, will take a copy and paste of the page name, use the "|" function for alternative displayed text, recognizes the # section heading and treats the underscore just like a space.

Looks like I will have a Foster's Bitter on your behalf tonight !

Best Chris

Show
Chris Collman added a comment - Awesome and definitely a wowie zowie for me. Side benefit: Hope it encourages others to link to MoodleDocs. Double brackets on each end, will take a copy and paste of the page name, use the "|" function for alternative displayed text, recognizes the # section heading and treats the underscore just like a space. Looks like I will have a Foster's Bitter on your behalf tonight ! Best Chris
Hide
Eloy Lafuente (stronk7) added a comment -

I've improved a bit the handling of colons, slashes and hashes. Filter updated in moodle.org too.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - I've improved a bit the handling of colons, slashes and hashes. Filter updated in moodle.org too. Ciao
Hide
Helen Foster added a comment -

Reopening this issue following a problem reported by Robert B:

Some time this year, I think in August, the links to Moodle docs stopped coming through as links in forum posts. That is instead of

http://docs.moodle.org/en/Developer_meeting_November_2008

I am getting

[ [ Developer meeting November 2008 ] ]

which is not as handy as the link if I want to see it (I added extra spaces so the filter does not convert this to link). My settings make Moodle send mail as plain text, so may be this works fine in HTML mode.

Is this a correctable issue? I suspect that the filter does not process the text mail.

http://moodle.org/mod/forum/discuss.php?d=109935&parent=488826#p488854

Show
Helen Foster added a comment - Reopening this issue following a problem reported by Robert B: Some time this year, I think in August, the links to Moodle docs stopped coming through as links in forum posts. That is instead of http://docs.moodle.org/en/Developer_meeting_November_2008 I am getting [ [ Developer meeting November 2008 ] ] which is not as handy as the link if I want to see it (I added extra spaces so the filter does not convert this to link). My settings make Moodle send mail as plain text, so may be this works fine in HTML mode. Is this a correctable issue? I suspect that the filter does not process the text mail. http://moodle.org/mod/forum/discuss.php?d=109935&parent=488826#p488854
Hide
Eloy Lafuente (stronk7) added a comment -

uhm... is this really a bug? Or... perhaps... text mails never have been processed by filters? I cannot imagine anything in that filter making it special at all.

Show
Eloy Lafuente (stronk7) added a comment - uhm... is this really a bug? Or... perhaps... text mails never have been processed by filters? I cannot imagine anything in that filter making it special at all.
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Helen,

just reclosing this because of dupe of MDLSITE-578 (that I've discovered some secs ago). I'll add you there. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi Helen, just reclosing this because of dupe of MDLSITE-578 (that I've discovered some secs ago). I'll add you there. Ciao

Dates

  • Created:
    Updated:
    Resolved: