User Tools

Site Tools


instikis_take_on_syntax

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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://maruku.rubyforge.org/|Maruku]], a greatly enhanced implementation which augments John Gruber’s orginal [[http://daringfireball.net/projects/markdown/syntax|Markdown syntax]] with [[http://michelf.com/projects/php-markdown/extra/|Michel Fortin’s Markdown-Extra extensions]] (tables, footnotes, definition-lists, …). It also sports a very nice [[http://maruku.rubyforge.org/proposal.html|metadata syntax]] for adding attributes (''%%id%%'', ''%%class%%'', ''%%style%%'', etc.) to the generated XHTML, which is especially useful in combination with its syntax for [[http://maruku.rubyforge.org/div.html|creating DIVs]]. 
- 
-==== Itex ==== 
- 
-With the (default) **Markdown+itex2MML** filter, you can enter equations in [[http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html|itex]], a LaTeX-like dialect. Inline and display equations are supported, as is automatic equation numbering and other such niceties. 
- 
-Here’s a simple example: 
- 
-<code> 
- \[\label 
-    ^\infty e^ d x} = \sqrt} 
- \] 
-</code> 
-produces 
- 
-[\label ^\infty e^ d x} = \sqrt} ] For more examples, see the Sandbox. 
- 
-==== Theorems ==== 
- 
-Instiki support a range of **Theorem**-like environments, modeled on [[ftp://ftp.ams.org/pub/tex/doc/amscls/amsthdoc.pdf|amsthm]]. (Indeed, the LaTeX-export is ''%%amsthm%%''-compatible.). See here for details. 
- 
-==== 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/chunk’ 
- 
-====== 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::Abstract 
- 
-<code> 
-# 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 
-</code> 
-end ~~~~~~~~~~~~~~~~~~~~~~~~ 
- 
-which is generated by 
- 
-<code> 
-~~~~~~~~~~  
-require 'chunks/chunk' 
- 
-# Contains all the methods for finding and replacing wiki links. 
-module WikiChunk 
-    include Chunk 
-       ⋮ 
-~~~~~~~~~~~~~~~~~~~~~~~~ 
-</code> 
-(Note the use of Markdown-Extra fenced code-blocks.) Here’s an example of CSS syntax-colouring 
- 
-<code> 
- body  
- 
- .skipNav  
-  
- div#Content  
-  
- a:visited  
-</code> 
-which is generated by appending 
- 
-<code> 
-     body  
-</code> 
-to a standard Markdown indented code-block. 
- 
-The syntax-colouring modes, supported in Instiki 0.18.1, are: 
- 
-<code> 
- html, xml, ruby, ansic, javascript, yaml, sqlite, css fortran 
-</code> 
-===== Wiki Syntax ===== 
- 
-==== Links ==== 
- 
-Internal Wiki links can be generated by 
- 
-<code> 
- [[Name of Page]] 
-</code> 
-or 
- 
-<code> 
- [[Name of Page|Alternate link text]] 
-</code> 
-If the page already exists (or if there’s an existing page that [[#redirecting|redirects for it]]), then the result is a link to that page. If not, then a ‘new’ page link is created. Click on the question-mark to create the new page. 
- 
-You can also link to other Webs on the same Instiki installation, using 
- 
-<code> 
- [[Name of Web:Name of Page]] 
-</code> 
-or 
- 
-<code> 
- [[Name of Web:Name of Page|Alternate link text]] 
-</code> 
-If you so choose, camel-cased words, like “HomePage” and “FileUploads”, can also generate Wiki links, turning, respectively, into [[HomePage|HomePage]] and File Uploads. Personally, I prefer to disable that feature in the Edit Web page. If you do turn it on, you can “escape” camel-cased words, preventing them from being turned into hyperlinks, by prepending a ”\”. 
- 
-==== File and Image Links ==== 
- 
-It’s easy to upload files and pictures to your Wiki. To display an uploaded image, called ''%%mypic.jpg%%'', you can use 
- 
-<code> 
- [[mypic.jpg:pic]] 
-</code> 
-or 
- 
-<code> 
- [[mypic.jpg|some alt text:pic]] 
-</code> 
-Similarly, you can link to an uploaded file, ''%%myfile.pdf%%'', with 
- 
-<code> 
- [[myfile.pdf:file]] 
-</code> 
-or 
- 
-<code> 
- [[myfile.pdf|some link text:file]] 
-</code> 
-If you are interested in the HTML5 ''%%<audio>%%'' and ''%%<video>%%'' elements, they can be, in similar fashion, created using ''%%:audio%%'' and ''%%:video%%'' links. 
- 
-==== Suppressing Wiki Syntax ==== 
- 
-<code> 
-<nowiki>...</nowiki> 
-</code> 
-protects its contents from being interpreted. Thus, you can type 
- 
-<code> 
-<nowiki>[[Not a link]]</nowiki> 
-</code> 
-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 ''%%\[\[Not a link\]\]%%''. 
- 
-==== Including Pages ==== 
- 
-You’ve probably noticed the sidebar on the pages of this Wiki. That’s achieved with via a Wiki-include 
- 
-<code> 
-[[!include Name of Page]] 
-</code> 
-==== Redirecting Links ==== 
- 
-Say you have a page named “liquor”. Now, you create a Wiki-link, ''%%[[booze]]%%''. If a page by the latter name already exists, then this Wiki-link will point to that. If no such page exists, it would normally create a “wanted page” link. But, perhaps you don’t want that. Perhaps ''%%[[booze]]%%'' should point to the “liquor” page. 
- 
-Edit the “liquor” page, and add a 
- 
-<code> 
- [[!redirects booze]] 
-</code> 
-directive to it. Now all ''%%[[booze]]%%'' links (or ''%%[[!include booze]]%%'' directives) point to the “liquor” page, instead. 
- 
-Rules: 
- 
-  - A real page always trumps a ''%%[[!redirects ...]]%%'' directive. 
-  - A page can have multiple ''%%[[!redirects ...]]%%'' directives. 
-  - When you change the name of a page, a ''%%[[!redirects Old Name]]%%'' directive is added to the page, so that existing Wiki-links will continue to function. (Of course, you can remove it, if you wish.) 
-  - 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 ''%%markdown="1"%%'' attribute. 
- 
-~~~~~~~~~~ 
- 
-This is **very** good. 
- 
- 
-~~~~~~~~~~~~~~~~~~~~~~~~ 
-is rendered as 
- 
-> This is **very** good. 
- 
- 
- 
- 
- 
- 
- 
- 
- 
  
instikis_take_on_syntax.1574080456.txt.gz · Last modified: 2019/11/18 13:34 by 127.0.0.1