Help:Referencing

From Vectorlab
Jump to: navigation, search
Underconstruction.png
This vcor page is currently under construction.

By: NIL. Last edit: 2016.03.03 (YYYY.MM.DD)

In the category:Under construction you'll find a list of all pages currently marked as under construction.

How to produce links to other pages, both internal as external. How to transclude content from one page to another. How to use templates.

Internal links

Internal links can be to

  • other pages
  • sections within the current page
  • sections within other pages
  • categories
  • footnotes (a special kind of link)

Other pages

A link to another page on vcor is established by wrapping the page name in a double set of square brackets.

For example, to link from the present page to the page "Converter tables" you would write:

The article [[Converter tables]] needs expanding, 
is anybody willing to take over this task?

The article Converter tables needs expanding, is anybody willing to take over this task?

Sometimes you may wish to link to a page but display other text in the link reference. You can achieve this by separating the link from the text to display with a vertical line. Any white space before or after the white line is ignored. This syntax is called piped linking.
The article [[Converter tables | tables for conversion]] needs expanding, 
is anybody willing to take over this task?

The article tables for conversion needs expanding, is anybody willing to take over this task?

Sections

Section linking is always created using "#" before the section title.

current page

A link to a section in the current page is created by "#" followed by the section name, all enclosed within double square brackets:

on [[#nowiki tag]] you'll learn how to disable linking.

on #nowiki tag you'll learn how to disable linking.

As you might notice, an ugly "#" is visible. You can hide that using a pipe (vertical bar followed by some text).
on [[#nowiki tag | nowiki tag]] you'll learn how to disable linking.

on nowiki tag you'll learn how to disable linking.

Alternatively display another description altogether:
[[#nowiki tag | Below]] you'll learn how to disable linking.

Below you'll learn how to disable linking.

other page

If you wish to link to a section on another page, you must name the page before the "#":

Some useful info about [[Converter tables#UPI (Units Per Inches) | UPI]] 
is to be found under [[Converter tables]]

Some useful info about UPI is to be found under Converter tables

Categories

Category links are a little different, they are created by prefixing the category name with a colon. If you forget to prefix with a colon you place the page in the category!

The category [[:Category:VectorScript_Example_Library| VectorScript Example Library]] 
contains many examples to get started with VectorScript.

The category VectorScript Example Library contains many examples to get started with VectorScript.

Please note that if you forget the colon, the text between the brackets will not display, it is NOT a link. Placing a page in the wrong category is not good practice and should be avoided.
The present page belongs to the category [[:Category:Help| Help]] 
because I placed [[Category:Help]] somewhere in the page.

The present page belongs to the category Help because I placed somewhere in the page. (between "placed" and "somewhere" I should have had a link).

Footnotes

Footnotes are created by using a special tag <ref>...</ref> followed by <references />.

  • <ref>...</ref> Between the tags you can insert the content of the reference.
  • <references /> must be placed where you wish your references to appear: it will be replaced on save by a list of all footnotes present in the page.
  • <ref name="whatever">...</ref> optionally you can use the attribute name that will create a reference that can be re-used later on in the page. Only alpha characters are allowed, numbers will generate an error.
  • <ref name="whatever" /> (empty tag with slash at the end) recalls a previously defined reference by its name.
Some info about real programmers:[1]
  • Real Programmers aren't afraid to use GOTOs.
  • Real Programmers can write five page long DO loops without getting confused.
  • Real Programmers like Arithmetic IF statements-- they make the code more interesting[2].
  • Real Programmers write self-modifying code, especially if they can save 20 nanoseconds in the middle of a tight loop[2].
  • Real Programmers don't need comments-- the code is obvious.
  • ...
References:
  1. Ed Post, Tektronix, Wilsonville OR USA, 1983
  2. 2.0 2.1 this is not supported in VectorScript.
Some info about real programmers:<ref>Ed Post, Tektronix, Wilsonville OR USA, 1983</ref>
* Real Programmers aren't afraid to use GOTOs.
* Real Programmers can write five page long DO loops without getting confused.
* Real Programmers like Arithmetic IF statements-- they make the code more interesting<ref name=no_vs>this is not supported in VectorScript.</ref>.
* Real Programmers write self-modifying code, 
especially if they can save 20 nanoseconds in the middle of a tight loop<ref name=no_vs />.
* Real Programmers don't need comments-- the code is obvious. 
* ...
References: <references/>
See also

External links

There are three ways to produce an external link:

  • full URL
  • hidden URL
  • alternate text

Full URL

A link to an external page is automatically created placing the URL in the text:

On Meta you'll find an extensive documentation about wiki links: http://meta.wikimedia.org/wiki/Help:Link

On Meta you'll find an extensive documentation about wiki links: http://meta.wikimedia.org/wiki/Help:Link

As you see, this leads to an ugly display of the full url.

Hidden URL

Otherwise you can wrap the external URL in single square brakets.

On Meta you'll find an extensive documentation about wiki links: [http://meta.wikimedia.org/wiki/Help:Link]

On Meta you'll find an extensive documentation about wiki links: [1]

This displays only a pointer to a link. Under certain conditions this might be wished for.

Alternate text

Most of the times the preferred way is to place an external URL followed by a space and an alternate text, wrapped in single square brakets:

On Meta you'll find an extensive documentation about wiki links: [http://meta.wikimedia.org/wiki/Help:Link Wiki links on Meta]

On Meta you'll find an extensive documentation about wiki links: Wiki links on Meta

Anything after the space will be displayed instead of the url.

Transclusion

Every page on vcor can be transcluded to some other page. This allows for modular building of pages.

  • a source page is transcluded to
  • a target page

If you are comfortable with VectorScript's Inclusion, you'll find the concept very familiar: if you change the transcluded page, the target updates automatically.

If you are not comfortable with includes, you might be comfortable with VectorWorks symbols: a symbol can be placed on a document as many times as you wish- if you change it, all instances change.

With a simple syntax the whole content of a page can be inserted in any point of another page: place a colon, then the name of the page all wrapped in double curly brakets.

For example, for transcluding in the present page the content of the glossary item Locus Point, you'll write:

{{:Locus Point}}

Which will output:


Snappable, non-printing 2D-only object.

Locus Points are used as supplementary parameters in various VectorWorks drawing operations.

  • When creating a sweep object, a locus point can be included in the selection set to define the sweep axis.
  • When using the alignment command a locus can be included with the selection set to define an arbitrary alignment point.

A page making heavy use of transclusion is Events: all examples reside in the VectorScript Example Library, but are transcluded in the flow of the article.

Noinclude tag

Transcluding pages needs a little care. Everything in the source page gets transcluded, with the exception of text between the <noinclude> tag. Go to the article Locus Point and give a look to the source code. You'll see that the category is wrapped in the <noinclude> tag. If it wasn't, the present page would be now belong to the category Glossary.

There are special articles in this wiki which has been cut on purpose to be transcluded, and many more will be created: for example the articles contained in the category:Subroutines - Converters. They are obviously predestinated to be transcluded, much like a VectorScript include.

It is not possible to transclude content from external pages.

Substitution

Substitution behaves exactly like transclusion, but as soon as you save the target page the whole content is copied to it: it will be evaluated only once. There will be no trace of the transclusion after that. Place the shortcut subst:, then the full page name wrapped in double curly brakets.

{{subst:Locus Point}}

You will see the exact content of the page Locus Point at the time of this writing

For more infos about Substitution visit Substitution on Meta.

Templates

(To do)

Advanced

There is so much one can do in a wiki. Below just some hints of the most useful tricks useful for links:

Magic words

Every mediaWiki allows a number of magic words to be used. Magic words resolve to predefined actions or text snippets. Most of them are meant to be used in templates. Commonly used magic words useful for links are the following:

Magic word Result Explanation
{{PAGENAME}} Referencing Name of current page, all levels included if subpage.
{{SUBPAGENAME}} Referencing Name of current page, without parent page if it is a subpage.
{{NAMESPACE}} Help Name of the namespace the current page resides in.
{{FULLPAGENAME}} Help:Referencing Full name of the page, including namespace.
{{TALKSPACE}} Help talk The talk space corresponding to the current page.
{{SUBJECTSPACE}} {{ARTICLESPACE}} Help The article space corresponding to the current talk page. (this is to be used for display in a talk page. Since the present page is already in a article space the result is not so interesting.)

There are great many more magic words, if you are interested check Magic Words on Meta.

nowiki tag

Disable the automatic wiki linking through the nowiki tag:

to achieve a link to the article "Converter tables" 
write <nowiki>[[Converter tables]]</nowiki>

to achieve a link to the article Converter tables write [[Converter tables]]

This has some drawbacks from within the pre tag. Look at the source code of this section to see how the issue has been dealt with here. And try not to get too confused.

queries

A great number of url queries are supported on vcor. For example:

  • loggin in with your password
  • performing advanced mySQL searches
  • creating new sections ...

A complete explanation doesn't fit here. While the experienced user might find them very comfortable, others might be better off without. If you are interested (and this can only be true if you are planning to sysop yourself...), please follow the links below:

  • API queries currently installed API queries on vcor.
  • API introduction to queries on mediawiki.
  • official site of Yurik, the developer of the mediaWiki queries.
  • Yurik's manual page currently in the process of being obsolete (Query.php is not in use on mediaWiki 1.9), but here you'll find many useful scripts that can be adapted for your special needs: C#, JavaScript, Perl, PHP, Python, Ruby.

FIELD_MESSAGE_letooloor