Help:Rosetta Code Needs: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Tidying up: I believe the template name is "Language".)
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:


A bot is a piece of software that interacts with the MediaWiki engine through HTTP GET queries, much the same way as a user using a browser. MediaWiki's index.php supports a [http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#Raw raw-access API], specifically to aid in that.
A bot is a piece of software that interacts with the MediaWiki engine through HTTP GET queries, much the same way as a user using a browser. MediaWiki's index.php supports a [http://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#Raw raw-access API], specifically to aid in that.

==Village Pump==

When RC first went live, someone suggested that there be a Wikipedia-style Village Pump. The "Feedback" link on the left is a poor substitute for that.

Wikipedia's Village Pump serves as a central, categorized discussion point for policy and discussion; It's a single small group of pages where people can go to find out the latest buzz, and make suggestions. Currently, the only way to do that is to watch the Recent Changes link on the left, and keep an eye on the Talk: namespace.

Wikipedia's Pump cycles discussion every week. At Rosetta Code's current level of activity, once-per-month would be fine.


==Tidying up==
==Tidying up==
Line 20: Line 12:


===Example/task categorization===
===Example/task categorization===
Rosetta Code's navigation organization depends heavily on proper categorization of programming tasks. Programming examples need to include code to categorize their parent task, based on the name of the section title. A Java programming task, identified by the code <tt><nowiki>==Java==</nowiki></tt> should include the code <tt><nowiki>[[Category:Java]]</nowiki></tt>.
Rosetta Code's navigation organization depends heavily on proper categorization of programming tasks. Programming examples need to include code to categorize their parent task, based on the name of the section title. This is done by using the <tt><nowiki>{{header}}</nowiki></tt> template.


In addition, when new languages are added, two things need to take place. A page and category need to be created for that language.
In addition, when new languages are added, two things need to take place. A page and category need to be created for that language.
Line 26: Line 18:
For example, let's say that someone adds an example for a language not previously covered on Rosetta Code. We'll use [[Pseudocode]] here, because that's a language which, for some odd reason, hasn't shown up yet.
For example, let's say that someone adds an example for a language not previously covered on Rosetta Code. We'll use [[Pseudocode]] here, because that's a language which, for some odd reason, hasn't shown up yet.


When a programming example is created, it often looks something like this:
When a programming example is created set up the header like so:
<pre><nowiki>
==[[Pseudocode]]==
(some code)
</nowiki></pre>

In such cases, there is no link to a category, and the contributing author usually does not create content at the [[Pseudocode]] link. A bot is needed which sees such examples and performs a few simple operations.

First, the code example needs to be categorized:

<pre><nowiki>
==[[Pseudocode]]==
[[Category:Pseudocode]]
(some code)
</nowiki></pre>

Now we've got a link to a nonexistent page, and, at the bottom of the task page, a link to a nonexistent category. The language page needs to be created and filled with a simple redirect to the category page:

<pre><nowiki>
#REDIRECT [[:Category:Pseudocode]]
</nowiki></pre>

Note that the colon preceding the word "Category" is important; it prevents the redirect page from being included in the language category.

Finally, we need to open the Category page, and fill in the <tt><nowiki>{{Programming Language}}</nowiki></tt> template:

<pre><nowiki>{{Programming Language}}</nowiki></pre>

MediaWiki handles the rest.

<pre><nowiki>
==[[Pseudocode]]==
(some code)
</nowiki></pre>

In such cases, there is no link to a category, and the contributing author usually does not create content at the [[Pseudocode]] link. A bot is needed which sees such examples and performs a few simple operations.

First, the code example needs to be categorized:

<pre><nowiki>
<pre><nowiki>
==[[Pseudocode]]==
=={{header|Pseudocode}}==
[[Category:Pseudocode]]
(some code)
(some code)
</nowiki></pre>
</nowiki></pre>


Now we've got a link to a nonexistent page, and, at the bottom of the task page, a link to a nonexistent category. The language page needs to be created and filled with a simple redirect to the category page:
The template adds a link to a nonexistent page, and at the bottom of the task page a link to a nonexistent category. The language page needs to be created and filled with a simple redirect to the category page:


<pre><nowiki>
<pre><nowiki>
Line 79: Line 32:
Note that the colon preceding the word "Category" is important; it prevents the redirect page from being included in the language category.
Note that the colon preceding the word "Category" is important; it prevents the redirect page from being included in the language category.


Finally, we need to open the Category page, and fill in the <tt><nowiki>{{Programming Language}}</nowiki></tt> template:
Finally, we need to open the Category page, and fill in the <tt><nowiki>{{Language}}</nowiki></tt> template:


<pre><nowiki>{{Programming Language}}</nowiki></pre>
<pre><nowiki>{{Language}}</nowiki></pre>


MediaWiki handles the rest.
MediaWiki handles the rest.

Latest revision as of 22:38, 29 November 2020

Rosetta Code has expand at a rate far exceeding my expectations. Unfortunately, it now has needs that I don't know how to fill. Since a sizable community of language enthusiasts have been participating in RC, it seems wise to get help from you.

Bots

RC needs bots to perform two functions, at least.

A bot is a piece of software that interacts with the MediaWiki engine through HTTP GET queries, much the same way as a user using a browser. MediaWiki's index.php supports a raw-access API, specifically to aid in that.

Tidying up

Most of my actual work with Rosetta Code involves keeping an eye on additions to the site and ensuring they implement a few basic conventions. For example:

Example/task categorization

Rosetta Code's navigation organization depends heavily on proper categorization of programming tasks. Programming examples need to include code to categorize their parent task, based on the name of the section title. This is done by using the {{header}} template.

In addition, when new languages are added, two things need to take place. A page and category need to be created for that language.

For example, let's say that someone adds an example for a language not previously covered on Rosetta Code. We'll use Pseudocode here, because that's a language which, for some odd reason, hasn't shown up yet.

When a programming example is created set up the header like so:

=={{header|Pseudocode}}==
 (some code)

The template adds a link to a nonexistent page, and at the bottom of the task page a link to a nonexistent category. The language page needs to be created and filled with a simple redirect to the category page:

#REDIRECT [[:Category:Pseudocode]]

Note that the colon preceding the word "Category" is important; it prevents the redirect page from being included in the language category.

Finally, we need to open the Category page, and fill in the {{Language}} template:

{{Language}}

MediaWiki handles the rest.