The reference to the wiki syntax for Google Code projects
Restrict-AddWikiComment-Commit Wiki Syntax
IntroductionEach wiki page is stored in a .wiki file under the /wiki directory in a project's repository. Each file's name is the same as the wiki page name. And, each wiki file consists of optional pragma lines followed by the content of the page. PragmasOptional pragma lines provide metadata about the page and how it should be displayed. These lines are only processed if they appear at the top of the file. Each pragma line begins with a pound-sign (#) and the pragma name, followed by a value.
Wiki-style markupParagraphsUse one or more blank lines to separate paragraphs. Typeface
You can mix these typefaces in some ways:
CodeIf you have a multiline code block that you want to display verbatim, use the multiline code delimiter: {{{ Which results in: def fib(n): For more control over the syntax higlighting, the <code> tag allows you to specify a file extension: <code language="xml"> To disable highlighting entirely, use the <pre> tag. Headings= Heading = DividersFour or more dashes on a line by themselves results in a horizontal rule. ListsGoogle Code wikis support both bulleted and numbered lists. A list must be indented at least one space to be recognized as such. You can also nest lists one within the other by appropriate use of indenting: The following is: The following is:
QuotingBlock quotes place emphasis on a particular extract of text in your page. Block quotes are created by indenting a paragraph by at least one space: Someone once said: Someone once said: This sentence will be quoted in the future as the canonical example of a quote that is so important that it should be visually separate from the rest of the text in which it appears. LinksLinks are central to the wiki principle, as they create the web of content. Google Code wiki permits both internal (within the wiki) and external links, and in some cases automatically creates a link when it recognizes either a WikiWord or an URL. Internal wiki linksInternal links within a wiki are created using the syntax below. If you add a wiki link to a page that does not exist, the link will appear with a LittleLink? to project committers and owners. Clicking that link will take you to the page creation form where you can enter content for that page. If you are not logged in, wiki links that point to non-existent pages will appear as plain text, without the link to the page creation form. When you create the target page, the link will become a normal hyperlink for all viewers of the page. WikiSyntax is identified and linked automatically WikiSyntax is identified and linked automatically Wikipage is not identified, so if you have a page named Wikipage you need to link it explicitly. If the WikiSyntax page is actually about reindeers, you can provide a description, so that people know you are actually linking to a page on reindeer flotillas. If you want to mention WikiSyntax without it being autolinked, use an exclamation mark to prevent linking. Links to anchors within a pageEach heading defines a HTML anchor with the same name as the heading, but with spaces replaced by underscores. You can create a link to a specific heading on a page like this: [WikiSyntax#Wiki-style_markup] And it will render as: WikiSyntax#Wiki-style_markup. Links to issues and revisionsYou can easily link to issues and revisions using the following syntax.
There is currently no way to disable this type of autolinking. See issue 996. For example: Please add a comment on issue 123 rather than adding more review comments to r456. Renders as: Please add a comment on issue 123 rather than adding more review comments to r456. Links to external pagesYou can of course link to external pages from your own wiki pages, using a syntax similar to that for internal links: Plain URLs such as http://www.google.com/ or ftp://ftp.kernel.org/ are Plain URLs such as http://www.google.com/ or ftp://ftp.kernel.org/ are automatically made into links. You can also provide some descriptive text. For example, the following link points to the Google home page. You can also make the image into a link, by setting the image URL as the description of the URL you want to link: [http://code.google.com/ http://code.google.com/images/code_sm.png]
Links to imagesIf your link points to an image (that is, if it ends in .png, .gif, .jpg or .jpeg), it will get inserted as an image into the page: http://code.google.com/images/code_sm.png
If the image is produced by a server-side script, you may need to add a nonsense query string parameter to the end so that the URL ends with a supported image filename extension. http://chart.apis.google.com/chart?chs=200x125&chd=t:48.14,33.79,19.77|83.18,18.73,12.04&cht=bvg&nonsense=something_that_ends_with.png
TablesTables are created by entering the content of each cell separated by || delimiters. You can insert other inline wiki syntax in table cells, including typeface formatting and links. || *Year* || *Temperature (low)* || *Temperature (high)* ||
HTML supportTo aid in the presentation of a wiki page there is some support for HTML. HTML tags are only supported in wiki pages, not in page comments. HTML syntax can be used in conjunction with wiki syntax, but it is recommended against doing so where possible. The following HTML tags and attributes are currently supported:
[1] The language attribute of the code tag is the file extension of the language used in the code block. It is used as a hint for the syntax highlighter. Escaping HTML TagsWhen you want to display html tags directly on your wiki page (as opposed to rendered), you will need to escape each HTML tag. HTML tags can be escaped as shown in the table below:
CommentsThe wiki supports embedded comments to help explain the contents of a wiki page. Anything inside the comment block is removed from the rendered page, but is visible when editing or viewing the source for that page. <wiki:comment> +1 ButtonUse <g:plusone></g:plusone> to add a +1 button to the page. Example: <g:plusone size="medium"></g:plusone> The count, size, and href parameters are supported; see http://code.google.com/apis/+1button/ for documentation. GadgetsYou can embed Gadgets on your wiki pages with the following syntax: <wiki:gadget url="http://example.com/gadget.xml" height="200" border="0" /> Valid attributes are:
WorkingWithGoogleGadgets describes how to create gadgets for Google Code. It also provides a few helpful suggestions that can make it easier to publish gadgets and to integrate with other Google products such as iGoogle. InterestingDeveloperGadgets shows some sample gadgets you may want to include on your project pages. VideosYou can embed videos with the following syntax: <wiki:video url="http://www.youtube.com/watch?v=3LkNlTNHZzE"/> Valid attributes are:
Right now we support videos from Youtube and Google Video, but other containers can be added to our open source gadgets project. NavigationTable of ContentsAn inline table of contents can be generated from page headers on a wiki page. Add the following syntax to a page in the location the table of contents should be displayed: <wiki:toc max_depth="1" /> Valid attributes are:
Side navigationYou can specify the sidebar for a wiki page by selecting another wiki page that defines your side navigation. The doctype project uses the sidebar extensively across its wiki. One way of adding a sidebar is by setting the #sidebar pragma, as shown below. Alternatively, the sidebar pragma can be left blank if no side navigation is desired.
The side navigation that is defined should be in the format of a simple list, as shown below. * [Articles HOWTO articles] A default sidebar page can also be specified for all wiki pages by project owners through the Wiki settings in the Administer tab. If a #sidebar pragma is also specified, it will take precedence on the page. Localizing Wiki ContentAlong with the default language for the wiki, which can be set through the Wiki settings in the Administer tab, additional languages are also supported. If more than one language is available, based on a user's language preference (e.g. browser language), the wiki will try to serve the page for the appropriate language. If no wiki page exists for that language, it will fall back to the default language. Comments, however, are shared amongst all translations of a wiki page. New translations for a page cannot be added through the web interface and have to be added through the Subversion repository. To add a translation of a page, first checkout the wiki from Subversion: Then create a new directory under /wiki/ using the two letter ISO-639 code as the name of that directory. Place all translated files in the new directory and submit those changes to the Subversion repository. The following is an example of a valid wiki directory: wiki/ Once the files been be submitted to the project's subversion repository, they can now be edited through the wiki's web editor. The process is the same for Mercurial or Git projects, except that the wiki lives in the root directory (not wiki/) of https://wiki.yourproject.googlecode.com/hg/ or https://wiki.yourproject.googlecode.com/git/. Note: The wiki accepts a subset of ISO-639 two letter language codes, where a few of the codes (such as zh_Hans) contain locale-specific codes. Such locale-specific codes should use a hyphen (zh-Hans) separator. A few example language codes have been specified in the table below.
The content on this page created by Google is licensed under the Creative Commons Attribution 3.0 License. User-generated content is not included in this license. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||