This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
instikis_take_on_syntax [2019/11/18 13:34] 127.0.0.1 external edit |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Instikis take on Syntax ====== | ||
- | |||
- | //Could not include contents// | ||
- | ===== Markdown ===== | ||
- | |||
- | Instiki sports a variety of markup options, but the main one for use with mathematics (that’s why you’re here, after all) is Markdown. | ||
- | |||
- | The Markdown implementation is based on [[http:// | ||
- | |||
- | ==== Itex ==== | ||
- | |||
- | With the (default) **Markdown+itex2MML** filter, you can enter equations in [[http:// | ||
- | |||
- | Here’s a simple example: | ||
- | |||
- | < | ||
- | | ||
- | ^\infty e^ d x} = \sqrt} | ||
- | \] | ||
- | </ | ||
- | produces | ||
- | |||
- | [\label ^\infty e^ d x} = \sqrt} ] For more examples, see the Sandbox. | ||
- | |||
- | ==== Theorems ==== | ||
- | |||
- | Instiki support a range of **Theorem**-like environments, | ||
- | |||
- | ==== Syntax Colouring ==== | ||
- | |||
- | The Markdown filters also support syntax-colouring of code blocks. Ruby and (X)HTML flavours are supported. | ||
- | |||
- | Here’s an example of Ruby syntax-colouring: | ||
- | |||
- | ~~~~~~~~~~ require ‘chunks/ | ||
- | |||
- | ====== Contains all the methods for finding and replacing wiki links. ====== | ||
- | |||
- | module WikiChunk include Chunk | ||
- | |||
- | # A wiki reference is the top-level class for anything that refers to # another wiki page. class WikiReference < Chunk:: | ||
- | |||
- | < | ||
- | # Name of the referenced page | ||
- | attr_reader :page_name | ||
- | |||
- | # Name of the referenced page | ||
- | attr_reader :web_name | ||
- | |||
- | # the referenced page | ||
- | def refpage | ||
- | @content.web.page(@page_name) | ||
- | end | ||
- | </ | ||
- | end ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
- | |||
- | which is generated by | ||
- | |||
- | < | ||
- | ~~~~~~~~~~ | ||
- | require ' | ||
- | |||
- | # Contains all the methods for finding and replacing wiki links. | ||
- | module WikiChunk | ||
- | include Chunk | ||
- | ⋮ | ||
- | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
- | </ | ||
- | (Note the use of Markdown-Extra fenced code-blocks.) Here’s an example of CSS syntax-colouring | ||
- | |||
- | < | ||
- | | ||
- | |||
- | | ||
- | |||
- | | ||
- | |||
- | | ||
- | </ | ||
- | which is generated by appending | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | to a standard Markdown indented code-block. | ||
- | |||
- | The syntax-colouring modes, supported in Instiki 0.18.1, are: | ||
- | |||
- | < | ||
- | html, xml, ruby, ansic, javascript, yaml, sqlite, css fortran | ||
- | </ | ||
- | ===== Wiki Syntax ===== | ||
- | |||
- | ==== Links ==== | ||
- | |||
- | Internal Wiki links can be generated by | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | or | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | If the page already exists (or if there’s an existing page that [[# | ||
- | |||
- | You can also link to other Webs on the same Instiki installation, | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | or | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | If you so choose, camel-cased words, like “HomePage” and “FileUploads”, | ||
- | |||
- | ==== File and Image Links ==== | ||
- | |||
- | It’s easy to upload files and pictures to your Wiki. To display an uploaded image, called '' | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | or | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | Similarly, you can link to an uploaded file, '' | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | or | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | If you are interested in the HTML5 '' | ||
- | |||
- | ==== Suppressing Wiki Syntax ==== | ||
- | |||
- | < | ||
- | < | ||
- | </ | ||
- | protects its contents from being interpreted. Thus, you can type | ||
- | |||
- | < | ||
- | < | ||
- | </ | ||
- | and have it appear as [[Not a link]]. At least in this case, the same effect can be achieved using backslashes for escaping, i.e., by typing '' | ||
- | |||
- | ==== Including Pages ==== | ||
- | |||
- | You’ve probably noticed the sidebar on the pages of this Wiki. That’s achieved with via a Wiki-include | ||
- | |||
- | < | ||
- | [[!include Name of Page]] | ||
- | </ | ||
- | ==== Redirecting Links ==== | ||
- | |||
- | Say you have a page named “liquor”. Now, you create a Wiki-link, '' | ||
- | |||
- | Edit the “liquor” page, and add a | ||
- | |||
- | < | ||
- | | ||
- | </ | ||
- | directive to it. Now all '' | ||
- | |||
- | Rules: | ||
- | |||
- | - A real page always trumps a '' | ||
- | - A page can have multiple '' | ||
- | - When you change the name of a page, a '' | ||
- | - Instiki automatically does HTTP 301 Redirects for redirected pages, so that (for instance) external links won’t break when you rename a page. | ||
- | |||
- | ===== XHTML ===== | ||
- | |||
- | If, for whatever reason, the extended Markdown syntax, and Wiki syntax, are not rich enough to express what you want, you can always include XHTML in your page. Note that Markdown processing is disabled inside XHTML. Thus | ||
- | |||
- | ~~~~~~~~~~ | ||
- | |||
- | This is %%**%%very%%**%% bad. | ||
- | |||
- | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
- | is rendered as | ||
- | |||
- | > This is %%**%%very%%**%% bad. | ||
- | |||
- | If you want to mix XHTML and Markdown syntax, include the '' | ||
- | |||
- | ~~~~~~~~~~ | ||
- | |||
- | This is **very** good. | ||
- | |||
- | |||
- | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
- | is rendered as | ||
- | |||
- | > This is **very** good. | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||