ROSE Compiler Framework/Sandbox

From Wikibooks, open books for an open world
Jump to navigation Jump to search
ROSE_Compiler_Framework/name of the page

.


Some common tricks to write things on wikibooks/wikipedia (both are using the mediawiki software).

How to create a new page[edit | edit source]

Usually you have to start a new page from an existing wikipage.

Go to the wiki page you want to have a link to the new page you want to create

  • click the edit tab the existing page
  • at the place you want to have a link to the new page, use
     [[ROSE_Compiler_Framework/name of the page]]
    .
  • If there is already a page with the desired name. It will become a link to the page.
  • If not, the link is red so you can click the red link to enter editing model to add content to the page.

Please link the new page to the print version of this wikibook so it can be visible in the print out.

How to do XYZ in wiki?[edit | edit source]

The best way is to goto en.wikipedia.com and find a page with the output you want. Then pretend to edit the page (by clicking edit) to see the source used to generate the output.

For example, you want to know how C++ syntax highlighting is obtained in wikibook. Go to en.wikipedia.com and find the page for C++. There must be sample code snippet.

Then you pretend to edit it to see the source: http://en.wikipedia.org/w/index.php?title=C%2B%2B&action=edit&section=6

You will see the source code generating the syntax highlighting:

<syntaxhighlight lang="cpp">

# include <iostream>

int main()
{
   std::cout << "Hello, world!\n";
}
</syntaxhighlight>

How to add comments which are only visible to editor, not readers of a page?[edit | edit source]

Use the HTML comments: for example, the following comment will not show up in the paper rendered. But it is visible to editor to reminder why things are done in certain way.

<!-- Please keep the pixel size to 400 so they are clean in the pdf version, Thanks!  -->
[[File:Rose-compiler-code-review-1.png|thumb|400px|Code review using github.llnl.gov]]

Syntax highlighting[edit | edit source]

Copied from http://en.wikipedia.org/w/index.php?title=C%2B%2B&action=edit&section=6

<syntaxhighlight lang="cpp">

# include <iostream>

int main()
{
   std::cout << "Hello, world!\n";
}
</syntaxhighlight>

Can generate the following highlighted code:

# include <iostream>

int main()
{
   std::cout << "Hello, world!\n";
}

Math formula[edit | edit source]

You can pretend to edit this section to see how math formula are written.

More resources are at