From 580b73b9200700043205df3c250712d1c8350321 Mon Sep 17 00:00:00 2001 From: Brian Becker Date: Tue, 20 Sep 2016 01:39:21 -0400 Subject: [PATCH] Update chosen to v1.6.2 jsSHA sample MarkAPL update to v1.8.4 --- Config/Resources.xml | 5 + Config/Virtual.xml | 2 +- Documentation Sources/MarkAPL.html | 3139 +++++++++++++++++ PlugIns/Dyalog/Panel/Panel.css | 79 - .../{chosen-1.6.1 => chosen-1.6.2}/LICENSE.md | 0 .../{chosen-1.6.1 => chosen-1.6.2}/README.md | 0 .../chosen-sprite.png | Bin .../chosen-sprite@2x.png | Bin .../chosen-tools.js | 0 .../chosen.jquery.min.js | 2 +- .../chosen.min.css | 2 +- SampleMiSites/MS3/Documentation/MarkAPL.html | 3139 +++++++++++++++++ .../MS3/Examples/DC/MarkdownSimple.mipage | 19 +- .../MS3/Examples/JS/jsSHASimple.mipage | 31 + Utils/HTTPCommand.dyalog | 11 +- Utils/MarkAPL.dyalog | 39 +- 16 files changed, 6364 insertions(+), 104 deletions(-) create mode 100644 Documentation Sources/MarkAPL.html delete mode 100644 PlugIns/Dyalog/Panel/Panel.css rename PlugIns/Other/{chosen-1.6.1 => chosen-1.6.2}/LICENSE.md (100%) rename PlugIns/Other/{chosen-1.6.1 => chosen-1.6.2}/README.md (100%) rename PlugIns/Other/{chosen-1.6.1 => chosen-1.6.2}/chosen-sprite.png (100%) rename PlugIns/Other/{chosen-1.6.1 => chosen-1.6.2}/chosen-sprite@2x.png (100%) rename PlugIns/Other/{chosen-1.6.1 => chosen-1.6.2}/chosen-tools.js (100%) rename PlugIns/Other/{chosen-1.6.1 => chosen-1.6.2}/chosen.jquery.min.js (99%) rename PlugIns/Other/{chosen-1.6.1 => chosen-1.6.2}/chosen.min.css (99%) create mode 100644 SampleMiSites/MS3/Documentation/MarkAPL.html create mode 100644 SampleMiSites/MS3/Examples/JS/jsSHASimple.mipage diff --git a/Config/Resources.xml b/Config/Resources.xml index 37c36960..5bd9e4ed 100644 --- a/Config/Resources.xml +++ b/Config/Resources.xml @@ -462,6 +462,11 @@ + chosen JQuery diff --git a/Config/Virtual.xml b/Config/Virtual.xml index 55526a4e..759ec439 100644 --- a/Config/Virtual.xml +++ b/Config/Virtual.xml @@ -45,6 +45,6 @@ chosen - %ServerRoot%/PlugIns/Other/chosen-1.6.1/ + %ServerRoot%/PlugIns/Other/chosen-1.6.2/ \ No newline at end of file diff --git a/Documentation Sources/MarkAPL.html b/Documentation Sources/MarkAPL.html new file mode 100644 index 00000000..7d48a571 --- /dev/null +++ b/Documentation Sources/MarkAPL.html @@ -0,0 +1,3139 @@ + + + + + +MarkAPL + + + + + +

MarkAPL

+
+ + +

1. Overview

+
+ +

1.1. What is Markdown?

+
+

Markdown — which is much better readable and therefore much better maintainable than HTML — can be transformed into HTML.

+

Because of its advantages over HTML and because the rules are easy to learn, Markdown became ubiquitous: many of the big names are using it now. Examples are StackFlow, Git, SourceForge and Trello. Wiki engines have also started to adopt the concept.

+ +

1.2. Is there a Markdown standard?

+
+

Yes and no. The original implementation by John Gruber had no specification at all, just a Perl script and test cases. Unfortunately it was also quite buggy. Gruber has not put work into developing his brain child. Some consider the original Markdown therefore abandonware[1].

+

Because of the bugs, some ambiguities and the lack of much needed features several flavours of an enhanced Markdown evolved, the most important ones being Git-flavoured Markdown, Markdown Extra and PanDoc's Markdown.

+ +

1.3. What is MarkAPL?

+
+

MarkAPL is an APL program that converts (extended) Markdown into valid HTML5.

+ +

1.4. MarkAPL, Markdown, Markdown Extra and CommonMark

+
+

CommonMark [2] is an attempt to establish a standard for Markdown.

+

MarkAPL aims to implement the original Markdown specification with very few exceptions. It also aims to implement most — but not all — of the Markdown Extra enhancements. Finally it also aims to follow the CommonMark specification as far as it seems to be reasonable.

+

In addition MarkAPL offers several enhancements that might be particularly useful to APLers and don't hurt otherwise. However, if compatibility is paramount then you must not use them.

+

For example, any lines that start with an APL lamp symbol () — except in a code block of course — are considered comment lines which won't contribute to the output at all.

+

For a full list see the next chapter.

+ +

1.5. Preconditions

+
+

MarkAPL needs Dyalog APL version 14.0 or better.

+ +

2. Compatibility, features, bugs

+
+ +

2.1. Standard compliance

+
+ +

2.1.1. Intentional differences

+
+ + +

2.1.2. Not implemented

+
+ + +

2.2. Enhancements

+
+ + +

2.3. Known bugs

+
+

See http://aplwiki.com/MarkAPL/ProjectPage

+ +

3. Reference

+
+ +

3.1. Mark-up

+
+ +

3.1.1. Overview

+
+

The following table categorizes the different mark-ups into “Standard”, “Extra”, “Pandoc” and “MarkAPL”. A single line might carry more than on X in case it got enhanced.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name Standard Extra Pandoc MarkAPL
AbbreviationsXX
Automated linksXXXX
BlockquotesXXXX
Calling functionsX
Code blocks (indented)XXX
Code blocks (fenced)XXX
Definition listsXXXX
FootnotesXXXX
HeadersXXXX
HTML blocksXXXX
HRXXXX
ImagesXXXX
Inline markupXXXX
Line breaks (two spaces)XXX
Line breaks (\)XX
Line breaks (<<br>>)X
LinksXXXX
Link referencesXXXX
ListsXXXX
Loose/tight listsXXX
Markdown inside HTMLXX
ParagraphsXXXX
TablesXXXX
Table of contents (TOC)XX
Sub TOCX
Smart typographyXX
Special attributesXXX
+

Note that “Code blocks (indented)” don't carry an X in the “MarkAPL” column because marking up a code block by indenting is deliberately not implemented in MarkAPL.

+

The implementation of Definition lists comes with some restrictions; see there.

+ +

3.1.2. Comments

+
+

Any line that starts with an APL lamp symbol () is ignored. That means that the line won't make it into the resulting HTML at all.

+

This is true for any line that is not part of a code block, including lines that are part of a paragraph.

+

Example:

+
Start of a para that contains
+⍝ Ignored
+a commented line.
+

This is the result:

+

Start of a para that contains a commented line.

+ +

3.1.3. Abbreviations

+
+

Abbreviations can be defined anywhere in the document. This is the syntax:

+
*[HTML] Hyper Text Markup Language
+

All occurrences of “HTML” within the Markdown document — except those marked as code — are then marked up like this:

+

<abbr title="Hyper Text Markup Language">HTML</abbr>

+

Therefore this:

+
*[Abbreviations]: Text is marked up with the <abbr> tag
+

should show the string “Text is marked up with the <abbr> tag” when you hover over the word “Abbreviations”.

+

Notes:

+ + +

3.1.4. Blockquotes

+
+

Markdown — and therefore MarkAPL — uses the > characters for block quoting. If you’re familiar with quoting passages of text in an email message then you know how to create a block quote in Markdown. It looks best if you hard wrap the text and put a > before every line:

+
> This is a blockquote with one paragraph. Lorem ipsum dolor sit amet,
+> consec tetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+> Vestibulum enim wisi, _viverra_ nec, fringilla **in** risus.
+> 
+> Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet velit. Suspendisse
+> id sem consectetuer libero luctus adipiscing.
+> 
+> > Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet velit. Suspendisse
+> id sem consectetuer libero luctus adipiscing.
+

This is the result:

+
+

This is a blockquote with one paragraph. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in risus.

+

Donec sit amet nisl. Aliquam (+/⍵)÷⍴,⍵ semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.

+
+

Donec sit amet nisl. Aliquam (+/⍵)÷⍴,⍵ semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.

+
+
+

However, MarkAPL allows you to be lazy and only put the > before the first line of a paragraph:

+
> This is a **lazy** blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+
+> Second para.
+

This is the result:

+
+

This is a lazy blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in.

+
+
+

Second para.

+
+

Note that blockquotes are not restricted in any respect: they may contain paragraphs, tables, lists, headers and blockquotes. However, headers are not numbered and do not have anchors attached, and any <<SubTOC>> directives are removed from a blockquote.

+ +

3.1.5. Code blocks

+
+

According to the original Markdown specification any lines indented by 4 characters were considered a code block. Apart from not being particularly readable this caused problems with nested lists and code blocks within lists. Therefore later a convention called “fencing” was introduced.

+

MarkAPL goes a step further: to avoid confusion indenting is not supported for marking up code blocks.

+

Code blocks can be marked up in two different ways:

+ +
3.1.5.1. Fencing
+
+

You can use the “Git” style with three — or more — back-ticks as shown here:

+
```
+This is a block ...
+of code!
+```
+

You can use the Markdown Extra specification with three — or more — tildes:

+
~~~
+This is a another block ...
+of code!
+~~~
+

You don't have to have empty lines around fenced code blocks but you might find that such lines help to improve readability.

+

Notes:

+ + +
3.1.5.2. Code: the <pre> tag
+
+

You can also mark a block of text with the HTML <pre> tag. For example, this can be useful in order to show the fencing characters as part of the code.

+

If you must assign an ID or a class or any styling stuff to the <pre> tag of a code block you must do this:

+
<pre id="foo" class="my">
+...
+</pre>
+

There is no other way since assigning a special attribute to a fenced block as shown here:

+
~~~ {#foo}
+...
+~~~
+

does assign the attributes not to the <pre> tag but to the inner <code> element:

+
<pre><code id="foo">
+...
+</code></pre>
+

Notes:

+ +
<pre><code>
+
+Second line
+Last but one line
+
+</code></pre>
+ +

3.1.6. Definition lists

+
+

Definition lists are made of terms and definitions of these terms, much like in a dictionary. If there is a blank line between the term and the definition then the definition is enclosed between a <p> tag. However, if there are sub-definitions (see below) then all definitions are enclosed between <p> tags.

+

A definition can span more than one paragraph, but they must be indented by as many spaces as there are in front of the “:” (maximum of three) plus two for the colon itself and the following space to be recognized as being a definition. Such sub-definitions are always enclosed between <p> tags.

+

Definition lists break at two consecutive empty lines or anything that is neither a term and not indented according to the rules that define a definition. Having the two empty lines in place to break a definition list is recommended because it's faster.

+

Between the left margin and the colon there may be up to 3 spaces. After the colon there must be exactly one space.

+

Simple example:

+
Term
+: The definition
+

This is the result:

+
+
Term
+
The definition
+
+

The resulting HTML:

+
<dl>
+<dt>Term</dt>
+<dd>The definition</dd>
+</dl>
+

No <p> tags here because there is no blank line between the term and its definition.

+

More complex example:

+
Term 1
+
+   : The definition
+
+   : More information
+     that spans over
+     three lines
+
+Term 2
+    : Another definition
+
+    : Additional information
+

This is the result:

+
+
Term 1
+

The definition

+

More information that spans over three lines

+
Term 2
+

Another definition

+

Additional information

+
+

The resulting HTML:

+
<dl>
+<dt>Term 1</dt>
+<dd><p>The definition</p></dd>
+<dd><p>More information that spans over three lines</p></dd>
+<dt>Term 2</dt>
+<dd>Another definition</dd>
+<dd><p>Additional information</p></dd>
+</dl>
+

Restrictions:

+ + +

3.1.7. Footnotes

+
+

Footnotes can be created by [^1] or [^foo]. The footnote 1 and foo can be defined anywhere in the document. Footnotes cannot contain anything but paragraphs: no code blocks, lists, blockquotes or tables. In-line mark-up is of course available.

+

The format of the definition [^footnote]:

+
[^single]: The definition of a single-line footnote.
+
+[^footnote]: A multi-line definition.
+  As long as the following paras are indented by two spaces they are considered part of the footnote.
+  
+  Even empty lines don't interrupt the definition, although two do. In-line formatting **is** of course supported. 
+

Notes:

+ + +

3.1.8. Headers

+
+

There are two ways to mark up headers, and both are part of the original Markdown specification:

+ +
3.1.8.1. The “=” and “-” syntax (SeText)
+
+

With this syntax you can only define headers of level 1 and 2.

+

A line that looks like this:

+
Main caption
+============
+

is converted into a header of level 1.

+

Note that it does not matter how many = chars are used.

+

As long as the first character on a line is a = and there are no other characters or they are all spaces it will be recognized as a level-1 header.

+

Similarly a line that looks like this:

+
Header of level 2
+-------------------
+

is converted into a header of level 2.

+

Again it does not matter how many hyphens are used. As long as the first character on a line is a hyphen and there are no other characters or they are all spaces it will be recognized as a level-2 header.

+

However, since a single - can also start a bulleted list it is strongly recommended to use at least two (--) characters.

+

Note that the definition of a header might well span several lines like this:

+
This is a 
+level 1
+header
+=====
+

Generally no blank line is required either before or after such a header but because a SeText header cannot interrupt a paragraph it is necessary to have a blank line between the end of a paragraph and a SeText header.

+ +
3.1.8.2. The “pound” syntax (ATX)
+
+

A line that looks like this:

+
# My caption
+

is converted into a header of level 1 while a line that looks like this:

+
###### My caption
+

is converted into a header of level 6. You cannot have headers of level 7 or higher (HTML does not allow this), and it is probably not a good idea to use levels beyond 4 anyway, except perhaps in technical documentation.

+

Many Markdown implementations do not require a space between the last # on the left and the content (= the header as such). However, the space was required even by the original Markdown specification. The CommonMark specification points out that this was actually a good idea because with the blank these two lines would be rendered as headers:

+
#5 bolt
+
#hashtag
+

Note that you may have trailing # characters as well; however, they are simply ignored. That's the reason why the number of characters does not even have to match the leading number of #.

+ +
3.1.8.3. ATX versus SeText syntax
+
+ + +
3.1.8.4. Headers and bookmarks
+
+

By default MarkAPL automatically embraces headers (<h{number}>) by bookmark anchors. Use parms.bookmarkLink (default: 6 = all levels) to change this: setting this to 0 suppresses this. You can also assign a number lesser than 6. For example, assigning 3 means that all headers of level 1, 2 and 3 are embraced by bookmark anchors but any headers of level 4, 5 and 6 are not.

+

The names of the bookmarks are constructed automatically according to this set of rules:

+ +

Example:

+

The caption “Second level-2 ”Header!“” becomes “header-second-level-2-header”.

+

This is the result with parms.bookmarkLink←1:

+
<a id="header-second-level-2-header" class="autoheaderlink" 
+<h1>Second level-2 "Header!"</h1> 
+</a>
+

Note that the class autoheaderlink is automatically assigned to all bookmark links. This is needed because you probably want to make them invisible via CSS.

+

With parms.bookmarkLink←0 however it is just this:

+
<h1>Second level-2 "Header!"</h1>
+ +
3.1.8.5. Headers and special attributes
+
+

Note that assigning Special Attributes has special rules:

+ + +

3.1.9. HTML blocks

+
+

Please note that there are three different HTML blocks:

+ +

Note that all HTML blocks but <pre>, <script> and <style> must be surrounded by blank lines.

+

It is perfectly legal to have HTML blocks in a Markdown document but be aware that this is way more complex a topic than it seemed to be at first glance.

+

For details refer to http://spec.commonmark.org/0.24/#html-blocks.

+

The most important syntax is when you want to have an opening tag like a <div> and a corresponding </div> around some Markdown stuff. For simplicity let's assume that it is just a paragraph with a single word: “foo” in bold.

+

An HTML block must always start with either < or </:

+
# Example demonstrating HTML blocks
+
+<div id="123" class="myClass">
+
+**foo**
+
+</div>
+
+Another paragraph.
+

Notes:

+
    +
  1. This example comprises two (!) HTML blocks. +
  2. The beginning of a block is defined by an empty line followed by a line that starts with either < or </ followed by a tag name. That means that leading white space is important because it prevents a line from being recognized as an HTML block. +
  3. The end of each HTML block (except <pre>, <script>, <style>) is defined by an empty line which therefore is essential. +
  4. Because **foo** is an ordinary paragraph located between two HTML blocks it will be converted into <strong>foo</strong>. +
+

Without the two empty lines around the paragraph it would be just one HTML block. As a side effect the paragraph would show **foo** rather than foo because within an HTML block no in-line Markdown is recognized.

+

The <pre> blocks are different in so far as there is no Markdown styling done to anything between <pre> and </pre> anyway; therefore you can have just one block without any disadvantages.

+ +

3.1.10. Horizontal rulers

+
+

You can create a horizontal ruler by following these rules:

+
    +
  1. After an empty line there must be a line with either a hyphen (-) or an asterisk (*) or an underscore (_). +
  2. There must be at least three such characters on the line. +
  3. There might be zero to a maximum of three white space character to the left of the characters defining the ruler. +
  4. There are no other characters but spaces allowed, with the exception of Special Attributes. +
+

So these lines will all create a ruler:

+
---
+* * * * * *
+_ _    _
+   ***
+

The result:

+
+
+
+
+

A common mistake is to forget the empty line required before the definition of a ruler because that might actually define a SeText header.

+ +

3.1.11. Images

+
+

Images are implemented so that an image can be included into a paragraph, a list or a table cell. If you want an image outside such an element then you are advised to insert it as HTML block with an <img> tag.

+

The syntax of Markdown-images is of limited use because you cannot specify either height or width. However, with Special attributes one can get around this limitation.

+

The full syntax:

+
![Alt Text](/url "My title")
+

Because the title is optional this is a valid specification as well:

+
![Alt Text](/url)
+

Finally the “alt” text is optional as well, so this would do:

+
![](/url)
+

However if you specify “alt” but not “title” or “title” but not “alt” then the undefined bit will show the same contents as the defined one.

+

In order to add special attributes use this syntax:

+
![Alt Text](/url "My title"){#foo .myclass style="color:red;"}
+

There must not be any white-space between the closing { and the opening {.

+

Example:

+
![Dots](http://download.aplteam.com/APL_Team_Dots.png "APL Team' dots"){height="70" width="70"}
+

Dots

+ +

3.1.12. In-line mark up

+
+

First of all, all in-line mark up does not touch code (in-line as well as blocks) and to some extend links: they can be marked as code.

+ + +
3.1.12.1. Emphasize with <em>
+
+

To mark some text as <em> you can enclose that text either with ** or with __.

+

Therefore the following two lines are equivalent:

+
This is an **ordinary** paragraph.
+This is an __ordinary__ paragraph.
+

This is the result in any case:

+

This is an ordinary paragraph.

+

Notes:

+ + +
3.1.12.2. Emphasize with <strong>
+
+

To mark some text as <strong> you can enclose that text either with * or with _.

+

Therefore the following two lines are equivalent:

+
This is an *ordinary* paragraph.
+This is an _ordinary_ paragraph.
+

This is the result in any case:

+

This is an ordinary paragraph.

+

Notes:

+ +

If you need a leading underscore as part of a name then you must escape the underscore with a backslash. This:

+
\_VarsName
+

leads to this:

+

_VarsName

+ +
3.1.12.3. Strike-through with <del>
+
+

To mark some text with <del> you can enclose that text with ~~:

+
This ~~is~~ was an ordinary paragraph.
+

This is the result:

+

This is was an ordinary paragraph.

+

Note that to the right of any opening ~~ and to the left of any closing ~~ there must be a non-white-space character.

+ +
3.1.12.4. Line breaks
+
+

There are two different ways to enforce a line break (= inserting a <br/> tag) into paragraphs, lists, footnotes and table cells:

+ +

Having two blanks at the end of a paragraph or list item is according to the Markdown implementation — and also the early versions of MarkAPL — designed to inject a line break. This caused bug reports by people who accidentally added two spaces to the end of a line without realizing and then started to wonder where exactly the line break was coming from. It seemed to be a bad idea from the start; therefore this feature was removed from MarkAPL in version 1.3.0.

+ +
3.1.12.5. In-line code (verbatim)
+
+

You can insert code samples into paragraphs, blockquotes, lists, cells and footnotes by putting back-ticks around them:

+
This: `is code`
+

Note that in order to show a back-tick within code you need to double it:

+
Enclose in-line code with a back-tick character (````).
+

Note also that the number of back-ticks in a paragraph (list, cell,…) must be even. If that's not the case then a closing back-tick is added to the end. That's why this seems to work:

+
This is back-tick: ` ``
+

This is back-tick: `

+

However, adding a dot emphasizes what is really going on here:

+
This is back-tick: ` ``.
+

This is back-tick: `.

+

Since the missing back-tick is added to the end of the paragraph the dot becomes part of the code. That's probably not what you want to happen.

+ +

3.1.13. Links

+
+ + +
3.1.13.1. External links
+
+

Generally an external link looks like this:

+
[The APL wiki](http://aplwiki.com "Link to the APL wiki")
+

The result is a link like this one: The APL wiki which brings you to the APL wiki.

+

The title (that's the stuff within the double-quotes) is optional, therefore the link can also be written as:

+
[The APL wiki](http://aplwiki.com)
+

If you want the URL to become the link text then this would suffice:

+
[](http://aplwiki.com)
+

That would result in http://aplwiki.com.

+

However, see the next topic (AutoLinks) as well.

+ +
3.1.13.2. Autolinks
+
+

Because external links are often injected “as is” — meaning that they actually have no link text and no link title — you can also specify a link as:

+
<http://aplwiki.com>
+

That results is this link: http://aplwiki.com: the link text and the URL are identical.

+ +
3.1.13.3. Internal links (bookmarks)
+
+

Bookmark links are defined by a leading #. This character tells that the link points to a place somewhere in the same document.

+

The text of a bookmark link must be compiled of one or more of ⎕D,'∆⍙',⎕A,Lowercase ⎕A: All digits, all letters of the ASCII characters set, lowercase or uppercase and the two APL characters and .

+

Note that in HTML5 an ID may start with a digit. This is the default in MarkAPL as well. However, you can change this by setting bookmarkMayStartWithDigit accordingly.

+

An example of a bookmark link:

+
[Link text](#Anchor)
+

The most common internal (or bookmark) link is a link to a header. Since MarkAPL establishes anchors automatically for all headers by default you might expect an easy way to link to them, and you would be right.

+

Given this header:

+
## This is (really) chapter 5-2
+

MarkAPL transforms this automatically into

+
this-is-really-chapter-5-2
+

according to the set of rules explained at Headers and bookmarks.

+

To link to this header you can say:

+
[Link to chapter 5-2](#this-is-really-chapter-5-2)
+

and that would work indeed.

+

However, instead you could use just the chapter title and specify a # in order to let MarkAPL know that this is an internal link:

+
[This is (really) chapter 5-2](#)
+

That will result in a bookmark link as well.

+ +
3.1.13.4. Link references
+
+

Link references are defined by [ID]: url. Such definitions can appear anywhere in the document. There might be a space between the colon and the URL or not.

+

IDs must consist of one or more characters of:

+ +

Other characters are not permitted.

+

In the document you can refer to a link reference with:

+
[The APL wiki][aplwiki]
+

The text between the the first pair of square brackets is the link text, the text between the second pair of square brackets is the ID of the link reference in question.

+

If the link text is not specified then the URL becomes the link text.

+
[][aplwiki]
+

Note: in case of a typo — meaning that MarkAPL cannot find the link reference — the text will appear “as is” in the final document but the missing reference will also be reported on ns.report.

+ +
3.1.13.5. Links containing code
+
+

Note that this works:

+
[`FunctionName`](#)
+

This on the other hand does not work:

+
`[FunctionName](#)`
+

The reason is simple:

+ + +
3.1.13.6. Links and special attributes
+
+

Special Attributes can be assigned to all links:

+ + +

3.1.14. Lists

+
+ +

Lists look simple, but when they are nested and/or contain sub-paragraphs and code blocks then things can get quite complicated.

+

If your lists comprise just short single sentences then you will find lists easy and intuitive to use; otherwise you are advised to read the list of rules carefully.

+ +
3.1.14.1. General rules
+
+
    +
  1. Lists start with a blank line, followed by a line were the first non-white-space character is either one of -+* for a bulleted list or a digit followed either by a dot (.) or a parenthesis ()) for an ordered list. This is called the list marker. +
  2. If a list follows a paragraph the blank line is not needed. +
  3. A list definition — including all sub lists — breaks at two consecutive empty lines. +
  4. A list definition — including all sub lists — also breaks when after an empty line something is detected that does not carry a list marker and is not indented at all. +
  5. A change of the list marker for bulleted lists (from + to * for example) starts a new list. +
  6. Lists can be nested. +
  7. The number of leading white-space characters between the left margin and the list marker (in case of a list item itself) or content (in case of a sub-paragraph or a code block) defines the level of nesting. +

    That means that any content that is supposed to belong to a particular list item must be indented by the number of characters of the list marker plus the number of white-space characters to the left and to the right of the list marker.

    +
  8. Between a list marker and the content there might be any number of white space characters. +
  9. A list item can contain nothing but: +
      +
    • text (sometimes called initial list item content) +
    • paragraphs +
    • code blocks +
    • sub-lists +
    +
  10. If a list item contains a code block or a paragraph then there must be an empty line before the code block / paragraph. +
  11. Generally a code block may have up to three leading spaces. This rule does not apply for code blocks that are part of a list item since spaces are used as the means to work out which level the code block belongs to. +
  12. Single empty lines between list items and sub-paragraphs / code blocks belonging to a list item are ignored. +
  13. There is no concept of “loose” or “tight” lists. As a consequence the initial contents of a list item is never wrapped in a <p> tag. +
  14. Neither a code block nor a sub-paragraph can reduce the nesting level. This is only possible with a line carrying a list marker. +
+

Note that these rules differ from those from the original Markdown (which are inconsistent) and also CommanMark (which are consistent but very complex).

+

Originally MarkAPL attempted to implement the CommanMark rules. However, the first bug reports all referred to list problems, and only one was a true bug. Everything else was caused by misunderstanding those very complex rules. Therefore, starting with version 1.3.0, MarkAPL now has its own — simpler and still consistent — set of rules. With these easier to understand rules everything can be achieved but wrapping the content of a list item into a <p> tag.

+

A word of warning: getting the number of white-space characters wrong — in particular for sub-paragraphs or code blocks — is the most common reason for unwanted result. You are advised to use a monospace font since this makes it much easier to spot such problems, or to avoid them in the first place.

+ +
3.1.14.2. Bulleted lists
+
+

Bulleted — or unordered — lists can be marked by an asterisk (*), a plus (+) or a minus (-). There might by zero to three white-space characters between the left margin and the list marker. There might be any number of white-space characters between the list marker and the beginning of the contents.

+

Note that for nesting you need to have at least one more space to the left of the list marker per additional level. Although you can choose the number of spaces freely items that are supposed to end up on the same level must have the same number of leading spaces, otherwise results become unpredictable.

+

It is recommended to indent with readability in mind.

+

Example:

+
* First line
+* Second line
+  * Yellow
+  * Brown 
+    * Light brown
+    * Medium brown
+  * Magenta
+* Third line              
+
+

This results in this:

+ + +
3.1.14.3. Ordered lists
+
+

An ordered list must start with a digit followed by a dot (.) or a parentheses ()) and one or more white-space characters. The digit(s) in the first row define the starting point. For the remaining rows any digit will do. The number of digits is limited to nine because some browser cannot deal with 10.

+

There might by zero to three white-space characters between the left margin and the list marker. There might be any number of white-space characters between the list marker and the beginning of the contents.

+

Example:

+
5. First line
+5. Second line
+   1) Yellow
+   2) Brown 
+   3) Magenta
+1. Third line                          
+

This results in this:

+
    +
  1. First line +
  2. Second line +
      +
    1. Yellow +
    2. Brown +
    3. Magenta +
    +
  3. Third line +
+ +
3.1.14.4. List item contents
+
+

You may want to inject line breaks for readability, or you may not and be lazy, and you may add blanks or not; all has the same effect.

+

An example for the lazy approach:

+
* This is a list item with plenty of words.  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.
+* ...
+

The same with some line breaks:

+
* This is a list item with plenty of words.  Lorem ipsum dolor sit amet, consectetuer
+adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra
+nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` 
+semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.
+* ...
+

The same nicely formatted:

+
* This is a list item with plenty of words.  Lorem ipsum dolor sit amet,
+  consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. 
+  Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+  Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet
+  velit. Suspendisse id sem consectetuer libero luctus adipiscing.
+* ...
+

However, this would work as well:

+
* This is a list item with plenty of words.  Lorem ipsum dolor sit amet,
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+     Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae,risus.
+  Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet
+  velit. Suspendisse id sem
+            consectetuer libero luctus adipiscing.
+* ...
+

In all cases this would be the result:

+
+ +
+

Notes:

+ + +
3.1.14.5. Paragraphs and code blocks in list items
+
+

The fencing lines of code blocks as well as the first line of paragraphs that belong to a list item need to be indented by the same number of spaces as the list item they belong to. They must be separated from the initial list item contents or any earlier sub-paragraph or code block by a blank line.

+

Note that the number of leading white-space characters (indentations) of any paragraphs must match the number of white-space characters from the left margin to the beginning of the content (the list marker characters count as white space here!) of the list item the paragraph or code block is supposed to belong to.

+
1. First line
+1. Second line
+   * Yellow
+     This is **not** a paragraph.
+
+     This **is** a paragraph.
+
+     ~~~
+       {+/⍳⍴⍵}
+     ~~~
+
+   This is a paragraph that belongs to "Second line".
+   * Brown 
+   * Magenta
+1. Third line                          
+

This results in this:

+
    +
  1. First line +
  2. Second line +
      +
    • Yellow This is not a paragraph. +

      This is a paragraph.

      +
        {+/⍳⍴⍵}
      +
    +

    This is a paragraph that belongs to “Second line”.

    +
      +
    • Brown +
    • Magenta +
    +
  3. Third line +
+

Note that the code block has two leading spaces within the fence. These make it into the output while the leading spaces defining just the indentation don't.

+ +
3.1.14.6. Lists and special attributes
+
+

When Special attributes are assigned to the very first item on any list then that definition is assigned to the list (<ul> or <ol>) rather than the list item itself.

+

When Special_Attributes are assigned to other items than the first one then they are simply removed from that list item.

+ +

3.1.15. Paragraphs

+
+

Any text between two lines that are either empty or are considered special Markdown syntax and that do not have any leading character(s) recognized as Markdown directives will result in a single paragraph. The only exception is a definition list: Although the term part looks like any ordinary paragraph, the : on the next non-empty line makes it rather a definition.

+

Within a paragraph you can use in-line mark-up; see there.

+

You may insert NewLine characters (by pressing the <return> key) into a long paragraph in order to improve readability. These NewLine characters won't make it into the output. You don't have to worry about space characters at the end of a line (or at the beginning of the next line) because MarkAPL is taking care of this for you.

+

If you want to have a line break at the end of a line add a backslash to that line.

+

Alternatively you can insert <<br>> anywhere into a paragraph in order to enforce a line break; see Line breaks for details.

+

Note that the original Markdown syntax for line breaks (having two spaces at the end of a line) is not supported by MarkAPL, and for good reasons: hard to spot (if at all), likely to be inserted by accident and therefore likely to cause confusion.

+

You can assign Special attributes to a paragraph. With a multi-line paragraph, the special attribute must go into the last line as shown in this example:

+

+ Simple and not multi-line
+ paragraph {#author}
+
+

This results in this HTML:

+
<p id="author">Simple and not multi-line paragraph</p>
+

There is of course a small chance that something is interpreted as special attribute that actually is just part of the paragraph. In that case you need to escape the curly brackets with \{ and \}.

+ +

3.1.16. Tables

+
+ +
3.1.16.1. Overview
+
+

Note that table rows are defined by having at least one un-escaped pipe symbol. You may however add a leading as well as a trailing pipe symbol if you wish so. Many consider this to be more readable.

+

Note that leading and trailing spaces are removed from every cell.

+

In one respect MarkAPL goes beyond the standard: according to the Markdown specification you must have a second row with a hyphen (“-”) and the appropriate number of pipe symbols and zero, one or two colons (:) per column but MarkAPL doesn't require this: if there is no such row it assumes that the first row is not a row with column headers but an ordinary row.

+ +
3.1.16.2. Constructing tables
+
+

So valid table definitions look like this:

+
Name | Meaning  {style="margin-left:auto;margin-right:auto;"}
+-|-
+ APL  | Great
+ Cobol| Old
+ PHP| Oh dear
+

resulting in this:

+ + + + + + + + + + + + + + + + + + + + + +
Name Meaning
APLGreat
CobolOld
PHPOh dear
+

If you wonder about {style="margin-left:auto;margin-right:auto;"}: this is a simplified syntax for assigning IDs, class name(s) and attributes. This is discussed under Special attributes.

+

Here it is used to style the table with CSS so that it will be centered.

+

Another example which you might find more readable:

+
| Name  | Meaning |
+|-------|---------|
+| APL   | Great   |
+| Cobol | Old     |
+| PHP   | Oh dear |
+

resulting in this:

+ + + + + + + + + + + + + + + + + + + + + +
Name Meaning
APLGreat
CobolOld
PHPOh dear
+

Without the |-----|--------| row:

+
|Name | Meaning|
+| APL  | Great |
+| Cobol| Old   |
+| PHP| Oh dear |
+

we get this:

+ + + + + + + + + + + + + + + + + + + +
NameMeaning
APLGreat
CobolOld
PHPOh dear
+ +
3.1.16.3. Column alignment
+
+

Note the colons in row two of the following example: they define the alignment of all cells in that column.

+
|Name | Meaning| Numbers |
+|:-   |:------:|--------:|
+| Left| Center | Right |
+| A   | B      |  1.00 |
+| C   | D      | -99.12 | 
+

This results in:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Name Meaning Numbers
LeftCenterRight
AB1.00
CD-99.12
+

If you want a table without column titles but alignment:

+
|:-   |:------:|--------:|
+| Left| Center |   Right |
+| A   | B      |  1.00 |
+| C   | D      | -99.12 |     
+ + + + + + + + + + + + + + + + + + +
LeftCenterRight
AB1.00
CD-99.12
+ +
3.1.16.4. In-line mark-up in cells
+
+

Cells can use in-line mark-up as shown here:

+
|First name            |Last Name   |No.        |Code                 |
+|:---------------------|:-----------|-------:|:----------------------:|
+|Kai                   | Jaeger     | 1      |`{{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵}` |
+| Johann-Wolfgang      | von Goethe | 1923   |`{(⍴,⍵)÷+/,⍵}`         |
+| <http://aplwiki.com> | **bold**   | 123.23 |  `fns ⍣a=b⊣123`       |
+| _Italic_             | ~~Strike~~ |        |   \|                  |
+| line<<br>>break             | |        |          |
+| Last line |
+

This is the result:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
First name Last Name No. Code
KaiJaeger1{{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵}
Johann-Wolfgangvon Goethe1923{(⍴,⍵)÷+/,⍵}
http://aplwiki.combold123.23fns ⍣a=b⊣123
ItalicStrike|
line
break
Last line
+

Note that one cell contains a pipe symbol (|); normally that would confuse the parser but not in this case because it is escaped with a backslash character: \|.

+

You can have a table with just column headers:

+
|First name |Last Name|
+|-|-A
+

This is the result:

+ + + + + + + + + + + +
First nameLast Name
--A
+ +

3.2. Misc

+
+ +

3.2.1. Function calls

+
+

It is possible to embed APL function calls in your Markdown document. The simplest way to call a function #.foo is:

+
This: ⍎⍎#.foo⍎⍎ is the result.
+

Given a function #.foo←{'FOO'} this will be the result:

+
This: FOO is the result.
+

The purpose of this features is to either inject simple text or one or more HTML blocks.

+

Notes:

+ +

You may specify something to the right as in this example:

+
This: ⍎⍎#.foo 1 2 'hello'⍎⍎ is the result.
+

The array 1 2 'hello' is however passed as left argument since ns is always passed as the right argument.

+

The result of such an embedded function must be one of:

+ +

However, mixing Markdown and HTML blocks is not permitted.

+

In case the function returns an HTML block the function call must stand on its own on a line.

+

If an HTML block is returned then the function is responsible for the correct formatting. In particular a <pre> block must look like this otherwise you might not get the desired result:

+
<pre><code>Line 1
+Line 2
+Last line
+</code></pre>
+

Notes:

+ + +

3.2.2. Special attributes

+
+

One can add special attributes — that is an ID, class name(s) and other attributes — to many elements

+ +

Notes:

+ + +
3.2.2.1. Assigning a class name
+
+

The name of a class can be assigned by just mentioning the name:

+
{.classname}
+

The leading dot tells MarkAPL that it is a class name.

+

Of course you can specify more than just one class name:

+
{.foo .goo}
+ +
3.2.2.2. Assigning an ID
+
+

An ID can be assigned by just mentioning the name:

+
{#id}
+

The leading # tells MarkAPL that it is an ID.

+ +
3.2.2.3. Styling
+
+

CSS styling directives are possible as well:

+
{style="color:red;line-height:1.4;"}
+ +
3.2.2.4. Quotes and special attributes
+
+

It is of course possible to put it all together:

+
* list item {#myid style="font-family:'APL385 Unicode' .class1 .class2 target="_blank"}'
+

Note that you cannot put double-quotes around the name of the font family here because double-quotes are already used to determine the definition of the “style” attribute. Therefore you must use single quotes in this instance.

+ +
3.2.2.5. Paragraphs and special attributes
+
+

Naturally a multi-line paragraph must define any special attributes at the very end of the paragraph rather than the end of the first line.

+

Note that there is a chance for content being mistaken as a special attribute, but this chance is very small indeed. If that happens just escape the curlies with a backslash character:

+

+This is a paragraph with curlies at the end: \{\}.
+
+ +

3.2.3. Data

+
+

You can define key-value pairs of data with statements like these:

+
[Data]:author='Kai Jaeger'
+[DATA]:copies=2
+[data]:sequence=1 2 3
+[data]:company=Dyalog Ltd
+

This establishes the key-value pairs as ordinary variables in the namespace ns.data. See The "ns" namespace for details.

+

The statements shown will create this:

+
      Display ⊃ns.data
+┌→────────────────────────┐
+↓ ┌→─────┐   ┌→─────────┐ │
+│ │author│   │Kai Jaeger│ │
+│ └──────┘   └──────────┘ │
+│ ┌→─────┐                │
+│ │copies│   2            │
+│ └──────┘                │
+│ ┌→───────┐ ┌→────┐      │
+│ │sequence│ │1 2 3│      │
+│ └────────┘ └~────┘      │
+│ ┌→──────┐  ┌→─────────┐ │
+│ │company│  │Dyalog Ltd│ │
+│ └───────┘  └──────────┘ │
+└∊────────────────────────┘
+

Notes:

+ + +

3.2.4. Sub topics

+
+

By inserting <<SubTopic>> (case insensitive) one can insert a table of contents for a sub topic. This can be useful in order to avoid overloading the main table of contents. This document has several such SubTOCs embedded, for example The "ns" namespace in detail.

+ +

3.3. Methods

+
+ +

3.3.1. CreateParms

+
+

Niladic function that returns a namespace populated with parameters carrying their default values. CreateParms tries to find for every parameter a value from the command line or environment variables. If it cannot find them it will establish a default value.

+ +

3.3.2. CreateHelpParms

+
+

This function first calls CreateParms and then sets several parameters so that thy meet the special demands of the file Markdown.html which is this very document you are reading. See Help for details.

+ +

3.3.3. Execute

+
+

This function is used exclusively by test cases.

+ +

3.3.4. Help

+
+

Makes your default browser display the file “Markdown.html”.

+

The function takes a Boolean right argument: a 1 forces MarkAPL to recompile the file MarkAPL.md into MarkAPL.html. A 0 just views MarkAPL.html with your default browser.

+

You might specify an optional left argument: a parameter space, typically created by calling the CreateParms method. This allows creating a help file with non-default parameters. Of course this has only an effect when the right argument is a 1.

+

In order to enable Help to find the file Markdown.html (in case the defaults don't work) you must create a parameter space (see CreateHelpParms for details) and then set homeFolder accordingly.

+ +

3.3.5. Init

+
+

Takes a two-item-vector as right argument:

+
    +
  1. A parameter namespace, typically created by calling CreateParms. +
  2. A vector of character vectors: the Markdown. +
+

Returns the "ns" namespace.

+ +

3.3.6. MakeHTML_Doc

+
+

Takes HTML, typically created by calling Process, and makes it a fully fledged HTML document by adding <body>, <head> — with <title> — and <html> with the DocType.

+ +

3.3.7. MarkDown2HTML

+
+

This ambivalent function requires some Markdown as right argument.

+

It returns (since version 1.7.0) a two-item vector (shy):

+ +

Without a (optional) left argument it creates just the HTML from the Markdown.

+

However, you can also create a parameter space by calling CreateParms and set outputFilename. In that case it will create a fully-fledged HTML page from the Markdown and write it to that file. The generated page is also returned as result.

+

Finally one can also set the inputFilesName parameter. This trumps the right argument: it reads the input file, expecting it to be Markdown, creates HTML5 from it and write it to the output file. Again the HTML is also returned as result.

+

Internally it calls Init & Process & MakHTML_Doc.

+ +

3.3.8. Process

+
+

This function takes — and returns — an ns namespace which was typically created by calling Init.

+ +

3.3.9. Version

+
+

Returns the name, the version number and the version date of MarkAPL.

+ +

3.4. Parameters

+
+ +

3.4.1. Overview

+
+

In order to specify parameters follow these steps:

+
      parms←#.MarkAPL.CreateParms''
+      parms.∆List                                  
+ body                                                  
+ bookmarkLink                                        6 
+ charset                                         utf-8 
+ checkFootnotes                                      1 
+ checkLinks                                          1 
+ compileFunctions                                    1 
+ cssURL                                             ¯1 
+ debug                                               1 
+ head                                                  
+ homefolder                                         ¯1
+ inputFilename                                         
+ linkToCSS                                           0 
+ markdownStrict                                      0 
+ numberHeaders                                       0 
+ outputFilename                                        
+ printCSS                            MarkAPL_print.css 
+ screenCSS                          MarkAPL_screen.css 
+ subTocs                                             1 
+ title                                         MarkAPL 
+ toc                                                 0 
+ tocCaption                          Table of contents 
+ verbose                                             1 
+

The function ∆List lists the contents of the parameter space with the corresponding values.

+

After making amendments the parameter space can be passed as the first argument to the MarkAPL.Init function. See How-to for details.

+ +

3.4.2. The parameters in detail

+
+ + +
3.4.2.1. bookmarkLink
+
+

Defaults to 6. That means that all headers of level 1 to 6 are going to be embraced by anchors (bookmarks). See Headers and bookmarks for details.

+

Set this to 0 to suppress the insertion of automated bookmark links altogether.

+

There is not really a good reason for suppressing this except things like MarkAPL calling itself recursively for blockquotes. Those blockquotes might contain headers, but you don't want them anchored - they might interfere with your real headers.

+ +
3.4.2.2. bookmarkMayStartWithDigit
+
+

Boolean that defaults to 1: in HTML5 an ID (= bookmark) may indeed start with a digit.

+

However, sometimes it might be appropriate to avoid this, for example when MarkAPL creates a Sub-Topic. In such — quite special — circumstances it may well be appropriate to set this to 0.

+ +
3.4.2.3. charset
+
+

Defaults to “utf-8”.

+ +
3.4.2.4. checkLinks
+
+

Boolean. The default depends on debug. If this is 1 the Process method checks the internal (bookmark) links and records any problems on ns.report.

+ +
3.4.2.5. compileFunctions
+
+

Boolean that defaults to 1. There is just one reason to prevent any function from being compiled: performance measurements.

+

However, with version 1.8.3 MarkAPL does not compile its functions anymore because this caused trouble under some circumstances while the performance gains are little.

+ +
3.4.2.6. createFullHtmlPage
+
+

This parameter is ¯1 by default (undefined). That means that the default behaviour of Markdown2HTML is defined by the setting of outputFilename: if it is not empty it will default to 1, otherwise to 0.

+

It can be set to either 0 or 1:

+ + +
3.4.2.7. cssURL
+
+

Holds the web address or folder that is expected to host the two CSS files needed for screen and print. Is ignored in case linkToCSS is 0.

+

Defaults to homeFolder.

+ +
3.4.2.8. head
+
+

If you want to add additional meta tags to the <head> part of a document (just an example) you can assign them to head. They will then be added to the <head> section. This can be a simple string (representing <title> for example) or a vector of simple text vectors (several meta tags for example).

+ +
3.4.2.9. homeFolder
+
+

This points to the folder where Markdown.html etc live. If the script was loaded with SALT then it tries to find the Files\ folder within the folder the script was loaded from. If it was not loaded with SALT then it tries to find the Files\ folder in the current directory. If that fails as well then you must set homeFolders to ensure that it can find, say, the file Markdown.html when you call Markdown.Help 0 for example.

+ +
3.4.2.10. inputFilename
+
+

If the markdown you want to process lives in a file rather than the workspace then you can pass an empty vector as right argument to the Process method and specify parms.inputFilename instead.

+ +
3.4.2.11. linkToCSS
+
+

Boolean that defaults to 0. This means that CSS for screen and print is injected into the resulting HTML page. If this is 1 a <link> tag for the CSS file(s) is added to the header. Naturally cssURL must be set accordingly then.

+ +
3.4.2.12. markdownStrict
+
+

Boolean that defaults to 0. Settings this to 1 prevents MarkAPL from executing certain operations:

+ + +
3.4.2.13. numberHeaders
+
+

An integer or integer vector that defaults to 0, meaning that headers are not numbered.

+ + +
3.4.2.14. outputFilename
+
+

Defaults to an empty vector. If specified the HTML will be written to this file by the Markdown2HTML method.

+

Note then in case createFullHtmlPage is not a Boolean but ¯1 (that's the default value which stands for “undefined”) then the setting of outputFilename defines what is created from the Markdown:

+ + +
3.4.2.15. printCSS
+
+

The name of the CSS file for printing. Defaults to MarkAPL_print.css. If this is empty no CSS for printing purposes is included or linked to.

+ +
3.4.2.16. screenCSS
+
+

The name of the CSS file for the screen. Defaults to MarkAPL_screen.css. If this is empty no CSS for viewing purposes is included or linked to.

+ +
3.4.2.17. subTocs
+
+

Boolean that defaults to 1. If you want to suppress sub TOCs no matter whether there are any included in the Markdown or not then set this to 0.

+

When set to 0 then any strings <<SubTopic>> are removed from the Markdown before processing it.

+

This is mainly needed in order to suppress subTOCs in blockquotes.

+ +
3.4.2.18. title
+
+

Defaults to “MarkAPL”. Defines the <title> tag in the <head> section of the resulting HTML page.

+ +
3.4.2.19. toc (table of contents)
+
+

An integer or integer vector that defaults to 0, meaning that no table of contents is injected into a document created by MarkAPL.

+

You can change this by setting the parameter toc to …

+ +

Note that bookmarkLinkmust have at least the same value as toc.

+ +
3.4.2.20. tocCaption
+
+

Defaults to “Table of contents”. Set this to any character vector you want to appear as header of the TOC. tocCaption will be ignored in case toc is 0.

+ +
3.4.2.21. verbose
+
+

Boolean that defaults to debug. If this is 1 then the Process method will print the contents off ns.report to the session.

+ +

3.5. The “ns” namespace.

+
+ +

3.5.1. Overview

+
+

The ns namespace is returned (created) by the Init method and modified by the Process method. It contains both input and output variables.

+

Before Process is run the variables emptyLines, leadingChars, markdown, markdownLC and withoutBlanks hold data the is extracted from the markdown. When Process is running block by block is processed and removed from these variables. At the same time the variable parms.html is collecting the resulting html. Other variables (abbreviations, data, footnoteDefs, headers, linkRefs, subToc and toc) may or may not collect data in the process as well.

+

The two variables report and lineNumber are special, see there.

+ +

3.5.2. The “ns” namespace in detail

+
+ +

The namespace contains the following variables:

+ +
3.5.2.1. abbreviations
+
+

A (possibly empty) vector of two-item-vectors. The first item holds the abbreviation, the second item the explanation or comment.

+ +
3.5.2.2. emptyLines
+
+

A vector of Booleans indicating which lines in markdown are empty. Lines consisting of white-space characters only are considered to be empty.

+ +
3.5.2.3. footnoteDefs
+
+

A matrix that carries all footnote definition found in markdown. The matrix has two columns:

+
    +
  1. Running number, starting from 1. +
  2. Bookmark name. +
  3. Caption. +
+ +
3.5.2.4. headers
+
+

A matrix that carries all headers defined in markdown.

+

The matrix has three or four columns:

+
    +
  1. The level of the header, starting with 0. +
  2. The anchor-ready version of the caption. +
  3. The caption. +
  4. The tiered number of the header. +
+

Naturally the last column does not exist in case numberHeaders is 0.

+ +
3.5.2.5. html
+
+

After having created the ns namespace by calling CreateParms this variable is empty. By running the Process method this variable will be filled up.

+ +
3.5.2.6. leadingChars
+
+

After having created the ns namespace by calling CreateParms this variable contains a limited number of characters from markdown. Leading white-space is removed. This increases performance for many of the checks to be carried out by Process.

+ +
3.5.2.7. lineNumbers
+
+

After having created the ns namespace by calling CreateParms this variable contains a vector of integers representing line numbers in markdown. This allows the line number to be reported. Also, Function calls can access the line number as well.

+

Note that line numbers refer to the MarkDown, not the HTML.

+ +
3.5.2.8. linkRefs
+
+

A vector of two-item vectors holding the link id — which you will use within the document to link to the definition — in the first item and the URL in the second.

+ +
3.5.2.9. markdown
+
+

This variable holds the markdown to be processed by Process.

+ +
3.5.2.10. markdownLC
+
+

Same as markdown but all in lower case. That speeds things up at the expense of memory.

+ +
3.5.2.11. noOf
+
+

The number of lines processed in the next (or current) step.

+ +
3.5.2.12. parms
+
+

The parameters that were passed to Init.

+ +
3.5.2.13. report
+
+

After having created the ns namespace by calling CreateParms this variable is empty. The Process method might add remarks to this variable in case it finds something to complain about or comment on.

+

Some methods print the content of this variable to the session in case verbose is 1.

+ +
3.5.2.14. subToc
+
+

This is a vector of two-item vectors:

+
    +
  1. The level of the header, starting with 1. +
  2. The caption of the header as displayed. +
+ +
3.5.2.15. toc
+
+

This is a vector of three four-item vectors (since version 1.3.3):

+
    +
  1. The level of the header, starting with 1. +
  2. The caption of the header as displayed. +
  3. The internal link name. +
  4. The type of the header: 1 = SeText, 2 = ATX. +
+ +
3.5.2.16. withoutBlanks
+
+

Same as markdown but without any blanks. This speeds things up at the expense of memory.

+ +

4. How to

+
+

First of all, you can bring the document your are reading right now into view by executing #.MarkAPL.Help 0.

+

One way to study how to make use of MarkAPL is to trace through the method MarkAPL.Help. This should clarify the principles.

+

Another way is to look at the test cases named Test_Examples_01 etc in #.TestCases in the workspace MarkAPL.DWS. You can execute them with

+
#.TestCases.RunThese 'Examples'
+

You can trace through them with

+
#.TestCases.RunThese 'Examples' (-⍳1000)
+

The numbers select the test cases of the given group (here “Examples”) to be executed. 1000 was chosen to make sure all of them are executed.

+

Negative numbers tell the test framework to stop right before a particular test function is going to be executed. That gives you the opportunity to trace through that function without tracing through the actual test framework.

+ +

5. Problems

+
+ +

5.1. Crashes

+
+

When MarkAPL crashes the most likely reason is an invalid definition. Check the variable ns.markdown: that tells you how far MarkAPL got in processing the Markdown.

+

However, since MarkAPL should not crash and always produce a document it is appreciated when you report any crashes. See the next topic for how to report a crash.

+ +

5.2. Bugs

+
+

Please report any bugs to mailto:kai@aplteam.com. I appreciate:

+ + +

5.3. Unexpected results

+
+

Before reporting a bug please check carefully your Markdown, in particular when the problem appears in or after complex table or list definitions. More often than not mistakes in the Markdown are causing the problem.

+

If you cannot work out why it goes wrong report it to me – see the previous topic for how to report a problem.

+
+

This document refers to version 1.8.4 of MarkAPL. Kai Jaeger ⋄ APL Team Ltd ⋄ 2016-07-24

+

Footnotes

+
+
+
    +
  1. Wikipedia definition of abandonware: https://www.wikiwand.com/en/Abandonware

    +
  2. The CommonMark specification: http://spec.commonmark.org/0.24/

    +
+
+ + \ No newline at end of file diff --git a/PlugIns/Dyalog/Panel/Panel.css b/PlugIns/Dyalog/Panel/Panel.css deleted file mode 100644 index 1ebb1e98..00000000 --- a/PlugIns/Dyalog/Panel/Panel.css +++ /dev/null @@ -1,79 +0,0 @@ -.dc-panel { - padding: 5px 5px 0px 5px; - min-height: 40px; -} - -.dc-panel-info.dc-panel-icon { - color: #00529B; -} - -.dc-panel-success.dc-panel-icon { - color: #4F8A10; -} - -.dc-panel-warning.dc-panel-icon { - color: #9F6000; -} - -.dc-panel-error.dc-panel-icon{ - color: #D8000C; -} - -.dc-panel > .dc-panel-icon { - font-size: 2em; - width: 30px; - float: left; - margin: 0.1em; - vertical-align: middle; -} - -.dc-panel { - margin-top: 16px; -} - - -.dc-panel > .dc-panel-icon + .dc-panel-content { - border-top-left-radius: .5em; - border-top-right-radius: .5em; - border-bottom-left-radius: .5em; - border-bottom-right-radius: .5em; - border: 1px solid; - margin-top: 0px; - min-height: 40px; -} - -.dc-panel > .dc-panel-title { - border-top-left-radius: .5em; - border-top-right-radius: .5em; - border-bottom: 2px solid red; - border: 1px solid; - padding: 3px 0px 3px 3px; - font-weight: 800; - color: black; -} - -.dc-panel > .dc-panel-title +.dc-panel-icon +.dc-panel-dfltStyle { - background-color: transparent; -} -.dc-panel > .dc-panel-title +.dc-panel-icon +.dc-panel-content { - border-top-left-radius: 0em; - border-top-right-radius: 0em; - border-bottom-left-radius: .5em; - border-bottom-right-radius: .5em; -} - -.dc-panel-error.dc-panel-title , .dc-panel-content { - background-color: #FF9EA3; -} - -.dc-panel-info.dc-panel-title , .dc-panel-content { - background-color: #BDE5F8; -} -.dc-panel-success.dc-panel-title , .dc-panel-success.dc-panel-content { - background-color: #DFF2BF; -} - -.dc-panel-warning.dc-panel-title , .dc-panel-warning.dc-panel-content { - background-color: #FEEFB3; -} - diff --git a/PlugIns/Other/chosen-1.6.1/LICENSE.md b/PlugIns/Other/chosen-1.6.2/LICENSE.md similarity index 100% rename from PlugIns/Other/chosen-1.6.1/LICENSE.md rename to PlugIns/Other/chosen-1.6.2/LICENSE.md diff --git a/PlugIns/Other/chosen-1.6.1/README.md b/PlugIns/Other/chosen-1.6.2/README.md similarity index 100% rename from PlugIns/Other/chosen-1.6.1/README.md rename to PlugIns/Other/chosen-1.6.2/README.md diff --git a/PlugIns/Other/chosen-1.6.1/chosen-sprite.png b/PlugIns/Other/chosen-1.6.2/chosen-sprite.png similarity index 100% rename from PlugIns/Other/chosen-1.6.1/chosen-sprite.png rename to PlugIns/Other/chosen-1.6.2/chosen-sprite.png diff --git a/PlugIns/Other/chosen-1.6.1/chosen-sprite@2x.png b/PlugIns/Other/chosen-1.6.2/chosen-sprite@2x.png similarity index 100% rename from PlugIns/Other/chosen-1.6.1/chosen-sprite@2x.png rename to PlugIns/Other/chosen-1.6.2/chosen-sprite@2x.png diff --git a/PlugIns/Other/chosen-1.6.1/chosen-tools.js b/PlugIns/Other/chosen-1.6.2/chosen-tools.js similarity index 100% rename from PlugIns/Other/chosen-1.6.1/chosen-tools.js rename to PlugIns/Other/chosen-1.6.2/chosen-tools.js diff --git a/PlugIns/Other/chosen-1.6.1/chosen.jquery.min.js b/PlugIns/Other/chosen-1.6.2/chosen.jquery.min.js similarity index 99% rename from PlugIns/Other/chosen-1.6.1/chosen.jquery.min.js rename to PlugIns/Other/chosen-1.6.2/chosen.jquery.min.js index 4b6e6caf..806018e6 100644 --- a/PlugIns/Other/chosen-1.6.1/chosen.jquery.min.js +++ b/PlugIns/Other/chosen-1.6.2/chosen.jquery.min.js @@ -1,2 +1,2 @@ -/* Chosen v1.6.1 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ +/* Chosen v1.6.2 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ (function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1},AbstractChosen.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?""+a.group_label+""+a.html:a.html},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),b.search_text=b.group?b.label:b.html,(!b.group||this.group_search)&&(b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+""+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+""+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(c){var d,e;return d=a(this),e=d.data("chosen"),"destroy"===b?void(e instanceof Chosen&&e.destroy()):void(e instanceof Chosen||d.data("chosen",new Chosen(this,b)))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("
",c),this.is_multiple?this.container.html('
    '):this.container.html(''+this.default_text+'
      '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.bind("touchend.chosen",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("
    • ",{"class":"search-choice"}).html(""+this.choice_label(b)+""),b.disabled?c.addClass("search-choice-disabled"):(d=a("",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return a("
      ").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('
    • '+this.results_none_found+' ""
    • '),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("
      ",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}).call(this); \ No newline at end of file diff --git a/PlugIns/Other/chosen-1.6.1/chosen.min.css b/PlugIns/Other/chosen-1.6.2/chosen.min.css similarity index 99% rename from PlugIns/Other/chosen-1.6.1/chosen.min.css rename to PlugIns/Other/chosen-1.6.2/chosen.min.css index 5e5a85c9..60b11718 100644 --- a/PlugIns/Other/chosen-1.6.1/chosen.min.css +++ b/PlugIns/Other/chosen-1.6.2/chosen.min.css @@ -1,3 +1,3 @@ -/* Chosen v1.6.1 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ +/* Chosen v1.6.2 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ .chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container .search-choice .group-name,.chosen-container .chosen-single .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .search-choice .group-name:after,.chosen-container .chosen-single .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(chosen-sprite.png) no-repeat 100% -20px;background:url(chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(chosen-sprite.png) no-repeat -30px -20px;background:url(chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}} \ No newline at end of file diff --git a/SampleMiSites/MS3/Documentation/MarkAPL.html b/SampleMiSites/MS3/Documentation/MarkAPL.html new file mode 100644 index 00000000..7d48a571 --- /dev/null +++ b/SampleMiSites/MS3/Documentation/MarkAPL.html @@ -0,0 +1,3139 @@ + + + + + +MarkAPL + + + + + +

      MarkAPL

      +
      + + +

      1. Overview

      +
      + +

      1.1. What is Markdown?

      +
      +

      Markdown — which is much better readable and therefore much better maintainable than HTML — can be transformed into HTML.

      +

      Because of its advantages over HTML and because the rules are easy to learn, Markdown became ubiquitous: many of the big names are using it now. Examples are StackFlow, Git, SourceForge and Trello. Wiki engines have also started to adopt the concept.

      + +

      1.2. Is there a Markdown standard?

      +
      +

      Yes and no. The original implementation by John Gruber had no specification at all, just a Perl script and test cases. Unfortunately it was also quite buggy. Gruber has not put work into developing his brain child. Some consider the original Markdown therefore abandonware[1].

      +

      Because of the bugs, some ambiguities and the lack of much needed features several flavours of an enhanced Markdown evolved, the most important ones being Git-flavoured Markdown, Markdown Extra and PanDoc's Markdown.

      + +

      1.3. What is MarkAPL?

      +
      +

      MarkAPL is an APL program that converts (extended) Markdown into valid HTML5.

      + +

      1.4. MarkAPL, Markdown, Markdown Extra and CommonMark

      +
      +

      CommonMark [2] is an attempt to establish a standard for Markdown.

      +

      MarkAPL aims to implement the original Markdown specification with very few exceptions. It also aims to implement most — but not all — of the Markdown Extra enhancements. Finally it also aims to follow the CommonMark specification as far as it seems to be reasonable.

      +

      In addition MarkAPL offers several enhancements that might be particularly useful to APLers and don't hurt otherwise. However, if compatibility is paramount then you must not use them.

      +

      For example, any lines that start with an APL lamp symbol () — except in a code block of course — are considered comment lines which won't contribute to the output at all.

      +

      For a full list see the next chapter.

      + +

      1.5. Preconditions

      +
      +

      MarkAPL needs Dyalog APL version 14.0 or better.

      + +

      2. Compatibility, features, bugs

      +
      + +

      2.1. Standard compliance

      +
      + +

      2.1.1. Intentional differences

      +
      +
        +
      • Code blocks are identified as such just by fencing. Any lines indented by 4 characters do not define a code block in MarkAPL. +
      • In front of the fencing characters there might be zero or up to three white space character. +
      • HTML blocks that must end with an end tag should not have anything after the end tag on that very line: it would be ignored. +
      • Although \ is used as the escape character, and although \\ results correctly in a single backslash character, multiple backslashes as in \\\ are not supported and must not be used. +

        However, note that \ at the end of a line in a paragraph inserts a page break - see Line breaks for details.

        +
      • For defining any attributes a pair of double quotes must be used. Single quotes have no effect. (This contradicts the original Markdown documentation but due to a bug it does not work with the original Markdown implementation either) +
      • MarkAPL does not have the concept of “loose list items”. In CommonMark, the contents of any list item that is followed by a blank line is called a “loose” list item and wrapped into an additional <p> tag. +

        This is of little value and complicates matters enormously. Therefore MarkAPL simply ignores empty lines between list items.

        +

        You can still get a <p> tag around something that actually belongs to the list item but only after the initial text. This is called a sub-paragraph. See Lists for details.

        +
      • According to the Markdown specification a list item following a paragraph must be separated from the paragraph by a blank line. The reason for this rule is probably that in very rare circumstances one might start a list accidentally. +

        Experience shows however that users are way more likely to wonder why a list they intended to start straight after the end of a paragraph doesn't. For that reason MarkAPL does not require a blank line between the end of a paragraph and the first list item of a list.

        +
      • According to the original Markdown standard two spaces at the end of a line are converted into a line break by replacing the two blanks by <br />. This was actually implemented in version 1.0 of MarkAPL. +

        However, people reported a bug about unintentional line breaks which were accidentally caused by adding two spaces at the end of a paragraph or a list item. Therefore with version 1.3 this ill-designed feature was removed from MarkAPL.

        +

        Note that there are other — and better — ways to achieve the same goal: see Line breaks for details.

        +
      + +

      2.1.2. Not implemented

      +
      +
        +
      • Markdown in-line mark-up inside an HTML block is ignored. This restriction might be lifted depending on demand. +
      • All types of HTML blocks but one can, according to the CommonMark specification, interrupt a paragraph. There are no plans to implement this. +
      • According to the CommonMark specification a tag like <div> can have a line break in between and will still be recognized as a tag. Not only seems this to have very little value, it decreases readability. Therefore this is not implemented in MarkAPL. +
      • A list item can contain paragraphs, code blocks and sub-lists but nothing else. +
      + +

      2.2. Enhancements

      +
      +
        +
      • For every header an anchor is created automatically by default. See Headers and bookmarks for details. +
      • Bookmark links have a special simplified syntax; see Internal links (bookmarks) for details. +
      • MarkAPL can optionally insert a table of contents from the headers into a document. See toc (table of contents) for details. +
      • With <<SubTOC>> one can insert sub-tables of contents anywhere in the document. See Sub topics for details. +
      • Headers can be numbered. By setting numberHeaders (which defaults to 0) to 1 one can force MarkAPL to number all or some headers. See numberHeaders for details. +

        This was implemented because numbering with CSS does not really work yet.

        +
      • Calling APL functions: something like ⍎⍎FnsName⍎⍎ calls an APL method FnsName which gets the ns namespace as right argument. See “Function calls” for details. +
      • Typographical sugar. This can be switched off by setting markdownStrict to 1; for details see markdownStrict. +
          +
        • Pairs of double-quotes (") are exchanged against their typographically correct equivalents “like here”. +

          Note that this means that mentioning a single double-quote requires it to be put between back-ticks or escaped with a \ character when there are also pairs of double-quotes in the same paragraph, cell, list item, blockquote or header, because otherwise MarkAPL has no idea what to do with it.

          +

          A single double quote (") however is simply shown as is.

          +
        • Three dots (...) are exchanged against an ellipses: … +
        • Three hyphens (---) are exchanged against —. +
        • Two hyphens (--) are exchanged against –. +
        • (c) is exchanged against ©. +
        • (tm) is exchanged against ™. +
        +
      • Assigning ID names, class names and attributes to certain elements as in:
        {#foo .my_class .another_class style="display:none;" target="_blank"}
        is implemented for most but not all elements. This idea was taken from Markdown Extra. +

        See Special attributes for details. In this document the horizontal ruler that separates the footnotes from the remaining document is styled with special attributes.

        +
      • Abbreviations. This was introduced by Markdown Extra. +
      • A <br/> tag can be inserted into paragraphs, lists and table cells with <<br>>. +
      • Comments: any line that starts with a (the APL symbol used to indicate a comment) and is not situated within a code block will be ignored, no matter what else is found on that line. +
        ⍝ This demonstrates a comment. Useful to leave stuff in a Markdown file 
        +⍝ but prevent it from making it into any resulting HTML document.
        +
      • Defining data: any line that starts with [data]: defines a key-value pair of data. See Data for details. This has all sorts of applications; for example, this can be used to specify meta tags (name, content). +
      + +

      2.3. Known bugs

      +
      +

      See http://aplwiki.com/MarkAPL/ProjectPage

      + +

      3. Reference

      +
      + +

      3.1. Mark-up

      +
      + +

      3.1.1. Overview

      +
      +

      The following table categorizes the different mark-ups into “Standard”, “Extra”, “Pandoc” and “MarkAPL”. A single line might carry more than on X in case it got enhanced.

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Name Standard Extra Pandoc MarkAPL
      AbbreviationsXX
      Automated linksXXXX
      BlockquotesXXXX
      Calling functionsX
      Code blocks (indented)XXX
      Code blocks (fenced)XXX
      Definition listsXXXX
      FootnotesXXXX
      HeadersXXXX
      HTML blocksXXXX
      HRXXXX
      ImagesXXXX
      Inline markupXXXX
      Line breaks (two spaces)XXX
      Line breaks (\)XX
      Line breaks (<<br>>)X
      LinksXXXX
      Link referencesXXXX
      ListsXXXX
      Loose/tight listsXXX
      Markdown inside HTMLXX
      ParagraphsXXXX
      TablesXXXX
      Table of contents (TOC)XX
      Sub TOCX
      Smart typographyXX
      Special attributesXXX
      +

      Note that “Code blocks (indented)” don't carry an X in the “MarkAPL” column because marking up a code block by indenting is deliberately not implemented in MarkAPL.

      +

      The implementation of Definition lists comes with some restrictions; see there.

      + +

      3.1.2. Comments

      +
      +

      Any line that starts with an APL lamp symbol () is ignored. That means that the line won't make it into the resulting HTML at all.

      +

      This is true for any line that is not part of a code block, including lines that are part of a paragraph.

      +

      Example:

      +
      Start of a para that contains
      +⍝ Ignored
      +a commented line.
      +

      This is the result:

      +

      Start of a para that contains a commented line.

      + +

      3.1.3. Abbreviations

      +
      +

      Abbreviations can be defined anywhere in the document. This is the syntax:

      +
      *[HTML] Hyper Text Markup Language
      +

      All occurrences of “HTML” within the Markdown document — except those marked as code — are then marked up like this:

      +

      <abbr title="Hyper Text Markup Language">HTML</abbr>

      +

      Therefore this:

      +
      *[Abbreviations]: Text is marked up with the <abbr> tag
      +

      should show the string “Text is marked up with the <abbr> tag” when you hover over the word “Abbreviations”.

      +

      Notes:

      +
        +
      • You may have more than just one word between the [ and the ] bracket. However, any leading and trailing blanks will be removed. +
      • Any leading and trailing blanks regarding the comment will be removed. +
      • What is within the square brackets is case sensitive. +
      • You may use any Unicode characters belonging to the Unicode “letter” category plus +-_= /& (plus, minus, underscore, equal, space, slash and ampersand). +
      + +

      3.1.4. Blockquotes

      +
      +

      Markdown — and therefore MarkAPL — uses the > characters for block quoting. If you’re familiar with quoting passages of text in an email message then you know how to create a block quote in Markdown. It looks best if you hard wrap the text and put a > before every line:

      +
      > This is a blockquote with one paragraph. Lorem ipsum dolor sit amet,
      +> consec tetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
      +> Vestibulum enim wisi, _viverra_ nec, fringilla **in** risus.
      +> 
      +> Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet velit. Suspendisse
      +> id sem consectetuer libero luctus adipiscing.
      +> 
      +> > Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet velit. Suspendisse
      +> id sem consectetuer libero luctus adipiscing.
      +

      This is the result:

      +
      +

      This is a blockquote with one paragraph. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in risus.

      +

      Donec sit amet nisl. Aliquam (+/⍵)÷⍴,⍵ semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.

      +
      +

      Donec sit amet nisl. Aliquam (+/⍵)÷⍴,⍵ semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.

      +
      +
      +

      However, MarkAPL allows you to be lazy and only put the > before the first line of a paragraph:

      +
      > This is a **lazy** blockquote with two paragraphs. Lorem ipsum dolor sit amet,
      +consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
      +Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
      +
      +> Second para.
      +

      This is the result:

      +
      +

      This is a lazy blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in.

      +
      +
      +

      Second para.

      +
      +

      Note that blockquotes are not restricted in any respect: they may contain paragraphs, tables, lists, headers and blockquotes. However, headers are not numbered and do not have anchors attached, and any <<SubTOC>> directives are removed from a blockquote.

      + +

      3.1.5. Code blocks

      +
      +

      According to the original Markdown specification any lines indented by 4 characters were considered a code block. Apart from not being particularly readable this caused problems with nested lists and code blocks within lists. Therefore later a convention called “fencing” was introduced.

      +

      MarkAPL goes a step further: to avoid confusion indenting is not supported for marking up code blocks.

      +

      Code blocks can be marked up in two different ways:

      + +
      3.1.5.1. Fencing
      +
      +

      You can use the “Git” style with three — or more — back-ticks as shown here:

      +
      ```
      +This is a block ...
      +of code!
      +```
      +

      You can use the Markdown Extra specification with three — or more — tildes:

      +
      ~~~
      +This is a another block ...
      +of code!
      +~~~
      +

      You don't have to have empty lines around fenced code blocks but you might find that such lines help to improve readability.

      +

      Notes:

      +
        +
      • The fencing lines may have up to three leading white space characters. These will just be ignored. +

        Note that this rule does not apply when a code block is part of a list item since the number of spaces is then used to determine the level of nesting.

        +
      • Code blocks may also have Special attributes; see there for details. +
      + +
      3.1.5.2. Code: the <pre> tag
      +
      +

      You can also mark a block of text with the HTML <pre> tag. For example, this can be useful in order to show the fencing characters as part of the code.

      +

      If you must assign an ID or a class or any styling stuff to the <pre> tag of a code block you must do this:

      +
      <pre id="foo" class="my">
      +...
      +</pre>
      +

      There is no other way since assigning a special attribute to a fenced block as shown here:

      +
      ~~~ {#foo}
      +...
      +~~~
      +

      does assign the attributes not to the <pre> tag but to the inner <code> element:

      +
      <pre><code id="foo">
      +...
      +</code></pre>
      +

      Notes:

      +
        +
      • MarkAPL requires a <code> tag within any <pre> tag. Even if you do not specify the <code> tag MarkAPL will insert it for you anyway. +
      • Assigning an ID or a class to a <pre> tag might not have the intended effect because the default CSS styles the code block via the <code>, not the <pre> tag. +
      • MarkAPL will remove any line breaks between <pre><code> and the first line of your code block and also between </code></pre> and the last line of your code block. If you need an initial (empty) line or an empty line as the last one you must add it as shown here: +
      +
      <pre><code>
      +
      +Second line
      +Last but one line
      +
      +</code></pre>
      + +

      3.1.6. Definition lists

      +
      +

      Definition lists are made of terms and definitions of these terms, much like in a dictionary. If there is a blank line between the term and the definition then the definition is enclosed between a <p> tag. However, if there are sub-definitions (see below) then all definitions are enclosed between <p> tags.

      +

      A definition can span more than one paragraph, but they must be indented by as many spaces as there are in front of the “:” (maximum of three) plus two for the colon itself and the following space to be recognized as being a definition. Such sub-definitions are always enclosed between <p> tags.

      +

      Definition lists break at two consecutive empty lines or anything that is neither a term and not indented according to the rules that define a definition. Having the two empty lines in place to break a definition list is recommended because it's faster.

      +

      Between the left margin and the colon there may be up to 3 spaces. After the colon there must be exactly one space.

      +

      Simple example:

      +
      Term
      +: The definition
      +

      This is the result:

      +
      +
      Term
      +
      The definition
      +
      +

      The resulting HTML:

      +
      <dl>
      +<dt>Term</dt>
      +<dd>The definition</dd>
      +</dl>
      +

      No <p> tags here because there is no blank line between the term and its definition.

      +

      More complex example:

      +
      Term 1
      +
      +   : The definition
      +
      +   : More information
      +     that spans over
      +     three lines
      +
      +Term 2
      +    : Another definition
      +
      +    : Additional information
      +

      This is the result:

      +
      +
      Term 1
      +

      The definition

      +

      More information that spans over three lines

      +
      Term 2
      +

      Another definition

      +

      Additional information

      +
      +

      The resulting HTML:

      +
      <dl>
      +<dt>Term 1</dt>
      +<dd><p>The definition</p></dd>
      +<dd><p>More information that spans over three lines</p></dd>
      +<dt>Term 2</dt>
      +<dd>Another definition</dd>
      +<dd><p>Additional information</p></dd>
      +</dl>
      +

      Restrictions:

      +
        +
      • A term must be exactly one line. +
      • A definition may not contain anything but paragraphs. +
      + +

      3.1.7. Footnotes

      +
      +

      Footnotes can be created by [^1] or [^foo]. The footnote 1 and foo can be defined anywhere in the document. Footnotes cannot contain anything but paragraphs: no code blocks, lists, blockquotes or tables. In-line mark-up is of course available.

      +

      The format of the definition [^footnote]:

      +
      [^single]: The definition of a single-line footnote.
      +
      +[^footnote]: A multi-line definition.
      +  As long as the following paras are indented by two spaces they are considered part of the footnote.
      +  
      +  Even empty lines don't interrupt the definition, although two do. In-line formatting **is** of course supported. 
      +

      Notes:

      +
        +
      • Two empty lines end a footnote. +
      • As soon as something is not indented a footnote definition ends. +
      • The footnote identifiers must start with an upper case or lower case ASCII character and may contain any upper case and lower case characters, digits and the underscore (_) but nothing else. +
      • The footnotes are wrapped in a <div id="footnotes_div"> tag to make them easily style-able with CSS. +
      + +

      3.1.8. Headers

      +
      +

      There are two ways to mark up headers, and both are part of the original Markdown specification:

      + +
      3.1.8.1. The “=” and “-” syntax (SeText)
      +
      +

      With this syntax you can only define headers of level 1 and 2.

      +

      A line that looks like this:

      +
      Main caption
      +============
      +

      is converted into a header of level 1.

      +

      Note that it does not matter how many = chars are used.

      +

      As long as the first character on a line is a = and there are no other characters or they are all spaces it will be recognized as a level-1 header.

      +

      Similarly a line that looks like this:

      +
      Header of level 2
      +-------------------
      +

      is converted into a header of level 2.

      +

      Again it does not matter how many hyphens are used. As long as the first character on a line is a hyphen and there are no other characters or they are all spaces it will be recognized as a level-2 header.

      +

      However, since a single - can also start a bulleted list it is strongly recommended to use at least two (--) characters.

      +

      Note that the definition of a header might well span several lines like this:

      +
      This is a 
      +level 1
      +header
      +=====
      +

      Generally no blank line is required either before or after such a header but because a SeText header cannot interrupt a paragraph it is necessary to have a blank line between the end of a paragraph and a SeText header.

      + +
      3.1.8.2. The “pound” syntax (ATX)
      +
      +

      A line that looks like this:

      +
      # My caption
      +

      is converted into a header of level 1 while a line that looks like this:

      +
      ###### My caption
      +

      is converted into a header of level 6. You cannot have headers of level 7 or higher (HTML does not allow this), and it is probably not a good idea to use levels beyond 4 anyway, except perhaps in technical documentation.

      +

      Many Markdown implementations do not require a space between the last # on the left and the content (= the header as such). However, the space was required even by the original Markdown specification. The CommonMark specification points out that this was actually a good idea because with the blank these two lines would be rendered as headers:

      +
      #5 bolt
      +
      #hashtag
      +

      Note that you may have trailing # characters as well; however, they are simply ignored. That's the reason why the number of characters does not even have to match the leading number of #.

      + +
      3.1.8.3. ATX versus SeText syntax
      +
      +
        +
      • The SeText syntax is contributing to the readability of a document. +
      • The ATX syntax makes it easier for an author to search for a specific header. +
      + +
      3.1.8.4. Headers and bookmarks
      +
      +

      By default MarkAPL automatically embraces headers (<h{number}>) by bookmark anchors. Use parms.bookmarkLink (default: 6 = all levels) to change this: setting this to 0 suppresses this. You can also assign a number lesser than 6. For example, assigning 3 means that all headers of level 1, 2 and 3 are embraced by bookmark anchors but any headers of level 4, 5 and 6 are not.

      +

      The names of the bookmarks are constructed automatically according to this set of rules:

      +
        +
      • Remove all formatting, links, etc. +
      • Remove everything between <>, () and [], including the brackets. +
      • Remove all punctuation, except underscores, hyphens, and periods. +
      • Remove all code. +
      • Remove HTML entities (recursive calls to MarkAPL!) +
      • Replace all spaces and newlines with hyphens. +
      • Convert all alphabetic characters to lower case. +
      • Remove everything from the left until the first digit or ASCII letter or or is found (identifiers may not begin with a hyphen). +
      • If nothing is left by then, use the identifier section. +
      +

      Example:

      +

      The caption “Second level-2 ”Header!“” becomes “header-second-level-2-header”.

      +

      This is the result with parms.bookmarkLink←1:

      +
      <a id="header-second-level-2-header" class="autoheaderlink" 
      +<h1>Second level-2 "Header!"</h1> 
      +</a>
      +

      Note that the class autoheaderlink is automatically assigned to all bookmark links. This is needed because you probably want to make them invisible via CSS.

      +

      With parms.bookmarkLink←0 however it is just this:

      +
      <h1>Second level-2 "Header!"</h1>
      + +
      3.1.8.5. Headers and special attributes
      +
      +

      Note that assigning Special Attributes has special rules:

      +
        +
      • If an ID is defined then it is assigned to the anchor (<a>) rather than the <h{number}> tag. +
      • All other special attributes are assigned to the <h{number}> tag. +
      • If however automated bookmarks are suppressed (see bookmarkLink) then all special attributes go onto the <h{number}} tag - there is no anchor in those cases. +
      + +

      3.1.9. HTML blocks

      +
      +

      Please note that there are three different HTML blocks:

      +
        +
      • <script> and <style> +

        They are special because they cannot be nested.

        +
      • <pre> +

        This one preserves white space. The special features of <pre> blocks are discussed in detail at Code: the <pre> tag.

        +
      • Everything else. +
      +

      Note that all HTML blocks but <pre>, <script> and <style> must be surrounded by blank lines.

      +

      It is perfectly legal to have HTML blocks in a Markdown document but be aware that this is way more complex a topic than it seemed to be at first glance.

      +

      For details refer to http://spec.commonmark.org/0.24/#html-blocks.

      +

      The most important syntax is when you want to have an opening tag like a <div> and a corresponding </div> around some Markdown stuff. For simplicity let's assume that it is just a paragraph with a single word: “foo” in bold.

      +

      An HTML block must always start with either < or </:

      +
      # Example demonstrating HTML blocks
      +
      +<div id="123" class="myClass">
      +
      +**foo**
      +
      +</div>
      +
      +Another paragraph.
      +

      Notes:

      +
        +
      1. This example comprises two (!) HTML blocks. +
      2. The beginning of a block is defined by an empty line followed by a line that starts with either < or </ followed by a tag name. That means that leading white space is important because it prevents a line from being recognized as an HTML block. +
      3. The end of each HTML block (except <pre>, <script>, <style>) is defined by an empty line which therefore is essential. +
      4. Because **foo** is an ordinary paragraph located between two HTML blocks it will be converted into <strong>foo</strong>. +
      +

      Without the two empty lines around the paragraph it would be just one HTML block. As a side effect the paragraph would show **foo** rather than foo because within an HTML block no in-line Markdown is recognized.

      +

      The <pre> blocks are different in so far as there is no Markdown styling done to anything between <pre> and </pre> anyway; therefore you can have just one block without any disadvantages.

      + +

      3.1.10. Horizontal rulers

      +
      +

      You can create a horizontal ruler by following these rules:

      +
        +
      1. After an empty line there must be a line with either a hyphen (-) or an asterisk (*) or an underscore (_). +
      2. There must be at least three such characters on the line. +
      3. There might be zero to a maximum of three white space character to the left of the characters defining the ruler. +
      4. There are no other characters but spaces allowed, with the exception of Special Attributes. +
      +

      So these lines will all create a ruler:

      +
      ---
      +* * * * * *
      +_ _    _
      +   ***
      +

      The result:

      +
      +
      +
      +
      +

      A common mistake is to forget the empty line required before the definition of a ruler because that might actually define a SeText header.

      + +

      3.1.11. Images

      +
      +

      Images are implemented so that an image can be included into a paragraph, a list or a table cell. If you want an image outside such an element then you are advised to insert it as HTML block with an <img> tag.

      +

      The syntax of Markdown-images is of limited use because you cannot specify either height or width. However, with Special attributes one can get around this limitation.

      +

      The full syntax:

      +
      ![Alt Text](/url "My title")
      +

      Because the title is optional this is a valid specification as well:

      +
      ![Alt Text](/url)
      +

      Finally the “alt” text is optional as well, so this would do:

      +
      ![](/url)
      +

      However if you specify “alt” but not “title” or “title” but not “alt” then the undefined bit will show the same contents as the defined one.

      +

      In order to add special attributes use this syntax:

      +
      ![Alt Text](/url "My title"){#foo .myclass style="color:red;"}
      +

      There must not be any white-space between the closing { and the opening {.

      +

      Example:

      +
      ![Dots](http://download.aplteam.com/APL_Team_Dots.png "APL Team' dots"){height="70" width="70"}
      +

      Dots

      + +

      3.1.12. In-line mark up

      +
      +

      First of all, all in-line mark up does not touch code (in-line as well as blocks) and to some extend links: they can be marked as code.

      + + +
      3.1.12.1. Emphasize with <em>
      +
      +

      To mark some text as <em> you can enclose that text either with ** or with __.

      +

      Therefore the following two lines are equivalent:

      +
      This is an **ordinary** paragraph.
      +This is an __ordinary__ paragraph.
      +

      This is the result in any case:

      +

      This is an ordinary paragraph.

      +

      Notes:

      +
        +
      • Underscores within words are not considered mark-up directives. +
      + +
      3.1.12.2. Emphasize with <strong>
      +
      +

      To mark some text as <strong> you can enclose that text either with * or with _.

      +

      Therefore the following two lines are equivalent:

      +
      This is an *ordinary* paragraph.
      +This is an _ordinary_ paragraph.
      +

      This is the result in any case:

      +

      This is an ordinary paragraph.

      +

      Notes:

      +
        +
      • Underscores within words are not considered mark-up directives. +
      +

      If you need a leading underscore as part of a name then you must escape the underscore with a backslash. This:

      +
      \_VarsName
      +

      leads to this:

      +

      _VarsName

      + +
      3.1.12.3. Strike-through with <del>
      +
      +

      To mark some text with <del> you can enclose that text with ~~:

      +
      This ~~is~~ was an ordinary paragraph.
      +

      This is the result:

      +

      This is was an ordinary paragraph.

      +

      Note that to the right of any opening ~~ and to the left of any closing ~~ there must be a non-white-space character.

      + +
      3.1.12.4. Line breaks
      +
      +

      There are two different ways to enforce a line break (= inserting a <br/> tag) into paragraphs, lists, footnotes and table cells:

      +
        +
      • Have a backslash character (\) at the end of a line. This is much clearer but has still the disadvantage that you cannot use it in table cells - there is no “end of line” in those. +
      • Insert <<br>> and it will become a <br/> tag. This is the recommended way: it is readable and can be used in table cells as well. However, it is a MarkAPL-only feature. +
      +

      Having two blanks at the end of a paragraph or list item is according to the Markdown implementation — and also the early versions of MarkAPL — designed to inject a line break. This caused bug reports by people who accidentally added two spaces to the end of a line without realizing and then started to wonder where exactly the line break was coming from. It seemed to be a bad idea from the start; therefore this feature was removed from MarkAPL in version 1.3.0.

      + +
      3.1.12.5. In-line code (verbatim)
      +
      +

      You can insert code samples into paragraphs, blockquotes, lists, cells and footnotes by putting back-ticks around them:

      +
      This: `is code`
      +

      Note that in order to show a back-tick within code you need to double it:

      +
      Enclose in-line code with a back-tick character (````).
      +

      Note also that the number of back-ticks in a paragraph (list, cell,…) must be even. If that's not the case then a closing back-tick is added to the end. That's why this seems to work:

      +
      This is back-tick: ` ``
      +

      This is back-tick: `

      +

      However, adding a dot emphasizes what is really going on here:

      +
      This is back-tick: ` ``.
      +

      This is back-tick: `.

      +

      Since the missing back-tick is added to the end of the paragraph the dot becomes part of the code. That's probably not what you want to happen.

      + +

      3.1.13. Links

      +
      + + +
      3.1.13.1. External links
      +
      +

      Generally an external link looks like this:

      +
      [The APL wiki](http://aplwiki.com "Link to the APL wiki")
      +

      The result is a link like this one: The APL wiki which brings you to the APL wiki.

      +

      The title (that's the stuff within the double-quotes) is optional, therefore the link can also be written as:

      +
      [The APL wiki](http://aplwiki.com)
      +

      If you want the URL to become the link text then this would suffice:

      +
      [](http://aplwiki.com)
      +

      That would result in http://aplwiki.com.

      +

      However, see the next topic (AutoLinks) as well.

      + +
      3.1.13.2. Autolinks
      +
      +

      Because external links are often injected “as is” — meaning that they actually have no link text and no link title — you can also specify a link as:

      +
      <http://aplwiki.com>
      +

      That results is this link: http://aplwiki.com: the link text and the URL are identical.

      + +
      3.1.13.3. Internal links (bookmarks)
      +
      +

      Bookmark links are defined by a leading #. This character tells that the link points to a place somewhere in the same document.

      +

      The text of a bookmark link must be compiled of one or more of ⎕D,'∆⍙',⎕A,Lowercase ⎕A: All digits, all letters of the ASCII characters set, lowercase or uppercase and the two APL characters and .

      +

      Note that in HTML5 an ID may start with a digit. This is the default in MarkAPL as well. However, you can change this by setting bookmarkMayStartWithDigit accordingly.

      +

      An example of a bookmark link:

      +
      [Link text](#Anchor)
      +

      The most common internal (or bookmark) link is a link to a header. Since MarkAPL establishes anchors automatically for all headers by default you might expect an easy way to link to them, and you would be right.

      +

      Given this header:

      +
      ## This is (really) chapter 5-2
      +

      MarkAPL transforms this automatically into

      +
      this-is-really-chapter-5-2
      +

      according to the set of rules explained at Headers and bookmarks.

      +

      To link to this header you can say:

      +
      [Link to chapter 5-2](#this-is-really-chapter-5-2)
      +

      and that would work indeed.

      +

      However, instead you could use just the chapter title and specify a # in order to let MarkAPL know that this is an internal link:

      +
      [This is (really) chapter 5-2](#)
      +

      That will result in a bookmark link as well.

      + +
      3.1.13.4. Link references
      +
      +

      Link references are defined by [ID]: url. Such definitions can appear anywhere in the document. There might be a space between the colon and the URL or not.

      +

      IDs must consist of one or more characters of:

      +
        +
      • The US ASCII character set, lower case as well as upper case. +
      • Digits. +
      • The underscore (_) character. +
      • The hyphen (-) character. +
      +

      Other characters are not permitted.

      +

      In the document you can refer to a link reference with:

      +
      [The APL wiki][aplwiki]
      +

      The text between the the first pair of square brackets is the link text, the text between the second pair of square brackets is the ID of the link reference in question.

      +

      If the link text is not specified then the URL becomes the link text.

      +
      [][aplwiki]
      +

      Note: in case of a typo — meaning that MarkAPL cannot find the link reference — the text will appear “as is” in the final document but the missing reference will also be reported on ns.report.

      + +
      3.1.13.5. Links containing code
      +
      +

      Note that this works:

      +
      [`FunctionName`](#)
      +

      This on the other hand does not work:

      +
      `[FunctionName](#)`
      +

      The reason is simple:

      +
        +
      • In the first expression the ` are removed before the contents between [ and ] is converted into a link but it is still marked up with <pre> and <code>. +
      • The second statement is of course treated like code. No links then. +
      + +
      3.1.13.6. Links and special attributes
      +
      +

      Special Attributes can be assigned to all links:

      +
        +
      • <http://aplwiki.com{#foo1}> Note that there must be no white-space here! +
      • [BookMark Link](# {#foo2}) +
      • [APL wiki](http://aplwiki.com {#foo3}) +
      • [](http://aplwiki.com {target="_blank"}) +
      + +

      3.1.14. Lists

      +
      + +

      Lists look simple, but when they are nested and/or contain sub-paragraphs and code blocks then things can get quite complicated.

      +

      If your lists comprise just short single sentences then you will find lists easy and intuitive to use; otherwise you are advised to read the list of rules carefully.

      + +
      3.1.14.1. General rules
      +
      +
        +
      1. Lists start with a blank line, followed by a line were the first non-white-space character is either one of -+* for a bulleted list or a digit followed either by a dot (.) or a parenthesis ()) for an ordered list. This is called the list marker. +
      2. If a list follows a paragraph the blank line is not needed. +
      3. A list definition — including all sub lists — breaks at two consecutive empty lines. +
      4. A list definition — including all sub lists — also breaks when after an empty line something is detected that does not carry a list marker and is not indented at all. +
      5. A change of the list marker for bulleted lists (from + to * for example) starts a new list. +
      6. Lists can be nested. +
      7. The number of leading white-space characters between the left margin and the list marker (in case of a list item itself) or content (in case of a sub-paragraph or a code block) defines the level of nesting. +

        That means that any content that is supposed to belong to a particular list item must be indented by the number of characters of the list marker plus the number of white-space characters to the left and to the right of the list marker.

        +
      8. Between a list marker and the content there might be any number of white space characters. +
      9. A list item can contain nothing but: +
          +
        • text (sometimes called initial list item content) +
        • paragraphs +
        • code blocks +
        • sub-lists +
        +
      10. If a list item contains a code block or a paragraph then there must be an empty line before the code block / paragraph. +
      11. Generally a code block may have up to three leading spaces. This rule does not apply for code blocks that are part of a list item since spaces are used as the means to work out which level the code block belongs to. +
      12. Single empty lines between list items and sub-paragraphs / code blocks belonging to a list item are ignored. +
      13. There is no concept of “loose” or “tight” lists. As a consequence the initial contents of a list item is never wrapped in a <p> tag. +
      14. Neither a code block nor a sub-paragraph can reduce the nesting level. This is only possible with a line carrying a list marker. +
      +

      Note that these rules differ from those from the original Markdown (which are inconsistent) and also CommanMark (which are consistent but very complex).

      +

      Originally MarkAPL attempted to implement the CommanMark rules. However, the first bug reports all referred to list problems, and only one was a true bug. Everything else was caused by misunderstanding those very complex rules. Therefore, starting with version 1.3.0, MarkAPL now has its own — simpler and still consistent — set of rules. With these easier to understand rules everything can be achieved but wrapping the content of a list item into a <p> tag.

      +

      A word of warning: getting the number of white-space characters wrong — in particular for sub-paragraphs or code blocks — is the most common reason for unwanted result. You are advised to use a monospace font since this makes it much easier to spot such problems, or to avoid them in the first place.

      + +
      3.1.14.2. Bulleted lists
      +
      +

      Bulleted — or unordered — lists can be marked by an asterisk (*), a plus (+) or a minus (-). There might by zero to three white-space characters between the left margin and the list marker. There might be any number of white-space characters between the list marker and the beginning of the contents.

      +

      Note that for nesting you need to have at least one more space to the left of the list marker per additional level. Although you can choose the number of spaces freely items that are supposed to end up on the same level must have the same number of leading spaces, otherwise results become unpredictable.

      +

      It is recommended to indent with readability in mind.

      +

      Example:

      +
      * First line
      +* Second line
      +  * Yellow
      +  * Brown 
      +    * Light brown
      +    * Medium brown
      +  * Magenta
      +* Third line              
      +
      +

      This results in this:

      +
        +
      • First line +
      • Second line +
          +
        • Yellow +
        • Brown +
            +
          • Light brown +
          • Medium brown +
          +
        • Magenta +
        +
      • Third line +
      + +
      3.1.14.3. Ordered lists
      +
      +

      An ordered list must start with a digit followed by a dot (.) or a parentheses ()) and one or more white-space characters. The digit(s) in the first row define the starting point. For the remaining rows any digit will do. The number of digits is limited to nine because some browser cannot deal with 10.

      +

      There might by zero to three white-space characters between the left margin and the list marker. There might be any number of white-space characters between the list marker and the beginning of the contents.

      +

      Example:

      +
      5. First line
      +5. Second line
      +   1) Yellow
      +   2) Brown 
      +   3) Magenta
      +1. Third line                          
      +

      This results in this:

      +
        +
      1. First line +
      2. Second line +
          +
        1. Yellow +
        2. Brown +
        3. Magenta +
        +
      3. Third line +
      + +
      3.1.14.4. List item contents
      +
      +

      You may want to inject line breaks for readability, or you may not and be lazy, and you may add blanks or not; all has the same effect.

      +

      An example for the lazy approach:

      +
      * This is a list item with plenty of words.  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.
      +* ...
      +

      The same with some line breaks:

      +
      * This is a list item with plenty of words.  Lorem ipsum dolor sit amet, consectetuer
      +adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra
      +nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` 
      +semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.
      +* ...
      +

      The same nicely formatted:

      +
      * This is a list item with plenty of words.  Lorem ipsum dolor sit amet,
      +  consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. 
      +  Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
      +  Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet
      +  velit. Suspendisse id sem consectetuer libero luctus adipiscing.
      +* ...
      +

      However, this would work as well:

      +
      * This is a list item with plenty of words.  Lorem ipsum dolor sit amet,
      + consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
      +     Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae,risus.
      +  Donec sit amet nisl. Aliquam `(+/⍵)÷⍴,⍵` semper ipsum sit amet
      +  velit. Suspendisse id sem
      +            consectetuer libero luctus adipiscing.
      +* ...
      +

      In all cases this would be the result:

      +
      +
        +
      • This is a list item with plenty of words. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae,risus. Donec sit amet nisl. Aliquam (+/⍵)÷⍴,⍵ semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. +
      • … +
      +
      +

      Notes:

      +
        +
      • Line breaks can be injected anywhere, even within links, but not in code (anything between two back-ticks). +
      • Indentation matters only in the first line of any list item and sub-paragraph as well as for the fencing lines of any code blocks. +
      • The end of the contents of a list item (not a list!) is defined by one of: +
          +
        • An empty line (including lines that comprise nothing but spaces) +
        • A line (with or without any leading white-space) that starts with a list marker. +
        +
      + +
      3.1.14.5. Paragraphs and code blocks in list items
      +
      +

      The fencing lines of code blocks as well as the first line of paragraphs that belong to a list item need to be indented by the same number of spaces as the list item they belong to. They must be separated from the initial list item contents or any earlier sub-paragraph or code block by a blank line.

      +

      Note that the number of leading white-space characters (indentations) of any paragraphs must match the number of white-space characters from the left margin to the beginning of the content (the list marker characters count as white space here!) of the list item the paragraph or code block is supposed to belong to.

      +
      1. First line
      +1. Second line
      +   * Yellow
      +     This is **not** a paragraph.
      +
      +     This **is** a paragraph.
      +
      +     ~~~
      +       {+/⍳⍴⍵}
      +     ~~~
      +
      +   This is a paragraph that belongs to "Second line".
      +   * Brown 
      +   * Magenta
      +1. Third line                          
      +

      This results in this:

      +
        +
      1. First line +
      2. Second line +
          +
        • Yellow This is not a paragraph. +

          This is a paragraph.

          +
            {+/⍳⍴⍵}
          +
        +

        This is a paragraph that belongs to “Second line”.

        +
          +
        • Brown +
        • Magenta +
        +
      3. Third line +
      +

      Note that the code block has two leading spaces within the fence. These make it into the output while the leading spaces defining just the indentation don't.

      + +
      3.1.14.6. Lists and special attributes
      +
      +

      When Special attributes are assigned to the very first item on any list then that definition is assigned to the list (<ul> or <ol>) rather than the list item itself.

      +

      When Special_Attributes are assigned to other items than the first one then they are simply removed from that list item.

      + +

      3.1.15. Paragraphs

      +
      +

      Any text between two lines that are either empty or are considered special Markdown syntax and that do not have any leading character(s) recognized as Markdown directives will result in a single paragraph. The only exception is a definition list: Although the term part looks like any ordinary paragraph, the : on the next non-empty line makes it rather a definition.

      +

      Within a paragraph you can use in-line mark-up; see there.

      +

      You may insert NewLine characters (by pressing the <return> key) into a long paragraph in order to improve readability. These NewLine characters won't make it into the output. You don't have to worry about space characters at the end of a line (or at the beginning of the next line) because MarkAPL is taking care of this for you.

      +

      If you want to have a line break at the end of a line add a backslash to that line.

      +

      Alternatively you can insert <<br>> anywhere into a paragraph in order to enforce a line break; see Line breaks for details.

      +

      Note that the original Markdown syntax for line breaks (having two spaces at the end of a line) is not supported by MarkAPL, and for good reasons: hard to spot (if at all), likely to be inserted by accident and therefore likely to cause confusion.

      +

      You can assign Special attributes to a paragraph. With a multi-line paragraph, the special attribute must go into the last line as shown in this example:

      +
      
      + Simple and not multi-line
      + paragraph {#author}
      +
      +

      This results in this HTML:

      +
      <p id="author">Simple and not multi-line paragraph</p>
      +

      There is of course a small chance that something is interpreted as special attribute that actually is just part of the paragraph. In that case you need to escape the curly brackets with \{ and \}.

      + +

      3.1.16. Tables

      +
      + +
      3.1.16.1. Overview
      +
      +

      Note that table rows are defined by having at least one un-escaped pipe symbol. You may however add a leading as well as a trailing pipe symbol if you wish so. Many consider this to be more readable.

      +

      Note that leading and trailing spaces are removed from every cell.

      +

      In one respect MarkAPL goes beyond the standard: according to the Markdown specification you must have a second row with a hyphen (“-”) and the appropriate number of pipe symbols and zero, one or two colons (:) per column but MarkAPL doesn't require this: if there is no such row it assumes that the first row is not a row with column headers but an ordinary row.

      + +
      3.1.16.2. Constructing tables
      +
      +

      So valid table definitions look like this:

      +
      Name | Meaning  {style="margin-left:auto;margin-right:auto;"}
      +-|-
      + APL  | Great
      + Cobol| Old
      + PHP| Oh dear
      +

      resulting in this:

      + + + + + + + + + + + + + + + + + + + + + +
      Name Meaning
      APLGreat
      CobolOld
      PHPOh dear
      +

      If you wonder about {style="margin-left:auto;margin-right:auto;"}: this is a simplified syntax for assigning IDs, class name(s) and attributes. This is discussed under Special attributes.

      +

      Here it is used to style the table with CSS so that it will be centered.

      +

      Another example which you might find more readable:

      +
      | Name  | Meaning |
      +|-------|---------|
      +| APL   | Great   |
      +| Cobol | Old     |
      +| PHP   | Oh dear |
      +

      resulting in this:

      + + + + + + + + + + + + + + + + + + + + + +
      Name Meaning
      APLGreat
      CobolOld
      PHPOh dear
      +

      Without the |-----|--------| row:

      +
      |Name | Meaning|
      +| APL  | Great |
      +| Cobol| Old   |
      +| PHP| Oh dear |
      +

      we get this:

      + + + + + + + + + + + + + + + + + + + +
      NameMeaning
      APLGreat
      CobolOld
      PHPOh dear
      + +
      3.1.16.3. Column alignment
      +
      +

      Note the colons in row two of the following example: they define the alignment of all cells in that column.

      +
      |Name | Meaning| Numbers |
      +|:-   |:------:|--------:|
      +| Left| Center | Right |
      +| A   | B      |  1.00 |
      +| C   | D      | -99.12 | 
      +

      This results in:

      + + + + + + + + + + + + + + + + + + + + + + + + + +
      Name Meaning Numbers
      LeftCenterRight
      AB1.00
      CD-99.12
      +

      If you want a table without column titles but alignment:

      +
      |:-   |:------:|--------:|
      +| Left| Center |   Right |
      +| A   | B      |  1.00 |
      +| C   | D      | -99.12 |     
      + + + + + + + + + + + + + + + + + + +
      LeftCenterRight
      AB1.00
      CD-99.12
      + +
      3.1.16.4. In-line mark-up in cells
      +
      +

      Cells can use in-line mark-up as shown here:

      +
      |First name            |Last Name   |No.        |Code                 |
      +|:---------------------|:-----------|-------:|:----------------------:|
      +|Kai                   | Jaeger     | 1      |`{{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵}` |
      +| Johann-Wolfgang      | von Goethe | 1923   |`{(⍴,⍵)÷+/,⍵}`         |
      +| <http://aplwiki.com> | **bold**   | 123.23 |  `fns ⍣a=b⊣123`       |
      +| _Italic_             | ~~Strike~~ |        |   \|                  |
      +| line<<br>>break             | |        |          |
      +| Last line |
      +

      This is the result:

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      First name Last Name No. Code
      KaiJaeger1{{⍵/⍨2=+⌿0=⍵∘.|⍵}⍳⍵}
      Johann-Wolfgangvon Goethe1923{(⍴,⍵)÷+/,⍵}
      http://aplwiki.combold123.23fns ⍣a=b⊣123
      ItalicStrike|
      line
      break
      Last line
      +

      Note that one cell contains a pipe symbol (|); normally that would confuse the parser but not in this case because it is escaped with a backslash character: \|.

      +

      You can have a table with just column headers:

      +
      |First name |Last Name|
      +|-|-A
      +

      This is the result:

      + + + + + + + + + + + +
      First nameLast Name
      --A
      + +

      3.2. Misc

      +
      + +

      3.2.1. Function calls

      +
      +

      It is possible to embed APL function calls in your Markdown document. The simplest way to call a function #.foo is:

      +
      This: ⍎⍎#.foo⍎⍎ is the result.
      +

      Given a function #.foo←{'FOO'} this will be the result:

      +
      This: FOO is the result.
      +

      The purpose of this features is to either inject simple text or one or more HTML blocks.

      +

      Notes:

      +
        +
      • You cannot inject Markdown: it won't be processed any more when the function is called. The function name must always be fully qualified; that means the function cannot live in either a class instance or an unnamed namespace. +
      • The “ns” namespace is always provided as right argument to the function. +
      +

      You may specify something to the right as in this example:

      +
      This: ⍎⍎#.foo 1 2 'hello'⍎⍎ is the result.
      +

      The array 1 2 'hello' is however passed as left argument since ns is always passed as the right argument.

      +

      The result of such an embedded function must be one of:

      +
        +
      • An empty vector. +
      • Markdown (simple string or nested vector of text vectors). +
      • An HTML block (nested vector of text vectors). +
      +

      However, mixing Markdown and HTML blocks is not permitted.

      +

      In case the function returns an HTML block the function call must stand on its own on a line.

      +

      If an HTML block is returned then the function is responsible for the correct formatting. In particular a <pre> block must look like this otherwise you might not get the desired result:

      +
      <pre><code>Line 1
      +Line 2
      +Last line
      +</code></pre>
      +

      Notes:

      +
        +
      • If the function returns something that starts with a < and ends with a corresponding tag then it it is recognized as an HTML block. You can prevent that by adding leading white space. +
      • The <pre><code> must go onto the same line as the first line of the code; otherwise you end up with a starting empty line. +
      • If the embedded function returns something with a depth different from 0, 1 and 2 an error is thrown. +
      + +

      3.2.2. Special attributes

      +
      +

      One can add special attributes — that is an ID, class name(s) and other attributes — to many elements

      +
        +
      • Code blocks +
      • Definition lists +
      • Headers +
      • Horizontal rulers +
      • Images +
      • Links +
      • Lists +
      • Paragraphs +
      • Tables +
      +

      Notes:

      +
        +
      • If you assign an ID to a header the ID is not actually assigned to the header itself but the associated anchor (bookmark link). Since such an anchor embraces the header tag it can be styled via the anchor. +
      • If an attempted definition of a special attribute fails due to an error like missing = or an odd number of " etc then it's not going to become a special attribute definition but ordinary data. +
      + +
      3.2.2.1. Assigning a class name
      +
      +

      The name of a class can be assigned by just mentioning the name:

      +
      {.classname}
      +

      The leading dot tells MarkAPL that it is a class name.

      +

      Of course you can specify more than just one class name:

      +
      {.foo .goo}
      + +
      3.2.2.2. Assigning an ID
      +
      +

      An ID can be assigned by just mentioning the name:

      +
      {#id}
      +

      The leading # tells MarkAPL that it is an ID.

      + +
      3.2.2.3. Styling
      +
      +

      CSS styling directives are possible as well:

      +
      {style="color:red;line-height:1.4;"}
      + +
      3.2.2.4. Quotes and special attributes
      +
      +

      It is of course possible to put it all together:

      +
      * list item {#myid style="font-family:'APL385 Unicode' .class1 .class2 target="_blank"}'
      +

      Note that you cannot put double-quotes around the name of the font family here because double-quotes are already used to determine the definition of the “style” attribute. Therefore you must use single quotes in this instance.

      + +
      3.2.2.5. Paragraphs and special attributes
      +
      +

      Naturally a multi-line paragraph must define any special attributes at the very end of the paragraph rather than the end of the first line.

      +

      Note that there is a chance for content being mistaken as a special attribute, but this chance is very small indeed. If that happens just escape the curlies with a backslash character:

      +
      
      +This is a paragraph with curlies at the end: \{\}.
      +
      + +

      3.2.3. Data

      +
      +

      You can define key-value pairs of data with statements like these:

      +
      [Data]:author='Kai Jaeger'
      +[DATA]:copies=2
      +[data]:sequence=1 2 3
      +[data]:company=Dyalog Ltd
      +

      This establishes the key-value pairs as ordinary variables in the namespace ns.data. See The "ns" namespace for details.

      +

      The statements shown will create this:

      +
            Display ⊃ns.data
      +┌→────────────────────────┐
      +↓ ┌→─────┐   ┌→─────────┐ │
      +│ │author│   │Kai Jaeger│ │
      +│ └──────┘   └──────────┘ │
      +│ ┌→─────┐                │
      +│ │copies│   2            │
      +│ └──────┘                │
      +│ ┌→───────┐ ┌→────┐      │
      +│ │sequence│ │1 2 3│      │
      +│ └────────┘ └~────┘      │
      +│ ┌→──────┐  ┌→─────────┐ │
      +│ │company│  │Dyalog Ltd│ │
      +│ └───────┘  └──────────┘ │
      +└∊────────────────────────┘
      +

      Notes:

      +
        +
      • The keyword (“data”) is case insensitive. +
      • There may be any number of white-space characters between “[data]:” and the name. +
      • The name must consist of nothing but US ASCII or digits. +
      • If the value is not enclosed by quotes MarkAPL attempts to establish it as numeric value. If that fails however it attempts to establish it as text. +
      • If an entry is invalid the value is empty. For example, in [data]:invalid='text 1 2 3 the closing quote is missing, therefore the expression is invalid. +
      • Problems are reported on ns.report. +
      • MarkAPL itself does not make use of such variables. It is up to other applications to take advantage of these pieces of data. +

        See http://aplwiki.com/PresentAPL for an example: it uses this features to allow the author to set variables like “author”, “company” and “title” which are then used to populate slides and meta tags.

        +
      + +

      3.2.4. Sub topics

      +
      +

      By inserting <<SubTopic>> (case insensitive) one can insert a table of contents for a sub topic. This can be useful in order to avoid overloading the main table of contents. This document has several such SubTOCs embedded, for example The "ns" namespace in detail.

      + +

      3.3. Methods

      +
      + +

      3.3.1. CreateParms

      +
      +

      Niladic function that returns a namespace populated with parameters carrying their default values. CreateParms tries to find for every parameter a value from the command line or environment variables. If it cannot find them it will establish a default value.

      + +

      3.3.2. CreateHelpParms

      +
      +

      This function first calls CreateParms and then sets several parameters so that thy meet the special demands of the file Markdown.html which is this very document you are reading. See Help for details.

      + +

      3.3.3. Execute

      +
      +

      This function is used exclusively by test cases.

      + +

      3.3.4. Help

      +
      +

      Makes your default browser display the file “Markdown.html”.

      +

      The function takes a Boolean right argument: a 1 forces MarkAPL to recompile the file MarkAPL.md into MarkAPL.html. A 0 just views MarkAPL.html with your default browser.

      +

      You might specify an optional left argument: a parameter space, typically created by calling the CreateParms method. This allows creating a help file with non-default parameters. Of course this has only an effect when the right argument is a 1.

      +

      In order to enable Help to find the file Markdown.html (in case the defaults don't work) you must create a parameter space (see CreateHelpParms for details) and then set homeFolder accordingly.

      + +

      3.3.5. Init

      +
      +

      Takes a two-item-vector as right argument:

      +
        +
      1. A parameter namespace, typically created by calling CreateParms. +
      2. A vector of character vectors: the Markdown. +
      +

      Returns the "ns" namespace.

      + +

      3.3.6. MakeHTML_Doc

      +
      +

      Takes HTML, typically created by calling Process, and makes it a fully fledged HTML document by adding <body>, <head> — with <title> — and <html> with the DocType.

      + +

      3.3.7. MarkDown2HTML

      +
      +

      This ambivalent function requires some Markdown as right argument.

      +

      It returns (since version 1.7.0) a two-item vector (shy):

      +
        +
      • The HTML. +
      • The ns namespace. This allows you to check ns.report for any problems. +
      +

      Without a (optional) left argument it creates just the HTML from the Markdown.

      +

      However, you can also create a parameter space by calling CreateParms and set outputFilename. In that case it will create a fully-fledged HTML page from the Markdown and write it to that file. The generated page is also returned as result.

      +

      Finally one can also set the inputFilesName parameter. This trumps the right argument: it reads the input file, expecting it to be Markdown, creates HTML5 from it and write it to the output file. Again the HTML is also returned as result.

      +

      Internally it calls Init & Process & MakHTML_Doc.

      + +

      3.3.8. Process

      +
      +

      This function takes — and returns — an ns namespace which was typically created by calling Init.

      + +

      3.3.9. Version

      +
      +

      Returns the name, the version number and the version date of MarkAPL.

      + +

      3.4. Parameters

      +
      + +

      3.4.1. Overview

      +
      +

      In order to specify parameters follow these steps:

      +
            parms←#.MarkAPL.CreateParms''
      +      parms.∆List                                  
      + body                                                  
      + bookmarkLink                                        6 
      + charset                                         utf-8 
      + checkFootnotes                                      1 
      + checkLinks                                          1 
      + compileFunctions                                    1 
      + cssURL                                             ¯1 
      + debug                                               1 
      + head                                                  
      + homefolder                                         ¯1
      + inputFilename                                         
      + linkToCSS                                           0 
      + markdownStrict                                      0 
      + numberHeaders                                       0 
      + outputFilename                                        
      + printCSS                            MarkAPL_print.css 
      + screenCSS                          MarkAPL_screen.css 
      + subTocs                                             1 
      + title                                         MarkAPL 
      + toc                                                 0 
      + tocCaption                          Table of contents 
      + verbose                                             1 
      +

      The function ∆List lists the contents of the parameter space with the corresponding values.

      +

      After making amendments the parameter space can be passed as the first argument to the MarkAPL.Init function. See How-to for details.

      + +

      3.4.2. The parameters in detail

      +
      + + +
      3.4.2.1. bookmarkLink
      +
      +

      Defaults to 6. That means that all headers of level 1 to 6 are going to be embraced by anchors (bookmarks). See Headers and bookmarks for details.

      +

      Set this to 0 to suppress the insertion of automated bookmark links altogether.

      +

      There is not really a good reason for suppressing this except things like MarkAPL calling itself recursively for blockquotes. Those blockquotes might contain headers, but you don't want them anchored - they might interfere with your real headers.

      + +
      3.4.2.2. bookmarkMayStartWithDigit
      +
      +

      Boolean that defaults to 1: in HTML5 an ID (= bookmark) may indeed start with a digit.

      +

      However, sometimes it might be appropriate to avoid this, for example when MarkAPL creates a Sub-Topic. In such — quite special — circumstances it may well be appropriate to set this to 0.

      + +
      3.4.2.3. charset
      +
      +

      Defaults to “utf-8”.

      + +
      3.4.2.4. checkLinks
      +
      +

      Boolean. The default depends on debug. If this is 1 the Process method checks the internal (bookmark) links and records any problems on ns.report.

      + +
      3.4.2.5. compileFunctions
      +
      +

      Boolean that defaults to 1. There is just one reason to prevent any function from being compiled: performance measurements.

      +

      However, with version 1.8.3 MarkAPL does not compile its functions anymore because this caused trouble under some circumstances while the performance gains are little.

      + +
      3.4.2.6. createFullHtmlPage
      +
      +

      This parameter is ¯1 by default (undefined). That means that the default behaviour of Markdown2HTML is defined by the setting of outputFilename: if it is not empty it will default to 1, otherwise to 0.

      +

      It can be set to either 0 or 1:

      +
        +
      • A 0 means that the given Markdown is converted into an HTML snippet, no matter whether outputFilename is empty or not. +
      • A 1 means that the given Markdown is converted into a fully fledged HTML page, no matter whether outputFilename is empty or not. +
      + +
      3.4.2.7. cssURL
      +
      +

      Holds the web address or folder that is expected to host the two CSS files needed for screen and print. Is ignored in case linkToCSS is 0.

      +

      Defaults to homeFolder.

      + +
      3.4.2.8. head
      +
      +

      If you want to add additional meta tags to the <head> part of a document (just an example) you can assign them to head. They will then be added to the <head> section. This can be a simple string (representing <title> for example) or a vector of simple text vectors (several meta tags for example).

      + +
      3.4.2.9. homeFolder
      +
      +

      This points to the folder where Markdown.html etc live. If the script was loaded with SALT then it tries to find the Files\ folder within the folder the script was loaded from. If it was not loaded with SALT then it tries to find the Files\ folder in the current directory. If that fails as well then you must set homeFolders to ensure that it can find, say, the file Markdown.html when you call Markdown.Help 0 for example.

      + +
      3.4.2.10. inputFilename
      +
      +

      If the markdown you want to process lives in a file rather than the workspace then you can pass an empty vector as right argument to the Process method and specify parms.inputFilename instead.

      + +
      3.4.2.11. linkToCSS
      +
      +

      Boolean that defaults to 0. This means that CSS for screen and print is injected into the resulting HTML page. If this is 1 a <link> tag for the CSS file(s) is added to the header. Naturally cssURL must be set accordingly then.

      + +
      3.4.2.12. markdownStrict
      +
      +

      Boolean that defaults to 0. Settings this to 1 prevents MarkAPL from executing certain operations:

      +
        +
      • It does not attempt to create typographically correct output by exchanging: +
          +
        • ... by ellipses. +
        • --- by em-dashes. You may or you may not have blanks around them. +
        • -- by en-dashes. You may or you may not have blanks around them. +
        • straight quotes against curly quotes. +
        +
      • It does not replace (c) by the copyright symbol. +
      • It does not replace (tm) by the trade-mark symbol. +
      + +
      3.4.2.13. numberHeaders
      +
      +

      An integer or integer vector that defaults to 0, meaning that headers are not numbered.

      +
        +
      • Setting this to 3 means that all headers of level 1 to 3 will be numbered. +
      • Setting this to 2 3 4 will number all headers of level 2, 3 and 4. +
      + +
      3.4.2.14. outputFilename
      +
      +

      Defaults to an empty vector. If specified the HTML will be written to this file by the Markdown2HTML method.

      +

      Note then in case createFullHtmlPage is not a Boolean but ¯1 (that's the default value which stands for “undefined”) then the setting of outputFilename defines what is created from the Markdown:

      +
        +
      • In case outputFilename is empty an HTML snipped is created. +
      • In case outputFilename is not empty a fully fledged HTML page is created. +
      + +
      3.4.2.15. printCSS
      +
      +

      The name of the CSS file for printing. Defaults to MarkAPL_print.css. If this is empty no CSS for printing purposes is included or linked to.

      + +
      3.4.2.16. screenCSS
      +
      +

      The name of the CSS file for the screen. Defaults to MarkAPL_screen.css. If this is empty no CSS for viewing purposes is included or linked to.

      + +
      3.4.2.17. subTocs
      +
      +

      Boolean that defaults to 1. If you want to suppress sub TOCs no matter whether there are any included in the Markdown or not then set this to 0.

      +

      When set to 0 then any strings <<SubTopic>> are removed from the Markdown before processing it.

      +

      This is mainly needed in order to suppress subTOCs in blockquotes.

      + +
      3.4.2.18. title
      +
      +

      Defaults to “MarkAPL”. Defines the <title> tag in the <head> section of the resulting HTML page.

      + +
      3.4.2.19. toc (table of contents)
      +
      +

      An integer or integer vector that defaults to 0, meaning that no table of contents is injected into a document created by MarkAPL.

      +

      You can change this by setting the parameter toc to …

      +
        +
      • a single integer like 3. That is interpreted as “up to 3”: a TOC is compiled from the headers of level 1, 2 and 3 and injected into the HTML document. +
      • a vector of integers. For example, 2 3 4 5 would mean that just these levels are used for creating the TOC. +
      +

      Note that bookmarkLinkmust have at least the same value as toc.

      + +
      3.4.2.20. tocCaption
      +
      +

      Defaults to “Table of contents”. Set this to any character vector you want to appear as header of the TOC. tocCaption will be ignored in case toc is 0.

      + +
      3.4.2.21. verbose
      +
      +

      Boolean that defaults to debug. If this is 1 then the Process method will print the contents off ns.report to the session.

      + +

      3.5. The “ns” namespace.

      +
      + +

      3.5.1. Overview

      +
      +

      The ns namespace is returned (created) by the Init method and modified by the Process method. It contains both input and output variables.

      +

      Before Process is run the variables emptyLines, leadingChars, markdown, markdownLC and withoutBlanks hold data the is extracted from the markdown. When Process is running block by block is processed and removed from these variables. At the same time the variable parms.html is collecting the resulting html. Other variables (abbreviations, data, footnoteDefs, headers, linkRefs, subToc and toc) may or may not collect data in the process as well.

      +

      The two variables report and lineNumber are special, see there.

      + +

      3.5.2. The “ns” namespace in detail

      +
      + +

      The namespace contains the following variables:

      + +
      3.5.2.1. abbreviations
      +
      +

      A (possibly empty) vector of two-item-vectors. The first item holds the abbreviation, the second item the explanation or comment.

      + +
      3.5.2.2. emptyLines
      +
      +

      A vector of Booleans indicating which lines in markdown are empty. Lines consisting of white-space characters only are considered to be empty.

      + +
      3.5.2.3. footnoteDefs
      +
      +

      A matrix that carries all footnote definition found in markdown. The matrix has two columns:

      +
        +
      1. Running number, starting from 1. +
      2. Bookmark name. +
      3. Caption. +
      + +
      3.5.2.4. headers
      +
      +

      A matrix that carries all headers defined in markdown.

      +

      The matrix has three or four columns:

      +
        +
      1. The level of the header, starting with 0. +
      2. The anchor-ready version of the caption. +
      3. The caption. +
      4. The tiered number of the header. +
      +

      Naturally the last column does not exist in case numberHeaders is 0.

      + +
      3.5.2.5. html
      +
      +

      After having created the ns namespace by calling CreateParms this variable is empty. By running the Process method this variable will be filled up.

      + +
      3.5.2.6. leadingChars
      +
      +

      After having created the ns namespace by calling CreateParms this variable contains a limited number of characters from markdown. Leading white-space is removed. This increases performance for many of the checks to be carried out by Process.

      + +
      3.5.2.7. lineNumbers
      +
      +

      After having created the ns namespace by calling CreateParms this variable contains a vector of integers representing line numbers in markdown. This allows the line number to be reported. Also, Function calls can access the line number as well.

      +

      Note that line numbers refer to the MarkDown, not the HTML.

      + +
      3.5.2.8. linkRefs
      +
      +

      A vector of two-item vectors holding the link id — which you will use within the document to link to the definition — in the first item and the URL in the second.

      + +
      3.5.2.9. markdown
      +
      +

      This variable holds the markdown to be processed by Process.

      + +
      3.5.2.10. markdownLC
      +
      +

      Same as markdown but all in lower case. That speeds things up at the expense of memory.

      + +
      3.5.2.11. noOf
      +
      +

      The number of lines processed in the next (or current) step.

      + +
      3.5.2.12. parms
      +
      +

      The parameters that were passed to Init.

      + +
      3.5.2.13. report
      +
      +

      After having created the ns namespace by calling CreateParms this variable is empty. The Process method might add remarks to this variable in case it finds something to complain about or comment on.

      +

      Some methods print the content of this variable to the session in case verbose is 1.

      + +
      3.5.2.14. subToc
      +
      +

      This is a vector of two-item vectors:

      +
        +
      1. The level of the header, starting with 1. +
      2. The caption of the header as displayed. +
      + +
      3.5.2.15. toc
      +
      +

      This is a vector of three four-item vectors (since version 1.3.3):

      +
        +
      1. The level of the header, starting with 1. +
      2. The caption of the header as displayed. +
      3. The internal link name. +
      4. The type of the header: 1 = SeText, 2 = ATX. +
      + +
      3.5.2.16. withoutBlanks
      +
      +

      Same as markdown but without any blanks. This speeds things up at the expense of memory.

      + +

      4. How to

      +
      +

      First of all, you can bring the document your are reading right now into view by executing #.MarkAPL.Help 0.

      +

      One way to study how to make use of MarkAPL is to trace through the method MarkAPL.Help. This should clarify the principles.

      +

      Another way is to look at the test cases named Test_Examples_01 etc in #.TestCases in the workspace MarkAPL.DWS. You can execute them with

      +
      #.TestCases.RunThese 'Examples'
      +

      You can trace through them with

      +
      #.TestCases.RunThese 'Examples' (-⍳1000)
      +

      The numbers select the test cases of the given group (here “Examples”) to be executed. 1000 was chosen to make sure all of them are executed.

      +

      Negative numbers tell the test framework to stop right before a particular test function is going to be executed. That gives you the opportunity to trace through that function without tracing through the actual test framework.

      + +

      5. Problems

      +
      + +

      5.1. Crashes

      +
      +

      When MarkAPL crashes the most likely reason is an invalid definition. Check the variable ns.markdown: that tells you how far MarkAPL got in processing the Markdown.

      +

      However, since MarkAPL should not crash and always produce a document it is appreciated when you report any crashes. See the next topic for how to report a crash.

      + +

      5.2. Bugs

      +
      +

      Please report any bugs to mailto:kai@aplteam.com. I appreciate:

      +
        +
      • The input (Markdown) +
      • Any non-default settings of parameters +
      • A short description of the problem (not as short as “It did not work”… ;) +
      • The version number of MarkAPL. +
      + +

      5.3. Unexpected results

      +
      +

      Before reporting a bug please check carefully your Markdown, in particular when the problem appears in or after complex table or list definitions. More often than not mistakes in the Markdown are causing the problem.

      +

      If you cannot work out why it goes wrong report it to me – see the previous topic for how to report a problem.

      +
      +

      This document refers to version 1.8.4 of MarkAPL. Kai Jaeger ⋄ APL Team Ltd ⋄ 2016-07-24

      +

      Footnotes

      +
      +
      +
        +
      1. Wikipedia definition of abandonware: https://www.wikiwand.com/en/Abandonware

        +
      2. The CommonMark specification: http://spec.commonmark.org/0.24/

        +
      +
      + + \ No newline at end of file diff --git a/SampleMiSites/MS3/Examples/DC/MarkdownSimple.mipage b/SampleMiSites/MS3/Examples/DC/MarkdownSimple.mipage index 0058aec5..ca3ef672 100644 --- a/SampleMiSites/MS3/Examples/DC/MarkdownSimple.mipage +++ b/SampleMiSites/MS3/Examples/DC/MarkdownSimple.mipage @@ -4,10 +4,21 @@ ∇ Compose :Access public - Add #._.Markdown ScriptFollows - ⍝## The Markdown widget processes "markdown" - ⍝Markdown is a simple way to add formatting like headers, **bold**, bulleted lists, and so on to plain text.\ - ⍝It was originally designed to be an easy alternative to HTML, and allows people to create web pages with no HTML experience. + Add _.h3'The Markdown widget based on Kai Jaeger''s MarkAPL project' + Add'The following code produces the output below...' + Add CodeFollows + Add _.Markdown ScriptFollows + ⍝#### The Markdown widget processes "markdown" + ⍝Markdown is a simple way to add formatting like headers, **bold text**, _italicized text_,\ + ⍝* bulleted + ⍝* lists\ + ⍝ + ⍝ + ⍝ and so on, to plain text without having to use HTML markup.\ + ⍝ + ⍝ [Click here for more information on The MarkAPL Project](http://aplwiki.com/MarkAPL). + + ⍝<> ∇ :EndClass diff --git a/SampleMiSites/MS3/Examples/JS/jsSHASimple.mipage b/SampleMiSites/MS3/Examples/JS/jsSHASimple.mipage new file mode 100644 index 00000000..819582da --- /dev/null +++ b/SampleMiSites/MS3/Examples/JS/jsSHASimple.mipage @@ -0,0 +1,31 @@ +:Class jsSHASimple : MiPageSample +⍝ Resource:: jsSHA +⍝ Description:: JavaScript library that implements SHA-based hashing algorithms + + ∇ Compose;ig + :Access public + Use'jsSHA' + Use'JQuery' + Add MarkdownFollows +⍝### jsSHA - JavaScript Hashing Library +⍝ jsSHA is a JavaScript library that implements several SHA-based hashing algorithms\ +⍝ For more information see [https://github.com/Caligatio/jsSHA](https://github.com/Caligatio/jsSHA) +⍝ + ig←('style="max-width:800px"'Add _.Fieldset'Hashing Example').Add _.InputGrid + ig.Labels←'Input Text' 'Hashing Algorithm' 'Output Hash (hex)',¨⊂': ' + ig.Inputs←'inText' 'hashAlg' 'outHash'New¨_.EditField(_.Select('SHA-1' 'SHA-224' 'SHA-256' 'SHA-384' 'SHA-512')1 ⍬'')_.textarea + ig.Inputs[1].Set'size=85 class=input' + ig.Inputs[2].Set'class=input' + ig.Inputs[3].Set'readonly=readonly cols=85' + Add _.Handler '.input' 'change' 0 '' '' 'calcHash()' + Add _.Script ScriptFollows +⍝ function calcHash(){ +⍝ var hashInp = $("#inText").val(); +⍝ var hashType = $("#hashAlg").val(); +⍝ var hashObj = new jsSHA(hashType,"TEXT"); +⍝ hashObj.update(hashInp); +⍝ $("#outHash").val(hashObj.getHash("HEX")); +⍝ } + ∇ +:EndClass + diff --git a/Utils/HTTPCommand.dyalog b/Utils/HTTPCommand.dyalog index f6d10f8c..f9f78825 100644 --- a/Utils/HTTPCommand.dyalog +++ b/Utils/HTTPCommand.dyalog @@ -64,7 +64,7 @@ r←('GET'HTTPCmd)args ∇ - ∇ r←{certs}(cmd HTTPCmd)args;url;parms;hdrs;urlparms;p;b;secure;port;host;page;x509;flags;priority;pars;auth;req;err;chunked;chunk;buffer;chunklength;done;data;datalen;header;headerlen;status;httpver;httpstatus;httpstatusmsg;rc;dyalog;FileSep;donetime + ∇ r←{certs}(cmd HTTPCmd)args;url;parms;hdrs;urlparms;p;b;secure;port;host;page;x509;flags;priority;pars;auth;req;err;chunked;chunk;buffer;chunklength;done;data;datalen;header;headerlen;status;httpver;httpstatus;httpstatusmsg;rc;dyalog;FileSep;donetime;congaCopied ⍝ issue an HTTP command ⍝ certs - optional [X509Cert [SSLValidation [Priority]]] ⍝ args - [1] URL in format [HTTP[S]://][user:pass@]url[:port][/page] @@ -76,6 +76,7 @@ r←⎕NS'' (rc httpver httpstatus httpstatusmsg header data peercert)←¯1 '' 400(⊂'bad request')(0 2⍴⊂'')''⍬ + congaCopied←0 :If 0∊⍴LocalDRC :Select ⊃#.⎕NC'DRC' :Case 9 @@ -89,6 +90,7 @@ →0 :EndIf LDRC←DRC + congaCopied←1 :Else ⎕←'Conga namespace DRC not found or defined' →0 @@ -226,7 +228,7 @@ :EndIf :EndTrap - + httpver httpstatus httpstatusmsg←{⎕ML←3 ⋄ ⍵⊂⍨{⍵∨2<+\~⍵}⍵≠' '}(⊂1 1)⊃header header↓⍨←1 @@ -241,6 +243,11 @@ :EndIf {}LDRC.Close cmd + + :If congaCopied + {}LDRC.Close'.' + LDRC.(⎕EX¨⍙naedfns) + :EndIf ∇ NL←⎕UCS 13 10 diff --git a/Utils/MarkAPL.dyalog b/Utils/MarkAPL.dyalog index d29e2cbd..a60a560d 100644 --- a/Utils/MarkAPL.dyalog +++ b/Utils/MarkAPL.dyalog @@ -44,6 +44,12 @@ ∇ r←Version :Access Public Shared + ⍝ * 1.8.4 + ⍝ * "_italic_." switched on but no off. + ⍝ * 1.8.3 + ⍝ * Functions are not compiled for the time being; see bug <01164>. + ⍝ * Documentation improved. + ⍝ * Bug fix: a table with just a header made MarkAPL crash. ⍝ * 1.8.2 ⍝ * Something like #._fnsName is now recognized as a compound name and NOT marked up with . ⍝ * Both `**` and `*` are now allowed within names. @@ -52,7 +58,7 @@ ⍝ * Recognizing embedded functions did not always work properly. ⍝ * 1.8.0 ⍝ * Definition lists improved. - r←(Last⍕⎕THIS)'1.8.2' '2016-07-03' + r←(Last⍕⎕THIS)'1.8.4' '2016-07-23' ∇ :Field Public Shared ReadOnly PartOfNames←⎕A,⎕D,'_∆⍙','qwertyuiopasdfghjklzxcvbnm' @@ -565,12 +571,14 @@ drop←1 :EndIf ns.html,←⊂'' - cells←SplitTableRowButMaskCode¨drop↓ns.noOf↑ns.markdown - cells←{dlb∘dtb ⍵}¨¨cells - cells←ns{⍺ CheckOddNumberOfDoubleQuotes ⍵'header'}¨¨cells - cells←ns ProcessInlineMarkUp¨¨cells - rows←{('td'∘{⍺,⍵}¨align)Tag¨⍵}¨(⍴align)↑¨cells - ns.html,←⊃,/{(⊂''),⍵,⊂''}¨rows + :If ~0∊⍴cells←drop↓ns.noOf↑ns.markdown + cells←SplitTableRowButMaskCode¨drop↓ns.noOf↑ns.markdown + cells←{dlb∘dtb ⍵}¨¨cells + cells←ns{⍺ CheckOddNumberOfDoubleQuotes ⍵'header'}¨¨cells + cells←ns ProcessInlineMarkUp¨¨cells + rows←{('td'∘{⍺,⍵}¨align)Tag¨⍵}¨(⍴align)↑¨cells + ns.html,←⊃,/{(⊂''),⍵,⊂''}¨rows + :EndIf ns.html,←⊂'' ns.html,←⊂'' ns←Drop ns @@ -1375,7 +1383,6 @@ mask←GetMaskForCode txt bool∧←~mask :AndIf ~0∊⍴ind←Where bool -⍝ :AndIf ~0∊⍴ind←((txt 2∘NotWithinWord¨ind))/ind start←((⍴ind)⍴1 0)/ind end←((⍴ind)⍴0 1)/ind txt[start]←⊂'' @@ -1584,15 +1591,15 @@ NotWithinWord←{ ⍝ ⍵ is a vector of hits for, say `_` ⍝ ⍺ is a two-element vector: - ⍝ * Something like a paragraph - ⍝ * Length of markup (_, *, **, __, ~~, ...); 1∨2 + ⍝ [1] Something like a paragraph + ⍝ [2] Length of markup (_, *, **, __, ~~, ...); 1∨2 (txt length)←⍺ hit←⍵ - boundaries1←(⊂hit+¯1,length)⌷txt - boundaries2←(⊂hit+¯2,length+1)⌷txt - f1←1 1≢boundaries1∊PartOfNames,'.' ⍝ Add "." for compound names - 0=+/b←boundaries1='.':f1 - f2←⊃(~b)/boundaries2∊PartOfNames + boundaries1←(⊂hit+¯1,length)⌷txt ⍝ What's to the left and right of the hit + boundaries2←(⊂hit+¯2,length+1)⌷txt ⍝ What's to the left and right of boundary1 (for recognizing compound names) + f1←1 1≢boundaries1∊PartOfNames + 0=+/b←boundaries1='.':f1 ⍝ No compound names? Done! + f2←⊃b/~boundaries2∊¨(⊂PartOfNames),¨'#' '' f1∧f2 } @@ -2279,7 +2286,7 @@ parms←⍵ 0=parms.compileFunctions:0 ⍝ Don't?! 1(400⌶)'Between':0 ⍝ already compiled - {2(400⌶)⍵}¨↓⎕NL 3 + ⍬ ⍝{2(400⌶)⍵}¨↓⎕NL 3 } Between←{⍵∨≠\⍵}