diff --git a/.ackrc b/.ackrc index ba1f07dc8..5b760ea0d 100644 --- a/.ackrc +++ b/.ackrc @@ -1,4 +1,3 @@ --ignore-dir=dist ---ignore-dir=docs --ignore-dir=editor --ignore-file=match:/^yarn\.lock$/ diff --git a/README.md b/README.md index 9f3312e4e..e1f8f3e4b 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ classDiagram - Example 3 + Example 3 @@ -103,7 +103,7 @@ end - Example 4 + Example 4 diff --git a/docs/content/demos.md b/docs/content/demos.md deleted file mode 100644 index e9821eee0..000000000 --- a/docs/content/demos.md +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: Demos -order: 5 ---- -# Demos -## Basic flowchart -``` -%% Example diagram -graph LR - A[Square Rect] -- Link text --> B((Circle)) - A --> C(Round Rect) - B --> D{Rhombus} - C --> D -``` - -```mermaid -graph LR - A[Square Rect] -- Link text --> B((Circle)) - A --> C(Round Rect) - B --> D{Rhombus} - C --> D -``` - -## Larger flowchart with some styling - - -``` -%% Code for flowchart below -graph TB - sq[Square shape] --> ci((Circle shape)) - - subgraph A subgraph - od>Odd shape]-- Two line<br>edge comment --> ro - di{Diamond with <br/> line break} -.-> ro(Rounded<br>square<br>shape) - di==>ro2(Rounded square shape) - end - - %% Notice that no text in shape are added here instead that is appended further down - e --> od3>Really long text with linebreak<br>in an Odd shape] - - %% Comments after double percent signs - e((Inner / circle<br>and some odd <br>special characters)) --> f(,.?!+-*ز) - - cyr[Cyrillic]-->cyr2((Circle shape Начало)); - - classDef green fill:#9f6,stroke:#333,stroke-width:2px; - classDef orange fill:#f96,stroke:#333,stroke-width:4px; - class sq,e green - class di orange -``` - -```mermaid -graph TB - sq[Square shape] --> ci((Circle shape)) - - subgraph A subgraph - od>Odd shape]-- Two line<br>edge comment --> ro - di{Diamond with <br/> line break} -.-> ro(Rounded<br>square<br>shape) - di==>ro2(Rounded square shape) - end - - %% Notice that no text in shape are added here instead that is appended further down - e --> od3>Really long text with linebreak
in an Odd shape] - - %% Comments after double percent signs - e((Inner / circle
and some odd
special characters)) --> f(,.?!+-*ز) - - cyr[Cyrillic]-->cyr2((Circle shape Начало)); - - classDef green fill:#9f6,stroke:#333,stroke-width:2px; - classDef orange fill:#f96,stroke:#333,stroke-width:4px; - class sq,e green - class di orange -``` -## Basic sequence diagram -``` -%% Sequence diagram code -sequenceDiagram - Alice ->> Bob: Hello Bob, how are you? - Bob-->>John: How about you John? - Bob--x Alice: I am good thanks! - Bob-x John: I am good thanks! - Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row. - - Bob-->Alice: Checking with John... - Alice->John: Yes... John, how are you? -``` -```mermaid -sequenceDiagram - Alice->> Bob: Hello Bob, how are you? - Bob-->> John: How about you John? - Bob--x Alice: I am good thanks! - Bob-x John: I am good thanks! - - Note right of John: Bob thinks a long
long time, so long
that the text does
not fit on a row. - - Bob-->Alice: Checking with John... - Alice->John: Yes... John, how are you? -``` -## Loops, alt and opt -``` -%% Sequence diagram code -sequenceDiagram - loop Daily query - Alice->>Bob: Hello Bob, how are you? - alt is sick - Bob->>Alice: Not so good :( - else is well - Bob->>Alice: Feeling fresh like a daisy - end - - opt Extra response - Bob->>Alice: Thanks for asking - end - end -``` -```mermaid -sequenceDiagram - loop Daily query - Alice->>Bob: Hello Bob, how are you? - alt is sick - Bob->>Alice: Not so good :( - else is well - Bob->>Alice: Feeling fresh like a daisy - end - - opt Extra response - Bob->>Alice: Thanks for asking - end - end -``` -## Message to self in loop -``` -%% Sequence diagram code -sequenceDiagram - participant Alice - participant Bob - Alice->>John: Hello John, how are you? - loop Healthcheck - John->>John: Fight against hypochondria - end - Note right of John: Rational thoughts<br/>prevail... - John-->>Alice: Great! - John->>Bob: How about you? - Bob-->>John: Jolly good! -``` -```mermaid -sequenceDiagram - participant Alice - participant Bob - Alice->>John: Hello John, how are you? - loop Healthcheck - John->>John: Fight against hypochondria - end - Note right of John: Rational thoughts
prevail... - John-->>Alice: Great! - John->>Bob: How about you? - Bob-->>John: Jolly good! -``` \ No newline at end of file diff --git a/docs/content/development.md b/docs/content/development.md deleted file mode 100644 index c22ffc62c..000000000 --- a/docs/content/development.md +++ /dev/null @@ -1,114 +0,0 @@ ---- -order: 9 ---- -# Development - -## Updating the documentation - -## Getting the development environment up -1. Fork the gh-pages branch in the the mermaid repository -2. Do npm install - -## Working with the documentation - -The html files are generated from the source and the markdown files in the docs folder. The site generation is done -using the docker.js framework with the command below. - -``` -docker -i ../mermaid/ -x "*git*|*travis*|*bin*|*dist*|*node_modules*|*gulp*|*lib*|*editor*|*conf*|*scripts*|*test*|*htmlDocs*" --extras mermaid -w -o htmlDocs -``` - -Thus ... One important thing to remember. * Do not edit the html files directly! * Those changes will be overwritten -when the site is re-generated. - -## Committing the changes - -Do a pull request to merge the changes to the site. - -## Things to be done in order to add a new diagram type -### Step 1: Grammar & Parsing -#### Grammar -This would be to define a jison grammar for the new diagram type. That should start with a way to identify that the text in the mermaid tag is a diagram of that type. Create a new folder under diagrams for your new diagram type and a parser folder in it. This leads us to step 2. - -For instance: - -* the flowchart starts with the keyword graph. -* the sequence diagram starts with the keyword sequenceDiagram - -#### Store data found during parsing -There are some jison specific sub steps here where the parser stores the data encountered when parsing the diagram, this data is later used by the renderer. You can during the parsing call a object provided to the parser by the user of the parser. This object can be called during parsing for storing data. - -``` -statement - : 'participant' actor { $$='actor'; } - | signal { $$='signal'; } - | note_statement { $$='note'; } - | 'title' message { yy.setTitle($2); } - ; -``` - -In the extract of the grammar above, it is defined that a call to the setTitle method in the data object will be done when parsing and the title keyword is encountered. - -**Note:** Make sure that the parseError function for the parser is defined and calling mermaidPAI.parseError this way a common way of detecting parse errors is provided for the end-user. - -For more info look in the example diagram type: - -The yy object has the following function: -```javascript -exports.parseError = function(err,hash){ - mermaidAPI.parseError(err,hash); -}; -``` - -when parsing the yy object is initialized as per below: -```javascript - var parser; - parser = exampleParser.parser; - parser.yy = db; -``` - -### Step 2: Rendering -Write a renderer that given the data found during parsing renders the diagram. To look at an example look at sequendeRenderer.js rather then the flowchart renderer as this is a more generic example. - -Place the renderer in the diagram folder. - -### Step 3: Detection of the new diagram type -The second thing to do is to add the capability to detect the new new diagram to type to the detectType in utils.js. The detection should return a key for the new diagram type. - -### Step 4: The final piece - triggering the rendering -At this point when mermaid is trying to render the diagram, it will detect it as being of the new type but there will be no match when trying to render the diagram. To fix this add a new case in the switch statement in main.js:init this should match the diagram type returned from step number 2. The code in this new case statement should call the renderer for the diagram type with the data found by the parser as an argument. - -## Usage of the parser as a separate module - -### Setup -``` -var graph = require('./graphDb'); -var flow = require('./parser/flow'); -flow.parser.yy = graph; -``` - -### Parsing - -``` -flow.parser.parse(text); -``` - -### Data extraction - -``` -// Javascript example -graph.getDirection(); -graph.getVertices(); -graph.getEdges(); -``` - -The parser is also exposed in the mermaid api by calling: -``` -var parser = mermaid.getParser(); -``` -Note that the parse needs a graph object to store the data as per: -``` -flow.parser.yy = graph; -``` - -Look at graphDb.js for more details on that object. \ No newline at end of file diff --git a/docs/content/flowchart.md b/docs/content/flowchart.md deleted file mode 100644 index 008d6608b..000000000 --- a/docs/content/flowchart.md +++ /dev/null @@ -1,448 +0,0 @@ ---- -order: 3 ---- - -# Flowcharts - Basic Syntax -## Graph -This statement declares a new graph and the direction of the graph layout. - -``` -%% Example code -graph TD -``` -This declares a graph oriented from top to bottom. - -```mermaid -graph TD - Start --> Stop -``` - -``` -%% Example code -graph LR -``` - -This declares a graph oriented from left to right. - -Possible directions are: - -* TB - top bottom -* BT - bottom top -* RL - right left -* LR - left right - -* TD - same as TB - -```mermaid -graph LR - Start --> Stop -``` - -## Nodes & shapes - -### A node (default) -``` -graph LR - id1 -``` -```mermaid -graph LR - id -``` -Note that the id is what is displayed in the box. - -### A node with text -It is also possible to set text in the box that differs from the id. If this is done several times, it is the last text -found for the node that will be used. Also if you define edges for the node later on, you can omit text definitions. The -one previously defined will be used when rendering the box. - -``` -graph LR - id1[This is the text in the box] -``` - -```mermaid -graph LR - id1[This is the text in the box] -``` - - -### A node with round edges -``` -graph LR - id1(This is the text in the box); -``` - -```mermaid -graph LR - id1(This is the text in the box) -``` - -### A node in the form of a circle -``` -graph LR - id1((This is the text in the circle)); -``` - -```mermaid -graph LR - id1((This is the text in the circle)) -``` - -### A node in an asymetric shape -``` -graph LR - id1>This is the text in the box] -``` - -```mermaid -graph LR - id1>This is the text in the box] -``` -Currently only the shape above is possible and not its mirror. *This might change with future releases.* - -### A node (rhombus) -``` -graph LR - id1{This is the text in the box} -``` - -```mermaid -graph LR - id1{This is the text in the box} -``` -## Links between nodes - -Nodes can be connected with links/edges. It is possible to have different types of links or attach a text string to a link. - -### A link with arrow head -``` -graph LR - A-->B -``` -``` -graph LR; - A-->B -``` - -### An open link - -``` -graph LR - A --- B -``` - -```mermaid -graph LR; - A --- B -``` - -### Text on links - -``` -A-- This is the text --- B -``` -or -``` -A---|This is the text|B; -``` - -```mermaid -graph LR; - A-- This is the text ---B - -``` - -### A link with arrow head and text -``` -A-->|text|B -``` -```mermaid -graph LR; - A-->|text|B -``` - -or -``` -A-- text -->B -``` -```mermaid -graph LR; - A-- text -->B -``` - - - -### Dotted link --.-> -```mermaid -graph LR; - A-.->B; -``` -### Dotted link with text --. text .-> -```mermaid -graph LR; - A-. text .-> B -``` -### Thick link -==> -```mermaid -graph LR; - A ==> B -``` -### Thick link with text -== text ==> -```mermaid -graph LR; - A == text ==> B -``` - -## Special characters that break syntax - -It is possible to put text within quotes in order to render more troublesome characters. As in the example below: - -``` -graph LR - d1["This is the (text) in the box"] -``` - -```mermaid -graph LR - id1["This is the (text) in the box"] -``` - -### Entity codes to escape characters - -It is possible to escape characters using the syntax examplified here. - -The flowchart defined by the following code: -``` - graph LR - A["A double quote:#quot;"] -->B["A dec char:#9829;"] -``` - -This would render to the diagram below: - -```mermaid - graph LR - A["A double quote:#quot;"] -->B["A dec char:#9829;"] -``` - -## Subgraphs - -``` -subgraph title - graph definition -end -``` - -An example below: - ``` - %% Subgraph example - graph TB - subgraph one - a1-->a2 - end - subgraph two - b1-->b2 - end - subgraph three - c1-->c2 - end - c1-->a2 - ``` - - ```mermaid -graph TB - c1-->a2 - subgraph one - a1-->a2 - end - subgraph two - b1-->b2 - end - subgraph three - c1-->c2 - end - - ``` - - -## Interaction - -It is possible to bind a click event to a node, the click can lead to either a javascript callback or to a link which will be opened in a new browser tab. - -``` -click nodeId callback -``` - -* nodeId is the id of the node -* callback is the name of a javascript function defined on the page displaying the graph, the function will be called with the nodeId as parameter. - -Examples of tooltip usage below: - -``` -<script> - var callback = function(){ - alert('A callback was triggered'); - } -<script> -``` - -``` -graph LR; - A-->B; - click A callback "Tooltip for a callback" - click B "http://www.github.com" "This is a tooltip for a link" -``` - - -The tooltip text is surrounded in double quotes. The styles of the tooltip are set by the class .mermaidTooltip. - -```mermaid -graph LR; - A-->B; - click A callback "Tooltip" - click B "http://www.github.com" "This is a link" -``` - - -When integration mermaid using the mermaidAPI #mermaidapi the function that binds the events need to be run when the finished graph has been added to the page. This is described in the [API usage](#api-usage) section. - -## Styling and classes - -### Styling links -It is possible to style links. For instance you might want to style a link that is going backwards in the flow. As links -have no ids in the same way as nodes, some other way of deciding what style the links should be attached to is required. -Instead of ids, the order number of when the link was defined in the graph is used. In the example below the style -defined in the linkStyle statement will belong to the fourth link in the graph: - -``` -linkStyle 3 stroke:#ff3,stroke-width:4px; -``` - -### Styling a node -It is possible to apply specific styles such as a thicker border or a different background color to a node. - -``` -%% Example code -graph LR - id1(Start)-->id2(Stop) - style id1 fill:#f9f,stroke:#333,stroke-width:4px; - style id2 fill:#ccf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5; -``` -```mermaid -graph LR - id1(Start)-->id2(Stop) - style id1 fill:#f9f,stroke:#333,stroke-width:4px - style id2 fill:#ccf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5 -``` - -#### Classes -More convenient then defining the style every time is to define a class of styles and attach this class to the nodes that -should have a different look. - -a class definition looks like the example below: - - -``` - classDef className fill:#f9f,stroke:#333,stroke-width:4px; -``` - -Attachment of a class to a node is done as per below: - -``` - class nodeId1 className; -``` - -It is also possible to attach a class to a list of nodes in one statement: - -``` - class nodeId1,nodeId2 className; -``` -### Css classes - -It is also possible to pre dine classes in css styles that can be applied from the graph definition as in the example -below: -**Example style** -``` - -``` -**Example definition** -``` -graph LR; - A-->B[AAABBB]; - B-->D; - class A cssClass; -``` - - - - - -### Default class - -If a class is named default it will be assigned to all classes without specific class definitions. - -``` - classDef default fill:#f9f,stroke:#333,stroke-width:4px; -``` - -## Basic support for fontawesome - -It is possible to add icons from fontawesome. In order to do so, you need to add the fontawesome as described in the instructions at -[the fontawesome web site](https://fortawesome.github.io/Font-Awesome/). - -The icons are acessed via the syntax fa:#icon class name#. - -The example code below -``` -graph TD - B["fa:fa-twitter for peace"] - B-->C[fa:fa-ban forbidden] - B-->D(fa:fa-spinner); - B-->E(A fa:fa-camera-retro perhaps?); -``` - -Would render the graph below: - -```mermaid -graph TD - B["fa:fa-twitter for peace"] - B-->C[fa:fa-ban forbidden] - B-->D(fa:fa-spinner); - B-->E(A fa:fa-camera-retro perhaps?); -``` - - - -## Graph declarations with spaces between vertices and link and without semicolon - -* In graph declarations, the statements also can now end without a semicolon. After release 0.2.16, ending a graph statement with semicolon is just optional. So the below graph declaration is also valid along with the old declarations of the graph. - -* A single space is allowed between vertices and the link. However there should not be any space between a vertex and its text and a link and its text. The old syntax of graph declaration will also work and hence this new feature is optional and is introduce to improve readability. - -Below is the new declaration of the graph edges which is also valid along with the old declaration of the graph edges. - -``` - A[Hard edge] -->|Link text| B(Round edge) - B --> C{Decision} - C -->|One| D[Result one] - C -->|Two| E[Result two] -``` - - -```mermaid -graph LR - A[Hard edge] -->|Link text| B(Round edge) - B --> C{Decision} - C -->|One| D[Result one] - C -->|Two| E[Result two] -``` diff --git a/docs/content/gantt.md b/docs/content/gantt.md deleted file mode 100755 index fea48f2fe..000000000 --- a/docs/content/gantt.md +++ /dev/null @@ -1,254 +0,0 @@ ---- -order: 4 ---- - -# Gant diagrams - -> A Gantt chart is a type of bar chart, first developed by Karol Adamiecki in 1896, and independently by Henry Gantt in the 1910s, that illustrates a project schedule. Gantt charts illustrate the start and finish dates of the terminal elements and summary elements of a project. - -Mermaid can render Gantt diagrams. The code snippet below: -``` -%% Example of sequence diagram -gantt - title A Gantt Diagram - - section Section - A task :a1, 2014-01-01, 30d - Another task :after a1 , 20d - section Another - Task in sec :2014-01-12 , 12d - another task : 24d -``` - -Renders the following diagram: - -```mermaid -gantt - title A Gantt Diagram - dateFormat YYYY-MM-DD - section Section - A task :a1, 2014-01-01, 30d - Another task :after a1 , 20d - section Another - Task in sec :2014-01-12 , 12d - another task : 24d -``` - -## Syntax -``` -%% Example with slection of syntaxes - gantt - dateFormat YYYY-MM-DD - title Adding GANTT diagram functionality to mermaid - - section A section - Completed task :done, des1, 2014-01-06,2014-01-08 - Active task :active, des2, 2014-01-09, 3d - Future task : des3, after des2, 5d - Future task2 : des4, after des3, 5d - - section Critical tasks - Completed task in the critical line :crit, done, 2014-01-06,24h - Implement parser and jison :crit, done, after des1, 2d - Create tests for parser :crit, active, 3d - Future task in critical line :crit, 5d - Create tests for renderer :2d - Add to mermaid :1d - - section Documentation - Describe gantt syntax :active, a1, after des1, 3d - Add gantt diagram to demo page :after a1 , 20h - Add another diagram to demo page :doc1, after a1 , 48h - - section Last section - Describe gantt syntax :after doc1, 3d - Add gantt diagram to demo page :20h - Add another diagram to demo page :48h -``` - -Renders like below: - -```mermaid -gantt - dateFormat YYYY-MM-DD - title Adding GANTT diagram functionality to mermaid - - section A section - Completed task :done, des1, 2014-01-06,2014-01-08 - Active task :active, des2, 2014-01-09, 3d - Future task : des3, after des2, 5d - Future task2 : des4, after des3, 5d - - section Critical tasks - Completed task in the critical line :crit, done, 2014-01-06,24h - Implement parser and jison :crit, done, after des1, 2d - Create tests for parser :crit, active, 3d - Future task in critical line :crit, 5d - Create tests for renderer :2d - Add to mermaid :1d - - section Documentation - Describe gantt syntax :active, a1, after des1, 3d - Add gantt diagram to demo page :after a1 , 20h - Add another diagram to demo page :doc1, after a1 , 48h - - section Last section - Describe gantt syntax :after doc1, 3d - Add gantt diagram to demo page :20h - Add another diagram to demo page :48h -``` -### Title - -Tbd - -## Sections statements - -Tbd - -## Setting dates - -Tbd - -### Date format - -Tbd - -#### Diagram definition -Input Example Description: -``` -YYYY 2014 4 digit year -YY 14 2 digit year -Q 1..4 Quarter of year. Sets month to first month in quarter. -M MM 1..12 Month number -MMM MMMM January..Dec Month name in locale set by moment.locale() -D DD 1..31 Day of month -Do 1st..31st Day of month with ordinal -DDD DDDD 1..365 Day of year -X 1410715640.579 Unix timestamp -x 1410715640579 Unix ms timestamp - -Input Example Description -H HH 0..23 24 hour time -h hh 1..12 12 hour time used with a A. -a A am pm Post or ante meridiem -m mm 0..59 Minutes -s ss 0..59 Seconds -S 0..9 Tenths of a second -SS 0..99 Hundreds of a second -SSS 0..999 Thousandths of a second -Z ZZ +12:00 Offset from UTC as +-HH:mm, +-HHmm, or Z -``` - -More info in: http://momentjs.com/docs/#/parsing/string-format/ - -#### Scale - -``` -%a - abbreviated weekday name. -%A - full weekday name. -%b - abbreviated month name. -%B - full month name. -%c - date and time, as "%a %b %e %H:%M:%S %Y". -%d - zero-padded day of the month as a decimal number [01,31]. -%e - space-padded day of the month as a decimal number [ 1,31]; equivalent to %_d. -%H - hour (24-hour clock) as a decimal number [00,23]. -%I - hour (12-hour clock) as a decimal number [01,12]. -%j - day of the year as a decimal number [001,366]. -%m - month as a decimal number [01,12]. -%M - minute as a decimal number [00,59]. -%L - milliseconds as a decimal number [000, 999]. -%p - either AM or PM. -%S - second as a decimal number [00,61]. -%U - week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. -%w - weekday as a decimal number [0(Sunday),6]. -%W - week number of the year (Monday as the first day of the week) as a decimal number [00,53]. -%x - date, as "%m/%d/%Y". -%X - time, as "%H:%M:%S". -%y - year without century as a decimal number [00,99]. -%Y - year with century as a decimal number. -%Z - time zone offset, such as "-0700". -%% - a literal "%" character. -``` -More info in: https://github.com/mbostock/d3/wiki/Time-Formatting - -## Styling - -Styling of the a sequence diagram is done by defining a number of css classes. During rendering these classes are extracted from the - -### Classes used - -Class | Description ---- | --- -actor | Style for the actor box at the top of the diagram. -text.actor | Styles for text in the actor box at the top of the diagram. -actor-line | The vertical line for an actor. -messageLine0 | Styles for the solid message line. -messageLine1 | Styles for the dotted message line. -messageText | Defines styles for the text on the message arrows. -labelBox | Defines styles label to left in a loop. -labelText | Styles for the text in label for loops. -loopText | Styles for the text in the loop box. -loopLine | Defines styles for the lines in the loop box. -note | Styles for the note box. -noteText | Styles for the text on in the note boxes. - -### Sample stylesheet - - -```css - - .grid .tick { - stroke: lightgrey; - opacity: 0.3; - shape-rendering: crispEdges; - } - .grid path { - stroke-width: 0; - } - - - #tag { - color: white; - background: #FA283D; - width: 150px; - position: absolute; - display: none; - padding:3px 6px; - margin-left: -80px; - font-size: 11px; - } - - - - #tag:before { - border: solid transparent; - content: ' '; - height: 0; - left: 50%; - margin-left: -5px; - position: absolute; - width: 0; - border-width: 10px; - border-bottom-color: #FA283D; - top: -20px; - } - .taskText { - fill:white; - text-anchor:middle; - } - .taskTextOutsideRight { - fill:black; - text-anchor:start; - } - .taskTextOutsideLeft { - fill:black; - text-anchor:end; - } - -``` -## Configuration - -Is it possible to adjust the margins for rendering the sequence diagram. - -This is done by defining the **sequenceConfig** part of the configuration object. Read more about it [here](#configuration35). -How to use the CLI is described in the [mermaidCLI](#mermaid-cli8) page. diff --git a/docs/content/index.md b/docs/content/index.md deleted file mode 100644 index d381de1c0..000000000 --- a/docs/content/index.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -order: 0 ---- - -mermaid -======= -![Header Image](images/header.png) - ->Generation of diagrams and flowcharts from text in a similar manner as markdown. - -Ever wanted to simplify documentation and avoid heavy tools like Visio when explaining your code? - -This is why mermaid was born, a simple markdown-like script language for generating charts from text via javascript. [Try it using our editor][live_editor]. - -Code examples below: - -### An example of a flowchart -``` -graph TD; - A-->B; - A-->C; - B-->D; - C-->D; -``` - -### An example of a sequence diagram -``` -sequenceDiagram - participant Alice - participant Bob - Alice->John: Hello John, how are you? - loop Healthcheck - John->John: Fight against hypochondria - end - Note right of John: Rational thoughts <br/>prevail... - John-->Alice: Great! - John->Bob: How about you? - Bob-->John: Jolly good! -``` - -### Example code for a gantt diagram -``` -gantt - dateFormat YYYY-MM-DD - title Adding GANTT diagram functionality to mermaid - section A section - Completed task :done, des1, 2014-01-06,2014-01-08 - Active task :active, des2, 2014-01-09, 3d - Future task : des3, after des2, 5d - Future task2 : des4, after des3, 5d - section Critical tasks - Completed task in the critical line :crit, done, 2014-01-06,24h - Implement parser and jison :crit, done, after des1, 2d - Create tests for parser :crit, active, 3d - Future task in critical line :crit, 5d - Create tests for renderer :2d - Add to mermaid :1d -``` - -Play with mermaid using this [editor](https://danielmschmidt.github.io/mermaid-demo/) or this [live editor][live_editor]. - -## Credits -Many thanks to the [d3](https://d3js.org/) and [dagre-d3](https://github.com/cpettitt/dagre-d3) projects for providing the graphical layout and drawing libraries! -Thanks also to the [js-sequence-diagram](https://bramp.github.io/js-sequence-diagrams) project for usage of the grammar for the sequence diagrams. - -*Mermaid was created by Knut Sveidqvist for easier documentation.* - -Knut has not done all work by himself, here is the full list of the projects [contributors](https://github.com/knsv/mermaid/graphs/contributors). - -# Downstream projects - -Mermaid is supported in a number of publishing systems and editors. Please report if a plugin/editor is missing from the list below: - -* Support in LightPaper 1.2+. [Howto](https://github.com/42Squares/LightPaper/blob/master/doc/Adding%20Mermaid%20Diagrams.md). Discout with code MERMAID_25 -* [gitbook-plugin](https://github.com/JozoVilcek/gitbook-plugin-mermaid) -* light table -* [Confluence plugin](https://marketplace.atlassian.com/plugins/org.anvard.atlassian.mermaid-plugin/server/overview) -* [Using mermaid via docpad](http://nauvalatmaja.com/2015/01/13/rendering-mermaid-in-docpad/) -* [Using mermaid in Jekyll](https://rubygems.org/gems/jekyll-mermaid/versions/1.0.0) -* [Using mermaid via Octopress](http://mostlyblather.com/blog/2015/05/23/mermaid-jekyll-octopress/) -* [Mardown editor Haroopad](http://pad.haroopress.com/user.html) -* [Plugin for atom](https://atom.io/packages/atom-mermaid) -* [Markdown Plus](https://mdp.tylingsoft.com/) -* [Vim Plugin](https://github.com/kannokanno/previm) -* [Sphinx extension](https://github.com/mgaitan/sphinxcontrib-mermaid) -* [Pandoc filter](https://github.com/raghur/mermaid-filter) -* [hads](https://github.com/sinedied/hads) - -# Online live editor - -An editor is available for creating diagrams. With it you can quickly start writing mermaid diagrams. It is possible to: - -* save the result as a svg -* get a link to a viewer of the diagram -* get a link to edit of the diagram to share a diagram so that someone else can tweak it and send a new link back - -* [Editor][live_editor] - -[live_editor]: https://knsv.github.io/mermaid/live_editor/ diff --git a/docs/content/mermaidCLI.md b/docs/content/mermaidCLI.md deleted file mode 100644 index d068e4139..000000000 --- a/docs/content/mermaidCLI.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -order: 4 ---- - -# mermaid CLI - -Installing mermaid globally (`npm install -g mermaid`) will expose the `mermaid` command to your environment, allowing you to generate PNGs from any file containing mermaid markup via the command line. - -**Note:** The `mermaid` command requires [PhantomJS](http://phantomjs.org/) (version `^1.9.0`) to be installed and available in your *$PATH*, or you can specify it's location with the `-e` option. For most environments, `npm install -g phantomjs` will satisfy this requirement. - -## Usage - -``` -$ mermaid --help - -Usage: mermaid [options] ... - -file The mermaid description file to be rendered - -Options: - -s --svg Output SVG instead of PNG (experimental) - -p --png If SVG was selected, and you also want PNG, set this flag - -o --outputDir Directory to save files, will be created automatically, defaults to `cwd` - -O --outputSuffix Suffix to output filenames in front of '.svg' or '.png', defaults to '' - -e --phantomPath Specify the path to the phantomjs executable - -t --css Specify the path to a CSS file to be included when processing output - -c --sequenceConfig Specify the path to the file with the configuration to be applied in the sequence diagram - -g --ganttConfig Specify the path to the file with the configuration to be applied in the gantt diagram - -h --help Show this message - -v --verbose Show logging - -w --width width of the generated png (number) - --version Print version and quit -``` - -``` -mermaid testGraph.mmd -mermaid testGraph.mmd -w 980 -``` - -## Sequence diagram configuration - -The --sequenceConfig option allows overriding the sequence diagram configuration. It could be useful to increase the width between actors, the notes width or the margin to fit some large texts that are not well rendered with the default configuration, for example. - -The content of the file must be a JSON like this: - -``` - -{ - "diagramMarginX": 100, - "diagramMarginY": 10, - "actorMargin": 150, - "width": 150, - "height": 65, - "boxMargin": 10, - "boxTextMargin": 5, - "noteMargin": 10, - "messageMargin": 35 -} - -``` - -These properties will override the default values and if a property is not set in this object, it will left it empty and could raise an error. The current properties (measured in px) are: - -- diagramMarginX: Size of the empty space to add at the left-right of the diagram. -- diagramMarginY: Size of the empty space to add at the top-bottom of the diagram. -- actorMargin: Horizontal space between each participant. The arrows between them would have this size too. -- width: Width of the participant box. -- height: Height of the participant box. -- boxMargin: Blank area around loop boxes. -- boxTextMargin: Blank area between the text and the border in a loop box. -- noteMargin: Size of the empty space around a note. -- messageMargin: Space between messages - -## CLI Known Issues - -- SVG output currently does some replacement on text, as mermaid's SVG output is only appropriate for browsers. Text color and background color is not yet replicated; please use PNGs for most purposes until this is resolved. -- SVG output is decidedly non-standard. It works, but may cause issues in some viewers. diff --git a/docs/content/sequenceDiagram.md b/docs/content/sequenceDiagram.md deleted file mode 100755 index c2cbb19cb..000000000 --- a/docs/content/sequenceDiagram.md +++ /dev/null @@ -1,357 +0,0 @@ ---- -title: Sequence Diagram -order: 3 ---- -# Sequence diagrams - -> A Sequence diagram is an interaction diagram that shows how processes operate with one another and in what order. - -Mermaid can render sequence diagrams. The code snippet below: -``` -%% Example of sequence diagram -sequenceDiagram - Alice->>John: Hello John, how are you? - John-->>Alice: Great! -``` - -Renders the following diagram: - -```mermaid -sequenceDiagram - Alice->>John: Hello John, how are you? - John-->>Alice: Great! -``` - -## Syntax - -### Participants - -The participants can be defined implicitly as in the first example on this page. The participants or actors are -rendered in order of appearance in the diagram source text. Sometimes you might want to show the participants in a -different order than how they appear in the first message. It is possible to specify the actor's order of -appearance by doing the following: - -``` -%% Example of sequence diagram -sequenceDiagram - participant John - participant Alice - Alice->>John: Hello John, how are you? - John-->>Alice: Great! -``` - -Renders to the diagram below: - -```mermaid -sequenceDiagram - participant John - participant Alice - Alice->>John: Hello John, how are you? - John-->>Alice: Great! -``` - -## Messages -Messages can be of two displayed either solid or with a dotted line. - -``` -[Actor][Arrow][Actor]:Message text -``` - -There are six types of arrows currently supported: - -Type | Description ---- | --- --> | Solid line without arrow ---> | Dotted line without arrow -->> | Solid line with arrowhead --->> | Dotted line with arrowhead --x | Solid line with a cross at the end (async) ---x | Dotted line with a cross at the end (async) - - -## Activations -It is possible to activate and deactivate an actor. (de)activation can be dedicated declarations: - -``` -sequenceDiagram - Alice->>John: Hello John, how are you? - activate John - John-->>Alice: Great! - deactivate John -``` - -Renders to the diagram below: - -```mermaid -sequenceDiagram - Alice->>John: Hello John, how are you? - activate John - John-->>Alice: Great! - deactivate John -``` - -There is also a shortcut notation by appending `+`/`-` suffix to the message arrow: - -``` -sequenceDiagram - Alice->>+John: Hello John, how are you? - John-->>-Alice: Great! -``` - -Activations can be stacked for same actor: - -``` -sequenceDiagram - Alice->>+John: Hello John, how are you? - Alice->>+John: John, can you hear me? - John-->>-Alice: Hi Alice, I can hear you! - John-->>-Alice: I feel great! -``` - -Stacked activations look like this: - -```mermaid -sequenceDiagram - Alice->>+John: Hello John, how are you? - Alice->>+John: John, can you hear me? - John-->>-Alice: Hi Alice, I can hear you! - John-->>-Alice: I feel great! -``` - -## Notes -It is possible to add notes to a sequence diagram. This is done by the notation -Note [ right of | left of | over ] [Actor]: Text in note content - -See the example below: -``` -%% Example of sequence diagram -sequenceDiagram - participant John - Note right of John: Text in note -``` - -Renders to the diagram below: - -```mermaid -sequenceDiagram - participant John - Note right of John: Text in note -``` - -It is also possible to create notes spanning two participants: -``` -sequenceDiagram - Alice->John: Hello John, how are you? - Note over Alice,John: A typical interaction -``` - -```mermaid -sequenceDiagram - Alice->John: Hello John, how are you? - Note over Alice,John: A typical interaction -``` - -## Loops -It is possible to express loops in a sequence diagram. This is done by the notation -``` -loop Loop text -... statements ... -end -``` - -See the example below -``` -%% Example of sequence diagram -sequenceDiagram - Alice->John: Hello John, how are you? - loop Reply every minute - John-->Alice: Great! - end -``` - -```mermaid -sequenceDiagram - Alice->John: Hello John, how are you? - loop Every minute - John-->Alice: Great! - end -``` - -## Alt -It is possible to express alternative paths in a sequence diagram. This is done by the notation -``` -alt Describing text -... statements ... -else -... statements ... -end -``` - -or if there is sequence that is optional (if without else). - -``` -opt Describing text -... statements ... -end -``` - -See the example below -``` -%% Example of sequence diagram - sequenceDiagram - Alice->>Bob: Hello Bob, how are you? - alt is sick - Bob->>Alice: Not so good :( - else is well - Bob->>Alice: Feeling fresh like a daisy - end - opt Extra response - Bob->>Alice: Thanks for asking - end - -``` - -```mermaid -sequenceDiagram - Alice->>Bob: Hello Bob, how are you? - alt is sick - Bob->>Alice: Not so good :( - else is well - Bob->>Alice: Feeling fresh like a daisy - end - opt Extra response - Bob->>Alice: Thanks for asking - end -``` -## Styling - -Styling of the a sequence diagram is done by defining a number of css classes. During rendering these classes are extracted from the - -### Classes used - -Class | Description ---- | --- -actor | Style for the actor box at the top of the diagram. -text.actor | Styles for text in the actor box at the top of the diagram. -actor-line | The vertical line for an actor. -messageLine0 | Styles for the solid message line. -messageLine1 | Styles for the dotted message line. -messageText | Defines styles for the text on the message arrows. -labelBox | Defines styles label to left in a loop. -labelText | Styles for the text in label for loops. -loopText | Styles for the text in the loop box. -loopLine | Defines styles for the lines in the loop box. -note | Styles for the note box. -noteText | Styles for the text on in the note boxes. - -### Sample stylesheet - - -```css - -body { - background: white; -} - -.actor { - stroke: #CCCCFF; - fill: #ECECFF; -} -text.actor { - fill:black; - stroke:none; - font-family: Helvetica; -} - -.actor-line { - stroke:grey; -} - -.messageLine0 { - stroke-width:1.5; - stroke-dasharray: "2 2"; - marker-end:"url(#arrowhead)"; - stroke:black; -} - -.messageLine1 { - stroke-width:1.5; - stroke-dasharray: "2 2"; - stroke:black; -} - -#arrowhead { - fill:black; - -} - -.messageText { - fill:black; - stroke:none; - font-family: 'trebuchet ms', verdana, arial; - font-size:14px; -} - -.labelBox { - stroke: #CCCCFF; - fill: #ECECFF; -} - -.labelText { - fill:black; - stroke:none; - font-family: 'trebuchet ms', verdana, arial; -} - -.loopText { - fill:black; - stroke:none; - font-family: 'trebuchet ms', verdana, arial; -} - -.loopLine { - stroke-width:2; - stroke-dasharray: "2 2"; - marker-end:"url(#arrowhead)"; - stroke: #CCCCFF; -} - -.note { - stroke: #decc93; - stroke: #CCCCFF; - fill: #fff5ad; -} - -.noteText { - fill:black; - stroke:none; - font-family: 'trebuchet ms', verdana, arial; - font-size:14px; -} - -``` -## Configuration - -Is it possible to adjust the margins for rendering the sequence diagram. - -This is done by defining **mermaid.sequenceConfig** or by the CLI to use a json file with the configuration. -How to use the CLI is described in the [mermaidCLI](#mermaid-cli8) page. -**mermaid.sequenceConfig** can be set to a JSON string with config parameters or the corresponding object. - -``` -mermaid.sequenceConfig = { - diagramMarginX:50, - diagramMarginY:10, - boxTextMargin:5, - noteMargin:10, - messageMargin:35, - mirrorActors:true - }; -``` - -### Possible configration params: - -Param | Descriotion | Default value ---- | --- | --- -mirrorActor | Turns on/off the rendering of actors below the diagram as well as above it | false -bottomMarginAdj | Adjusts how far down the graph ended. Wide borders styles with css could generate unwantewd clipping which is why this config param exists. | 1 diff --git a/docs/content/upgrading.md b/docs/content/upgrading.md deleted file mode 100644 index 045064394..000000000 --- a/docs/content/upgrading.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -order: 10 ---- - -# Upgrading to from version -0.4.0 - -Some of the interfaces has been upgraded. - -## Initialization - -mermaid_config is no longer used. Instead a call to mermaid initialize is done as in the example below: - -### version 0.4.0 - -``` -mermaid_config = { - startOnLoad:true - }; -``` - -### will look like below in version 0.5.0 - -``` -mermaid.initialize({ - startOnLoad:true -}); -``` diff --git a/docs/content/usage.md b/docs/content/usage.md deleted file mode 100644 index dd673589a..000000000 --- a/docs/content/usage.md +++ /dev/null @@ -1,403 +0,0 @@ ---- -title: Usage -order: 1 ---- -# Usage -## Installation - -Either use the npm or bower package managers as per below: - -``` -bower install mermaid --save-dev -``` - -``` -npm install mermaid --save-dev -``` - -Or download a javascript bundle and a stylesheet, e.g. the urls below are for the default style and the all-in-one javascript - note that #version# should be replaced with version of choice: - -``` -https://cdn.rawgit.com/knsv/mermaid/#version#/dist/mermaid.css -https://cdn.rawgit.com/knsv/mermaid/#version#/dist/mermaid.min.js -``` - -Ex: -* [js version 6.0.0](https://cdn.rawgit.com/knsv/mermaid/6.0.0/dist/mermaid.min.js) - -Checkout the [latest version](https://github.com/knsv/mermaid/releases) and [other styles](https://github.com/knsv/mermaid/tree/master/dist) such as `forest` and `dark`. - -There are some bundles to choose from: -* mermaid.js, mermaid.min.js This bundle contains all the javascript libraries you need to run mermaid -* mermaid.slim.js, mermaid.slim.min.js This bundle does not contain d3 which is useful for sites that already have d3 in place -* mermaidAPI.js, mermaidAPI.min.js, This bundle does not contain the web integration provided in the other packages but has a render function instead returns svg code. - - -** Important: ** -> It's best to use a specific tag or commit hash in the URL (not a branch). Files are cached permanently after the first request. - -Read more about that at [https://rawgit.com/](https://rawgit.com/) - -## Simple usage on a web page - -The easiest way to integrate mermaid on a web page requires two elements: -1. Inclusion of the mermaid framework in the html page using a script tag -2. A graph definition on the web page - -If these things are in place mermaid listens to the page load event and when fires, when the page has loaded, it will -locate the graphs n the page and transform them to svg files. - -### Include mermaid on your web page: - -```html - -<script src="mermaid.min.js"></script> -<script>mermaid.initialize({startOnLoad:true});</script> -``` - -Further down on your page mermaid will look for tags with ```class="mermaid"```. From these tags mermaid will try to -read the chart definiton which will be replaced with the svg chart. - - -### Define a chart like this: - -``` -<div class="mermaid"> - CHART DEFINITION GOES HERE -</div> - -``` - -Would end up like this: -``` -<div class="mermaid" id="mermaidChart0"> - <svg> - Chart ends up here - </svg> -</div> - -``` -An id is also added to mermaid tags without id. - -### Simple full example: -```html - - - - - - - - - - - - - - - - - - - - - -
- graph LR - A --- B - B-->C[fa:fa-ban forbidden] - B-->D(fa:fa-spinner); -
- - - -``` -### Labels out of bounds - -If you use dynamically loaded fonts that are loaded through CSS, such as Google fonts, mermaid should wait for the -whole page to have been loaded (dom + assets, particularly the fonts file). - -$(document).load(function() { - mermaid.initialize(); -}); -over - -$(document).ready(function() { - mermaid.initialize(); -}); - -Not doing so will most likely result in mermaid rendering graphs that have labels out of bounds. The default integration -in mermaid uses the window.load event to start rendering. - -### Calling **mermaid.init** -By default, **mermaid.init** will be called when the document is ready, finding all elements with -``class="mermaid"``. If you are adding content after mermaid is loaded, or otherwise need -finer-grained control of this behavior, you can call `init` yourself with: -- a configuration object -- some nodes, as - - a node - - an a array-like of nodes - - or W3C selector that will find your nodes - -Example: -``` -mermaid.init({noteMargin: 10}, ".someOtherClass"); -``` -Or with no config object, and a jQuery selection: -``` -mermaid.init(undefined, $("#someId .yetAnotherClass")); -``` - - - -## Usage with browserify -The reader is assumed to know about CommonJS style of module handling and how to use browserify. If not a good place -to start would be http://browserify.org/ website. - -Minimalistic javascript: -``` -mermaid = require('mermaid'); -console.log('Test page! mermaid version'+mermaid.version()); -``` -Bundle the javascript with browserify. - -Us the created bundle on a web page as per example below: -```html -<!DOCTYPE html> -<html> -<head> - <meta charset="UTF-8"> - <link rel="stylesheet" href="mermaid.css" /> - <script src="bundle.js"></script> -</head> -<body> - <div class="mermaid"> - graph LR - A-->B - B-->C - C-->A - D-->C - </div> -</body> -</html> -``` - -## API usage -The main idea with the API is to be able to call a render function with graph defintion as a string. The render function -will render the graph and call a callback with the resulting svg code. With this approach it is up to the site creator to -fetch the graph definition from the site, perhaps from a textarea, render it and place the graph somewhere in the site. - -To do this, include mermaidAPI on your web website instead of mermaid.js. The example below show an outline of how this -could be used. The example just logs the resulting svg to the javascript console. - -``` -<script src="mermaidAPI.js"></script> - -<script> - mermaidAPI.initialize({ - startOnLoad:false - }); - $(function(){ - // Example of using the API - var element = document.querySelector("#graphDiv"); - - var insertSvg = function(svgCode, bindFunctions){ - element.innerHTML = svgCode; - }; - - var graphDefinition = 'graph TB\na-->b'; - var graph = mermaidAPI.render('graphDiv', graphDefinition, insertSvg); - }); -</script> -``` -## Sample of API usage together with browserify -``` -$ = require('jquery'); -mermaidAPI = require('mermaid').mermaidAPI; -mermaidAPI.initialize({ - startOnLoad:false - }); - -$(function(){ - var graphDefinition = 'graph TB\na-->b'; - var cb = function(html){ - console.log(html); - } - mermaidAPI.render('id1',graphDefinition,cb); -}); -``` - -### Binding events - -Sometimes the generated graph also has defined interactions like tooltip and click events. When using the API one must -add those events after the graph has been inserted into the DOM. - -The example code below is an extract of wheat mermaid does when using the API. The example show how it is possible to -bind events to a svg when using the API for rendering. - -``` - var insertSvg = function(svgCode, bindFunctions){ - element.innerHTML = svgCode; - if(typeof callback !== 'undefined'){ - callback(id); - } - bindFunctions(element); - }; - - var id = 'theGraph'; - - - mermaidAPI.render(id,txt,insertSvg, element); -``` - -1. The graph is generated using the render call. -2. After generation the render function calls the provided callback function, in this case its called insertSvg. -3. The callback function is called with two parameters, the svg code of the generated graph and a function. This -function binds events to the svg **after** it is inserted into the DOM. -4. Insert the svg code into the DOM for presentation -5. Call the binding function that bainds the events - -## Example of a marked renderer - -This is the renderer used for transforming the documentation from markdown to html with mermaid diagrams in the html. - -``` - var renderer = new marked.Renderer(); - renderer.code = function (code, language) { - if(code.match(/^sequenceDiagram/)||code.match(/^graph/)){ - return '<div class="mermaid">'+code+'</div>'; - } - else{ - return '<pre><code>'+code+'</code></pre>'; - } - }; -``` - -Another example in coffeescript that also includes the mermaid script tag into the generated markup. -``` -marked = require 'marked' - -module.exports = (options) -> - hasMermaid = false - renderer = new marked.Renderer() - renderer.defaultCode = renderer.code - renderer.code = (code, language) -> - if language is 'mermaid' - html = '' - if not hasMermaid - hasMermaid = true - html += '&ltscript src="'+options.mermaidPath+'"></script>' - html + '&ltdiv class="mermaid">'+code+'</div>' - else - @defaultCode(code, language) - - renderer -``` - -## Advanced usage - -**Error handling** - -When the parser encounters invalid syntax the **mermaid.parseError** function is called. It is possible to override this -function in order to handle the error in an application specific way. - -**Parsing text without rendering** - -It is also possible to validate the syntax before rendering in order to streamline the user experience. The function -**mermaid.parse(txt)** takes a text string as an argument and returns true if the text is syntactically correct and -false if it is not. The parseError function will be called when the parse function returns false. - -The code-example below in meta code illustrates how this could work: - -```js - -mermaid.parseError = function(err,hash){ - displayErrorInGui(err); -}; - -var textFieldUpdated = function(){ - var textStr = getTextFromFormField('code'); - - if(mermaid.parse(textStr)){ - reRender(textStr) - } -}; - -bindEventHandler('change', 'code', textFieldUpdated); -``` - -# Configuration -Mermaid takes a number of options which lets you tweak the rendering of the diagrams. Currently there are three ways of -setting the options in mermaid. - -1. Instantiation of the configuration using the initialize call -2. *Using the global mermaid object* - deprecated -3. *using the global mermaid_config object* - deprecated -4. Instantiation of the configuration using the **mermaid.init** call - -The list above has two ways to many of doing this. Three are deprecated and will eventually be removed. The list of -configuration objects are described [in the mermaidAPI documentation](http://knsv.github.io/mermaid/index.html#configuration28). - -## Using the mermaidAPI.initialize/mermaid.initialize call - -The future proof way of setting the configuration is by using the initialization call to mermaid or mermaidAPi depending -on what kind of integration you use. - -``` - <script src="../dist/mermaid.js"></script> - <script> - var config = { - startOnLoad:true, - flowchart:{ - useMaxWidth:false, - htmlLabels:true - } - }; - mermaid.initialize(config); - </script> -``` - - - - -## Using the mermaid object - -Is it possible to set some configuration via the mermaid object. The two parameters that are supported using this -approach are: - -* mermaid.startOnLoad -* mermaid.htmlLabels - -``` -mermaid.startOnLoad = true; -``` - - - -## Using the mermaid_config - -Is it possible to set some configuration via the mermaid object. The two parameters that are supported using this -approach are: - -* mermaid_config.startOnLoad -* mermaid_config.htmlLabels - -``` -mermaid_config.startOnLoad = true; -``` - - - -## Using the mermaid.init call - -Is it possible to set some configuration via the mermaid object. The two parameters that are supported using this -approach are: - -* mermaid_config.startOnLoad -* mermaid_config.htmlLabels - -``` -mermaid_config.startOnLoad = true; -``` - - diff --git a/docs/site/fonts/slate.eot b/docs/site/fonts/slate.eot deleted file mode 100755 index 13c4839a1..000000000 Binary files a/docs/site/fonts/slate.eot and /dev/null differ diff --git a/docs/site/fonts/slate.svg b/docs/site/fonts/slate.svg deleted file mode 100644 index 5f3498230..000000000 --- a/docs/site/fonts/slate.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - diff --git a/docs/site/fonts/slate.ttf b/docs/site/fonts/slate.ttf deleted file mode 100755 index ace9a46a7..000000000 Binary files a/docs/site/fonts/slate.ttf and /dev/null differ diff --git a/docs/site/fonts/slate.woff b/docs/site/fonts/slate.woff deleted file mode 100755 index 1e72e0ee0..000000000 Binary files a/docs/site/fonts/slate.woff and /dev/null differ diff --git a/docs/site/fonts/slate.woff2 b/docs/site/fonts/slate.woff2 deleted file mode 100755 index 7c585a727..000000000 Binary files a/docs/site/fonts/slate.woff2 and /dev/null differ diff --git a/docs/site/images/header.png b/docs/site/images/header.png deleted file mode 100644 index 06159b2c9..000000000 Binary files a/docs/site/images/header.png and /dev/null differ diff --git a/docs/site/images/logo.png b/docs/site/images/logo.png deleted file mode 100644 index d622fdd4e..000000000 Binary files a/docs/site/images/logo.png and /dev/null differ diff --git a/docs/site/images/logo.psd b/docs/site/images/logo.psd deleted file mode 100644 index 5de9ecaa2..000000000 Binary files a/docs/site/images/logo.psd and /dev/null differ diff --git a/docs/site/images/navbar.png b/docs/site/images/navbar.png deleted file mode 100644 index df38e90d8..000000000 Binary files a/docs/site/images/navbar.png and /dev/null differ diff --git a/docs/site/javascripts/all.js b/docs/site/javascripts/all.js deleted file mode 100644 index 96b2fe9b4..000000000 --- a/docs/site/javascripts/all.js +++ /dev/null @@ -1,146 +0,0 @@ -!(function () { if ('ontouchstart' in window) { var t, e, n, r, i, o, a = {}; t = function (t, e) { return Math.abs(t[0] - e[0]) > 5 || Math.abs(t[1] - e[1]) > 5 }, e = function (t) { this.startXY = [t.touches[0].clientX, t.touches[0].clientY], this.threshold = !1 }, n = function (e) { return this.threshold ? !1 : void (this.threshold = t(this.startXY, [e.touches[0].clientX, e.touches[0].clientY])) }, r = function (e) { if (!this.threshold && !t(this.startXY, [e.changedTouches[0].clientX, e.changedTouches[0].clientY])) { var n = e.changedTouches[0], r = document.createEvent('MouseEvents'); r.initMouseEvent('click', !0, !0, window, 0, n.screenX, n.screenY, n.clientX, n.clientY, !1, !1, !1, !1, 0, null), r.simulated = !0, e.target.dispatchEvent(r) } }, i = function (t) { var e = Date.now(), n = e - a.time, r = t.clientX, i = t.clientY, s = [Math.abs(a.x - r), Math.abs(a.y - i)], u = o(t.target, 'A') || t.target, c = u.nodeName, l = c === 'A', h = window.navigator.standalone && l && t.target.getAttribute('href'); return a.time = e, a.x = r, a.y = i, (!t.simulated && (n < 500 || n < 1500 && s[0] < 50 && s[1] < 50) || h) && (t.preventDefault(), t.stopPropagation(), !h) ? !1 : (h && (window.location = u.getAttribute('href')), void (u && u.classList && (u.classList.add('energize-focus'), window.setTimeout(function () { u.classList.remove('energize-focus') }, 150)))) }, o = function (t, e) { for (var n = t; n !== document.body;) { if (!n || n.nodeName === e) return n; n = n.parentNode } return null }, document.addEventListener('touchstart', e, !1), document.addEventListener('touchmove', n, !1), document.addEventListener('touchend', r, !1), document.addEventListener('click', i, !0) } }()), /* -Copyright 2008-2013 Concur Technologies, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); you may -not use this file except in compliance with the License. You may obtain -a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -License for the specific language governing permissions and limitations -under the License. -*/ -(function (t) { 'use strict'; function e (e) { if (e && e !== '') { $('.lang-selector a').removeClass('active'), $(".lang-selector a[data-language-name='" + e + "']").addClass('active'); for (var n = 0; n < u.length; n++)$('.highlight.' + u[n]).hide(); $('.highlight.' + e).show(), t.toc.calculateHeights(), $(window.location.hash).get(0) && $(window.location.hash).get(0).scrollIntoView(!0) } } function n (t) { return typeof t !== 'string' ? {} : (t = t.trim().replace(/^(\?|#|&)/, ''), t ? t.split('&').reduce(function (t, e) { var n = e.replace(/\+/g, ' ').split('='), r = n[0], i = n[1]; return r = decodeURIComponent(r), i = void 0 === i ? null : decodeURIComponent(i), t.hasOwnProperty(r) ? Array.isArray(t[r]) ? t[r].push(i) : t[r] = [t[r], i] : t[r] = i, t }, {}) : {}) } function r (t) { return t ? Object.keys(t).sort().map(function (e) { var n = t[e]; return Array.isArray(n) ? n.sort().map(function (t) { return encodeURIComponent(e) + '=' + encodeURIComponent(t) }).join('&') : encodeURIComponent(e) + '=' + encodeURIComponent(n) }).join('&') : '' } function i () { if (location.search.length >= 1) { var t = n(location.search).language; if (t) return t; if (jQuery.inArray(location.search.substr(1), u) != -1) return location.search.substr(1) } return !1 } function o (t) { var e = n(location.search); return e.language ? (e.language = t, r(e)) : t } function a (t) { if (history) { var e = window.location.hash; e && (e = e.replace(/^#+/, '')), history.pushState({}, '', '?' + o(t) + '#' + e), localStorage.setItem('language', t) } } function s (t) { var n = localStorage.getItem('language'); u = t; var r = i(); r ? (e(r), localStorage.setItem('language', r)) : e(n !== null && jQuery.inArray(n, u) != -1 ? n : u[0]) } var u = []; t.setupLanguages = s, t.activateLanguage = e, $(function () { $('.lang-selector a').on('click', function () { var t = $(this).data('language-name'); return a(t), e(t), !1 }), window.onpopstate = function () { e(i()) } }) }(window)), /** - * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.7 - * Copyright (C) 2014 Oliver Nightingale - * MIT Licensed - * @license - */ -(function () { - var t = function (e) { var n = new t.Index(); return n.pipeline.add(t.trimmer, t.stopWordFilter, t.stemmer), e && e.call(n, n), n }; t.version = '0.5.7', /*! - * lunr.utils - * Copyright (C) 2014 Oliver Nightingale - */ -t.utils = {}, t.utils.warn = (function (t) { return function (e) { t.console && console.warn && console.warn(e) } }(this)), /*! - * lunr.EventEmitter - * Copyright (C) 2014 Oliver Nightingale - */ -t.EventEmitter = function () { this.events = {} }, t.EventEmitter.prototype.addListener = function () { var t = Array.prototype.slice.call(arguments), e = t.pop(), n = t; if (typeof e !== 'function') throw new TypeError('last argument must be a function'); n.forEach(function (t) { this.hasHandler(t) || (this.events[t] = []), this.events[t].push(e) }, this) }, t.EventEmitter.prototype.removeListener = function (t, e) { if (this.hasHandler(t)) { var n = this.events[t].indexOf(e); this.events[t].splice(n, 1), this.events[t].length || delete this.events[t] } }, t.EventEmitter.prototype.emit = function (t) { if (this.hasHandler(t)) { var e = Array.prototype.slice.call(arguments, 1); this.events[t].forEach(function (t) { t.apply(void 0, e) }) } }, t.EventEmitter.prototype.hasHandler = function (t) { return t in this.events }, /*! - * lunr.tokenizer - * Copyright (C) 2014 Oliver Nightingale - */ -t.tokenizer = function (t) { if (!arguments.length || t == null || void 0 == t) return []; if (Array.isArray(t)) return t.map(function (t) { return t.toLowerCase() }); for (var e = t.toString().replace(/^\s+/, ''), n = e.length - 1; n >= 0; n--) if (/\S/.test(e.charAt(n))) { e = e.substring(0, n + 1); break } return e.split(/(?:\s+|\-)/).filter(function (t) { return !!t }).map(function (t) { return t.toLowerCase() }) }, /*! - * lunr.Pipeline - * Copyright (C) 2014 Oliver Nightingale - */ -t.Pipeline = function () { this._stack = [] }, t.Pipeline.registeredFunctions = {}, t.Pipeline.registerFunction = function (e, n) { n in this.registeredFunctions && t.utils.warn('Overwriting existing registered function: ' + n), e.label = n, t.Pipeline.registeredFunctions[e.label] = e }, t.Pipeline.warnIfFunctionNotRegistered = function (e) { var n = e.label && e.label in this.registeredFunctions; n || t.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', e) }, t.Pipeline.load = function (e) { var n = new t.Pipeline(); return e.forEach(function (e) { var r = t.Pipeline.registeredFunctions[e]; if (!r) throw new Error('Cannot load un-registered function: ' + e); n.add(r) }), n }, t.Pipeline.prototype.add = function () { var e = Array.prototype.slice.call(arguments); e.forEach(function (e) { t.Pipeline.warnIfFunctionNotRegistered(e), this._stack.push(e) }, this) }, t.Pipeline.prototype.after = function (e, n) { t.Pipeline.warnIfFunctionNotRegistered(n); var r = this._stack.indexOf(e) + 1; this._stack.splice(r, 0, n) }, t.Pipeline.prototype.before = function (e, n) { t.Pipeline.warnIfFunctionNotRegistered(n); var r = this._stack.indexOf(e); this._stack.splice(r, 0, n) }, t.Pipeline.prototype.remove = function (t) { var e = this._stack.indexOf(t); this._stack.splice(e, 1) }, t.Pipeline.prototype.run = function (t) { for (var e = [], n = t.length, r = this._stack.length, i = 0; n > i; i++) { for (var o = t[i], a = 0; r > a && (o = this._stack[a](o, i, t), void 0 !== o); a++);void 0 !== o && e.push(o) } return e }, t.Pipeline.prototype.reset = function () { this._stack = [] }, t.Pipeline.prototype.toJSON = function () { return this._stack.map(function (e) { return t.Pipeline.warnIfFunctionNotRegistered(e), e.label }) }, /*! - * lunr.Vector - * Copyright (C) 2014 Oliver Nightingale - */ -t.Vector = function () { this._magnitude = null, this.list = void 0, this.length = 0 }, t.Vector.Node = function (t, e, n) { this.idx = t, this.val = e, this.next = n }, t.Vector.prototype.insert = function (e, n) { var r = this.list; if (!r) return this.list = new t.Vector.Node(e, n, r), this.length++; for (var i = r, o = r.next; void 0 != o;) { if (e < o.idx) return i.next = new t.Vector.Node(e, n, o), this.length++; i = o, o = o.next } return i.next = new t.Vector.Node(e, n, o), this.length++ }, t.Vector.prototype.magnitude = function () { if (this._magniture) return this._magnitude; for (var t, e = this.list, n = 0; e;)t = e.val, n += t * t, e = e.next; return this._magnitude = Math.sqrt(n) }, t.Vector.prototype.dot = function (t) { for (var e = this.list, n = t.list, r = 0; e && n;)e.idx < n.idx ? e = e.next : e.idx > n.idx ? n = n.next : (r += e.val * n.val, e = e.next, n = n.next); return r }, t.Vector.prototype.similarity = function (t) { return this.dot(t) / (this.magnitude() * t.magnitude()) }, /*! - * lunr.SortedSet - * Copyright (C) 2014 Oliver Nightingale - */ -t.SortedSet = function () { this.length = 0, this.elements = [] }, t.SortedSet.load = function (t) { var e = new this(); return e.elements = t, e.length = t.length, e }, t.SortedSet.prototype.add = function () { Array.prototype.slice.call(arguments).forEach(function (t) { ~this.indexOf(t) || this.elements.splice(this.locationFor(t), 0, t) }, this), this.length = this.elements.length }, t.SortedSet.prototype.toArray = function () { return this.elements.slice() }, t.SortedSet.prototype.map = function (t, e) { return this.elements.map(t, e) }, t.SortedSet.prototype.forEach = function (t, e) { return this.elements.forEach(t, e) }, t.SortedSet.prototype.indexOf = function (t, e, n) { var e = e || 0, n = n || this.elements.length, r = n - e, i = e + Math.floor(r / 2), o = this.elements[i]; return r <= 1 ? o === t ? i : -1 : t > o ? this.indexOf(t, i, n) : o > t ? this.indexOf(t, e, i) : o === t ? i : void 0 }, t.SortedSet.prototype.locationFor = function (t, e, n) { var e = e || 0, n = n || this.elements.length, r = n - e, i = e + Math.floor(r / 2), o = this.elements[i]; if (r <= 1) { if (o > t) return i; if (t > o) return i + 1 } return t > o ? this.locationFor(t, i, n) : o > t ? this.locationFor(t, e, i) : void 0 }, t.SortedSet.prototype.intersect = function (e) { for (var n = new t.SortedSet(), r = 0, i = 0, o = this.length, a = e.length, s = this.elements, u = e.elements; ;) { if (r > o - 1 || i > a - 1) break; s[r] !== u[i] ? s[r] < u[i] ? r++ : s[r] > u[i] && i++ : (n.add(s[r]), r++, i++) } return n }, t.SortedSet.prototype.clone = function () { var e = new t.SortedSet(); return e.elements = this.toArray(), e.length = e.elements.length, e }, t.SortedSet.prototype.union = function (t) { var e, n, r; return this.length >= t.length ? (e = this, n = t) : (e = t, n = this), r = e.clone(), r.add.apply(r, n.toArray()), r }, t.SortedSet.prototype.toJSON = function () { return this.toArray() }, /*! - * lunr.Index - * Copyright (C) 2014 Oliver Nightingale - */ -t.Index = function () { this._fields = [], this._ref = 'id', this.pipeline = new t.Pipeline(), this.documentStore = new t.Store(), this.tokenStore = new t.TokenStore(), this.corpusTokens = new t.SortedSet(), this.eventEmitter = new t.EventEmitter(), this._idfCache = {}, this.on('add', 'remove', 'update', function () { this._idfCache = {} }.bind(this)) }, t.Index.prototype.on = function () { var t = Array.prototype.slice.call(arguments); return this.eventEmitter.addListener.apply(this.eventEmitter, t) }, t.Index.prototype.off = function (t, e) { return this.eventEmitter.removeListener(t, e) }, t.Index.load = function (e) { e.version !== t.version && t.utils.warn('version mismatch: current ' + t.version + ' importing ' + e.version); var n = new this(); return n._fields = e.fields, n._ref = e.ref, n.documentStore = t.Store.load(e.documentStore), n.tokenStore = t.TokenStore.load(e.tokenStore), n.corpusTokens = t.SortedSet.load(e.corpusTokens), n.pipeline = t.Pipeline.load(e.pipeline), n }, t.Index.prototype.field = function (t, e) { var e = e || {}, n = {name: t, boost: e.boost || 1}; return this._fields.push(n), this }, t.Index.prototype.ref = function (t) { return this._ref = t, this }, t.Index.prototype.add = function (e, n) { var r = {}, i = new t.SortedSet(), o = e[this._ref], n = void 0 === n ? !0 : n; this._fields.forEach(function (n) { var o = this.pipeline.run(t.tokenizer(e[n.name])); r[n.name] = o, t.SortedSet.prototype.add.apply(i, o) }, this), this.documentStore.set(o, i), t.SortedSet.prototype.add.apply(this.corpusTokens, i.toArray()); for (var a = 0; a < i.length; a++) { var s = i.elements[a], u = this._fields.reduce(function (t, e) { var n = r[e.name].length; if (!n) return t; var i = r[e.name].filter(function (t) { return t === s }).length; return t + i / n * e.boost }, 0); this.tokenStore.add(s, {ref: o, tf: u}) }n && this.eventEmitter.emit('add', e, this) }, t.Index.prototype.remove = function (t, e) { var n = t[this._ref], e = void 0 === e ? !0 : e; if (this.documentStore.has(n)) { var r = this.documentStore.get(n); this.documentStore.remove(n), r.forEach(function (t) { this.tokenStore.remove(t, n) }, this), e && this.eventEmitter.emit('remove', t, this) } }, t.Index.prototype.update = function (t, e) { var e = void 0 === e ? !0 : e; this.remove(t, !1), this.add(t, !1), e && this.eventEmitter.emit('update', t, this) }, t.Index.prototype.idf = function (t) { var e = '@' + t; if (Object.prototype.hasOwnProperty.call(this._idfCache, e)) return this._idfCache[e]; var n = this.tokenStore.count(t), r = 1; return n > 0 && (r = 1 + Math.log(this.tokenStore.length / n)), this._idfCache[e] = r }, t.Index.prototype.search = function (e) { var n = this.pipeline.run(t.tokenizer(e)), r = new t.Vector(), i = [], o = this._fields.reduce(function (t, e) { return t + e.boost }, 0), a = n.some(function (t) { return this.tokenStore.has(t) }, this); if (!a) return []; n.forEach(function (e, n, a) { var s = 1 / a.length * this._fields.length * o, u = this, c = this.tokenStore.expand(e).reduce(function (n, i) { var o = u.corpusTokens.indexOf(i), a = u.idf(i), c = 1, l = new t.SortedSet(); if (i !== e) { var h = Math.max(3, i.length - e.length); c = 1 / Math.log(h) } return o > -1 && r.insert(o, s * a * c), Object.keys(u.tokenStore.get(i)).forEach(function (t) { l.add(t) }), n.union(l) }, new t.SortedSet()); i.push(c) }, this); var s = i.reduce(function (t, e) { return t.intersect(e) }); return s.map(function (t) { return {ref: t, score: r.similarity(this.documentVector(t))} }, this).sort(function (t, e) { return e.score - t.score }) }, t.Index.prototype.documentVector = function (e) { for (var n = this.documentStore.get(e), r = n.length, i = new t.Vector(), o = 0; r > o; o++) { var a = n.elements[o], s = this.tokenStore.get(a)[e].tf, u = this.idf(a); i.insert(this.corpusTokens.indexOf(a), s * u) } return i }, t.Index.prototype.toJSON = function () { return {version: t.version, fields: this._fields, ref: this._ref, documentStore: this.documentStore.toJSON(), tokenStore: this.tokenStore.toJSON(), corpusTokens: this.corpusTokens.toJSON(), pipeline: this.pipeline.toJSON()} }, t.Index.prototype.use = function (t) { var e = Array.prototype.slice.call(arguments, 1); e.unshift(this), t.apply(this, e) }, /*! - * lunr.Store - * Copyright (C) 2014 Oliver Nightingale - */ -t.Store = function () { this.store = {}, this.length = 0 }, t.Store.load = function (e) { var n = new this(); return n.length = e.length, n.store = Object.keys(e.store).reduce(function (n, r) { return n[r] = t.SortedSet.load(e.store[r]), n }, {}), n }, t.Store.prototype.set = function (t, e) { this.has(t) || this.length++, this.store[t] = e }, t.Store.prototype.get = function (t) { return this.store[t] }, t.Store.prototype.has = function (t) { return t in this.store }, t.Store.prototype.remove = function (t) { this.has(t) && (delete this.store[t], this.length--) }, t.Store.prototype.toJSON = function () { return {store: this.store, length: this.length} }, /*! - * lunr.stemmer - * Copyright (C) 2014 Oliver Nightingale - * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt - */ -t.stemmer = (function () { var t = {ational: 'ate', tional: 'tion', enci: 'ence', anci: 'ance', izer: 'ize', bli: 'ble', alli: 'al', entli: 'ent', eli: 'e', ousli: 'ous', ization: 'ize', ation: 'ate', ator: 'ate', alism: 'al', iveness: 'ive', fulness: 'ful', ousness: 'ous', aliti: 'al', iviti: 'ive', biliti: 'ble', logi: 'log'}, e = {icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: ''}, n = '[^aeiou]', r = '[aeiouy]', i = n + '[^aeiouy]*', o = r + '[aeiou]*', a = '^(' + i + ')?' + o + i, s = '^(' + i + ')?' + o + i + '(' + o + ')?$', u = '^(' + i + ')?' + o + i + o + i, c = '^(' + i + ')?' + r, l = new RegExp(a), h = new RegExp(u), f = new RegExp(s), d = new RegExp(c), p = /^(.+?)(ss|i)es$/, g = /^(.+?)([^s])s$/, m = /^(.+?)eed$/, y = /^(.+?)(ed|ing)$/, v = /.$/, b = /(at|bl|iz)$/, _ = new RegExp('([^aeiouylsz])\\1$'), x = new RegExp('^' + i + r + '[^aeiouwxy]$'), w = /^(.+?[^aeiou])y$/, E = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/, A = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/, k = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/, D = /^(.+?)(s|t)(ion)$/, S = /^(.+?)e$/, C = /ll$/, M = new RegExp('^' + i + r + '[^aeiouwxy]$'), T = function (n) { var r, i, o, a, s, u, c; if (n.length < 3) return n; if (o = n.substr(0, 1), o == 'y' && (n = o.toUpperCase() + n.substr(1)), a = p, s = g, a.test(n) ? n = n.replace(a, '$1$2') : s.test(n) && (n = n.replace(s, '$1$2')), a = m, s = y, a.test(n)) { var T = a.exec(n); a = l, a.test(T[1]) && (a = v, n = n.replace(a, '')) } else if (s.test(n)) { var T = s.exec(n); r = T[1], s = d, s.test(r) && (n = r, s = b, u = _, c = x, s.test(n) ? n += 'e' : u.test(n) ? (a = v, n = n.replace(a, '')) : c.test(n) && (n += 'e')) } if (a = w, a.test(n)) { var T = a.exec(n); r = T[1], n = r + 'i' } if (a = E, a.test(n)) { var T = a.exec(n); r = T[1], i = T[2], a = l, a.test(r) && (n = r + t[i]) } if (a = A, a.test(n)) { var T = a.exec(n); r = T[1], i = T[2], a = l, a.test(r) && (n = r + e[i]) } if (a = k, s = D, a.test(n)) { var T = a.exec(n); r = T[1], a = h, a.test(r) && (n = r) } else if (s.test(n)) { var T = s.exec(n); r = T[1] + T[2], s = h, s.test(r) && (n = r) } if (a = S, a.test(n)) { var T = a.exec(n); r = T[1], a = h, s = f, u = M, (a.test(r) || s.test(r) && !u.test(r)) && (n = r) } return a = C, s = h, a.test(n) && s.test(n) && (a = v, n = n.replace(a, '')), o == 'y' && (n = o.toLowerCase() + n.substr(1)), n }; return T }()), t.Pipeline.registerFunction(t.stemmer, 'stemmer'), /*! - * lunr.stopWordFilter - * Copyright (C) 2014 Oliver Nightingale - */ -t.stopWordFilter = function (e) { return t.stopWordFilter.stopWords.indexOf(e) === -1 ? e : void 0 }, t.stopWordFilter.stopWords = new t.SortedSet(), t.stopWordFilter.stopWords.length = 119, t.stopWordFilter.stopWords.elements = ['', 'a', 'able', 'about', 'across', 'after', 'all', 'almost', 'also', 'am', 'among', 'an', 'and', 'any', 'are', 'as', 'at', 'be', 'because', 'been', 'but', 'by', 'can', 'cannot', 'could', 'dear', 'did', 'do', 'does', 'either', 'else', 'ever', 'every', 'for', 'from', 'get', 'got', 'had', 'has', 'have', 'he', 'her', 'hers', 'him', 'his', 'how', 'however', 'i', 'if', 'in', 'into', 'is', 'it', 'its', 'just', 'least', 'let', 'like', 'likely', 'may', 'me', 'might', 'most', 'must', 'my', 'neither', 'no', 'nor', 'not', 'of', 'off', 'often', 'on', 'only', 'or', 'other', 'our', 'own', 'rather', 'said', 'say', 'says', 'she', 'should', 'since', 'so', 'some', 'than', 'that', 'the', 'their', 'them', 'then', 'there', 'these', 'they', 'this', 'tis', 'to', 'too', 'twas', 'us', 'wants', 'was', 'we', 'were', 'what', 'when', 'where', 'which', 'while', 'who', 'whom', 'why', 'will', 'with', 'would', 'yet', 'you', 'your'], t.Pipeline.registerFunction(t.stopWordFilter, 'stopWordFilter'), /*! - * lunr.trimmer - * Copyright (C) 2014 Oliver Nightingale - */ -t.trimmer = function (t) { return t.replace(/^\W+/, '').replace(/\W+$/, '') }, t.Pipeline.registerFunction(t.trimmer, 'trimmer'), /*! - * lunr.stemmer - * Copyright (C) 2014 Oliver Nightingale - * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt - */ -t.TokenStore = function () { this.root = {docs: {}}, this.length = 0 }, t.TokenStore.load = function (t) { var e = new this(); return e.root = t.root, e.length = t.length, e }, t.TokenStore.prototype.add = function (t, e, n) { var n = n || this.root, r = t[0], i = t.slice(1); return r in n || (n[r] = {docs: {}}), i.length === 0 ? (n[r].docs[e.ref] = e, void (this.length += 1)) : this.add(i, e, n[r]) }, t.TokenStore.prototype.has = function (t) { if (!t) return !1; for (var e = this.root, n = 0; n < t.length; n++) { if (!e[t[n]]) return !1; e = e[t[n]] } return !0 }, t.TokenStore.prototype.getNode = function (t) { if (!t) return {}; for (var e = this.root, n = 0; n < t.length; n++) { if (!e[t[n]]) return {}; e = e[t[n]] } return e }, t.TokenStore.prototype.get = function (t, e) { return this.getNode(t, e).docs || {} }, t.TokenStore.prototype.count = function (t, e) { return Object.keys(this.get(t, e)).length }, t.TokenStore.prototype.remove = function (t, e) { if (t) { for (var n = this.root, r = 0; r < t.length; r++) { if (!(t[r] in n)) return; n = n[t[r]] } delete n.docs[e] } }, t.TokenStore.prototype.expand = function (t, e) { var n = this.getNode(t), r = n.docs || {}, e = e || []; return Object.keys(r).length && e.push(t), Object.keys(n).forEach(function (n) { n !== 'docs' && e.concat(this.expand(t + n, e)) }, this), e }, t.TokenStore.prototype.toJSON = function () { return {root: this.root, length: this.length} }, (function (t, e) { typeof define === 'function' && define.amd ? define(e) : typeof exports === 'object' ? module.exports = e() : t.lunr = e() }(this, function () { return t })) -}()), /* - * jQuery Highlight plugin - * - * Based on highlight v3 by Johann Burkard - * http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html - * - * Code a little bit refactored and cleaned (in my humble opinion). - * Most important changes: - * - has an option to highlight only entire words (wordsOnly - false by default), - * - has an option to be case sensitive (caseSensitive - false by default) - * - highlight element tag and class names can be specified in options - * - * Usage: - * // wrap every occurrance of text 'lorem' in content - * // with (default options) - * $('#content').highlight('lorem'); - * - * // search for and highlight more terms at once - * // so you can save some time on traversing DOM - * $('#content').highlight(['lorem', 'ipsum']); - * $('#content').highlight('lorem ipsum'); - * - * // search only for entire word 'lorem' - * $('#content').highlight('lorem', { wordsOnly: true }); - * - * // don't ignore case during search of term 'lorem' - * $('#content').highlight('lorem', { caseSensitive: true }); - * - * // wrap every occurrance of term 'ipsum' in content - * // with - * $('#content').highlight('ipsum', { element: 'em', className: 'important' }); - * - * // remove default highlight - * $('#content').unhighlight(); - * - * // remove custom highlight - * $('#content').unhighlight({ element: 'em', className: 'important' }); - * - * - * Copyright (c) 2009 Bartek Szopka - * - * Licensed under MIT license. - * - */ -jQuery.extend({highlight: function (t, e, n, r) { if (t.nodeType === 3) { var i = t.data.match(e); if (i) { var o = document.createElement(n || 'span'); o.className = r || 'highlight'; var a = t.splitText(i.index); a.splitText(i[0].length); var s = a.cloneNode(!0); return o.appendChild(s), a.parentNode.replaceChild(o, a), 1 } } else if (t.nodeType === 1 && t.childNodes && !/(script|style)/i.test(t.tagName) && (t.tagName !== n.toUpperCase() || t.className !== r)) for (var u = 0; u < t.childNodes.length; u++)u += jQuery.highlight(t.childNodes[u], e, n, r); return 0 }}), jQuery.fn.unhighlight = function (t) { var e = {className: 'highlight', element: 'span'}; return jQuery.extend(e, t), this.find(e.element + '.' + e.className).each(function () { var t = this.parentNode; t.replaceChild(this.firstChild, this), t.normalize() }).end() }, jQuery.fn.highlight = function (t, e) { var n = {className: 'highlight', element: 'span', caseSensitive: !1, wordsOnly: !1}; if (jQuery.extend(n, e), t.constructor === String && (t = [t]), t = jQuery.grep(t, function (t) { return t != '' }), t = jQuery.map(t, function (t) { return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') }), t.length == 0) return this; var r = n.caseSensitive ? '' : 'i', i = '(' + t.join('|') + ')'; n.wordsOnly && (i = '\\b' + i + '\\b'); var o = new RegExp(i, r); return this.each(function () { jQuery.highlight(this, o, n.element, n.className) }) }, (function () { 'use strict'; function t () { $('h1, h2').each(function () { var t = $(this), e = t.nextUntil('h1, h2'); u.add({id: t.prop('id'), title: t.text(), body: e.text()}) }) } function e () { o = $('.content'), a = $('.search-results'), $('#input-search').on('keyup', n) } function n (t) { if (i(), a.addClass('visible'), t.keyCode === 27 && (this.value = ''), this.value) { var e = u.search(this.value).filter(function (t) { return t.score > 1e-4 }); e.length ? (a.empty(), $.each(e, function (t, e) { var n = document.getElementById(e.ref); a.append("
  • " + $(n).text() + '
  • ') }), r.call(this)) : (a.html('
  • '), $('.search-results li').text('No Results Found for "' + this.value + '"')) } else i(), a.removeClass('visible') } function r () { this.value && o.highlight(this.value, s) } function i () { o.unhighlight(s) } var o, a, s = {element: 'span', className: 'search-highlight'}, u = new lunr.Index(); u.ref('id'), u.field('title', {boost: 10}), u.field('body'), u.pipeline.add(lunr.trimmer, lunr.stopWordFilter), $(t), $(e) }()), /*! jQuery UI - v1.11.3 - 2015-02-12 - * http://jqueryui.com - * Includes: widget.js - * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ -(function (t) { typeof define === 'function' && define.amd ? define(['jquery'], t) : t(jQuery) }(function (t) { /*! - * jQuery UI Widget 1.11.3 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * http://api.jqueryui.com/jQuery.widget/ - */ - var e = 0, n = Array.prototype.slice; t.cleanData = (function (e) { return function (n) { var r, i, o; for (o = 0; (i = n[o]) != null; o++) try { r = t._data(i, 'events'), r && r.remove && t(i).triggerHandler('remove') } catch (a) {}e(n) } }(t.cleanData)), t.widget = function (e, n, r) { var i, o, a, s, u = {}, c = e.split('.')[0]; return e = e.split('.')[1], i = c + '-' + e, r || (r = n, n = t.Widget), t.expr[':'][i.toLowerCase()] = function (e) { return !!t.data(e, i) }, t[c] = t[c] || {}, o = t[c][e], a = t[c][e] = function (t, e) { return this._createWidget ? void (arguments.length && this._createWidget(t, e)) : new a(t, e) }, t.extend(a, o, {version: r.version, _proto: t.extend({}, r), _childConstructors: []}), s = new n(), s.options = t.widget.extend({}, s.options), t.each(r, function (e, r) { return t.isFunction(r) ? void (u[e] = (function () { var t = function () { return n.prototype[e].apply(this, arguments) }, i = function (t) { return n.prototype[e].apply(this, t) }; return function () { var e, n = this._super, o = this._superApply; return this._super = t, this._superApply = i, e = r.apply(this, arguments), this._super = n, this._superApply = o, e } }())) : void (u[e] = r) }), a.prototype = t.widget.extend(s, {widgetEventPrefix: o ? s.widgetEventPrefix || e : e}, u, {constructor: a, namespace: c, widgetName: e, widgetFullName: i}), o ? (t.each(o._childConstructors, function (e, n) { var r = n.prototype; t.widget(r.namespace + '.' + r.widgetName, a, n._proto) }), delete o._childConstructors) : n._childConstructors.push(a), t.widget.bridge(e, a), a }, t.widget.extend = function (e) { for (var r, i, o = n.call(arguments, 1), a = 0, s = o.length; s > a; a++) for (r in o[a])i = o[a][r], o[a].hasOwnProperty(r) && void 0 !== i && (e[r] = t.isPlainObject(i) ? t.isPlainObject(e[r]) ? t.widget.extend({}, e[r], i) : t.widget.extend({}, i) : i); return e }, t.widget.bridge = function (e, r) { var i = r.prototype.widgetFullName || e; t.fn[e] = function (o) { var a = typeof o === 'string', s = n.call(arguments, 1), u = this; return a ? this.each(function () { var n, r = t.data(this, i); return o === 'instance' ? (u = r, !1) : r ? t.isFunction(r[o]) && o.charAt(0) !== '_' ? (n = r[o].apply(r, s), n !== r && void 0 !== n ? (u = n && n.jquery ? u.pushStack(n.get()) : n, !1) : void 0) : t.error("no such method '" + o + "' for " + e + ' widget instance') : t.error('cannot call methods on ' + e + " prior to initialization; attempted to call method '" + o + "'") }) : (s.length && (o = t.widget.extend.apply(null, [o].concat(s))), this.each(function () { var e = t.data(this, i); e ? (e.option(o || {}), e._init && e._init()) : t.data(this, i, new r(o, this)) })), u } }, t.Widget = function () {}, t.Widget._childConstructors = [], t.Widget.prototype = {widgetName: 'widget', widgetEventPrefix: '', defaultElement: '
    ', options: {disabled: !1, create: null}, _createWidget: function (n, r) { r = t(r || this.defaultElement || this)[0], this.element = t(r), this.uuid = e++, this.eventNamespace = '.' + this.widgetName + this.uuid, this.bindings = t(), this.hoverable = t(), this.focusable = t(), r !== this && (t.data(r, this.widgetFullName, this), this._on(!0, this.element, {remove: function (t) { t.target === r && this.destroy() }}), this.document = t(r.style ? r.ownerDocument : r.document || r), this.window = t(this.document[0].defaultView || this.document[0].parentWindow)), this.options = t.widget.extend({}, this.options, this._getCreateOptions(), n), this._create(), this._trigger('create', null, this._getCreateEventData()), this._init() }, _getCreateOptions: t.noop, _getCreateEventData: t.noop, _create: t.noop, _init: t.noop, destroy: function () { this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr('aria-disabled').removeClass(this.widgetFullName + '-disabled ui-state-disabled'), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass('ui-state-hover'), this.focusable.removeClass('ui-state-focus') }, _destroy: t.noop, widget: function () { return this.element }, option: function (e, n) { var r, i, o, a = e; if (arguments.length === 0) return t.widget.extend({}, this.options); if (typeof e === 'string') if (a = {}, r = e.split('.'), e = r.shift(), r.length) { for (i = a[e] = t.widget.extend({}, this.options[e]), o = 0; o < r.length - 1; o++)i[r[o]] = i[r[o]] || {}, i = i[r[o]]; if (e = r.pop(), arguments.length === 1) return void 0 === i[e] ? null : i[e]; i[e] = n } else { if (arguments.length === 1) return void 0 === this.options[e] ? null : this.options[e]; a[e] = n } return this._setOptions(a), this }, _setOptions: function (t) { var e; for (e in t) this._setOption(e, t[e]); return this }, _setOption: function (t, e) { return this.options[t] = e, t === 'disabled' && (this.widget().toggleClass(this.widgetFullName + '-disabled', !!e), e && (this.hoverable.removeClass('ui-state-hover'), this.focusable.removeClass('ui-state-focus'))), this }, enable: function () { return this._setOptions({disabled: !1}) }, disable: function () { return this._setOptions({disabled: !0}) }, _on: function (e, n, r) { var i, o = this; typeof e !== 'boolean' && (r = n, n = e, e = !1), r ? (n = i = t(n), this.bindings = this.bindings.add(n)) : (r = n, n = this.element, i = this.widget()), t.each(r, function (r, a) { function s () { return e || o.options.disabled !== !0 && !t(this).hasClass('ui-state-disabled') ? (typeof a === 'string' ? o[a] : a).apply(o, arguments) : void 0 } typeof a !== 'string' && (s.guid = a.guid = a.guid || s.guid || t.guid++); var u = r.match(/^([\w:-]*)\s*(.*)$/), c = u[1] + o.eventNamespace, l = u[2]; l ? i.delegate(l, c, s) : n.bind(c, s) }) }, _off: function (e, n) { n = (n || '').split(' ').join(this.eventNamespace + ' ') + this.eventNamespace, e.unbind(n).undelegate(n), this.bindings = t(this.bindings.not(e).get()), this.focusable = t(this.focusable.not(e).get()), this.hoverable = t(this.hoverable.not(e).get()) }, _delay: function (t, e) { function n () { return (typeof t === 'string' ? r[t] : t).apply(r, arguments) } var r = this; return setTimeout(n, e || 0) }, _hoverable: function (e) { this.hoverable = this.hoverable.add(e), this._on(e, {mouseenter: function (e) { t(e.currentTarget).addClass('ui-state-hover') }, mouseleave: function (e) { t(e.currentTarget).removeClass('ui-state-hover') }}) }, _focusable: function (e) { this.focusable = this.focusable.add(e), this._on(e, {focusin: function (e) { t(e.currentTarget).addClass('ui-state-focus') }, focusout: function (e) { t(e.currentTarget).removeClass('ui-state-focus') }}) }, _trigger: function (e, n, r) { var i, o, a = this.options[e]; if (r = r || {}, n = t.Event(n), n.type = (e === this.widgetEventPrefix ? e : this.widgetEventPrefix + e).toLowerCase(), n.target = this.element[0], o = n.originalEvent) for (i in o)i in n || (n[i] = o[i]); return this.element.trigger(n, r), !(t.isFunction(a) && a.apply(this.element[0], [n].concat(r)) === !1 || n.isDefaultPrevented()) }}, t.each({show: 'fadeIn', hide: 'fadeOut'}, function (e, n) { t.Widget.prototype['_' + e] = function (r, i, o) { typeof i === 'string' && (i = {effect: i}); var a, s = i ? i === !0 || typeof i === 'number' ? n : i.effect || n : e; i = i || {}, typeof i === 'number' && (i = {duration: i}), a = !t.isEmptyObject(i), i.complete = o, i.delay && r.delay(i.delay), a && t.effects && t.effects.effect[s] ? r[e](i) : s !== e && r[s] ? r[s](i.duration, i.easing, o) : r.queue(function (n) { t(this)[e](), o && o.call(r[0]), n() }) } }); t.widget -})), /* jquery Tocify - v1.8.0 - 2013-09-16 -* http://www.gregfranko.com/jquery.tocify.js/ -* Copyright (c) 2013 Greg Franko; Licensed MIT -* Modified lightly by Robert Lord to fix a bug I found, -* and also so it adds ids to headers -* also because I want height caching, since the -* height lookup for h1s and h2s was causing serious -* lag spikes below 30 fps */ -(function (t) { 'use strict'; t(window.jQuery, window, document) }(function (t, e, n, r) { 'use strict'; var i = 'tocify', o = 'tocify-focus', a = 'tocify-hover', s = 'tocify-hide', u = 'tocify-header', c = '.' + u, l = 'tocify-subheader', h = '.' + l, f = 'tocify-item', d = '.' + f, p = 'tocify-extend-page', g = '.' + p; t.widget('toc.tocify', {version: '1.8.0', options: {context: 'body', ignoreSelector: null, selectors: 'h1, h2, h3', showAndHide: !0, showEffect: 'slideDown', showEffectSpeed: 'medium', hideEffect: 'slideUp', hideEffectSpeed: 'medium', smoothScroll: !0, smoothScrollSpeed: 'medium', scrollTo: 0, showAndHideOnScroll: !0, highlightOnScroll: !0, highlightOffset: 40, theme: 'bootstrap', extendPage: !0, extendPageOffset: 100, history: !0, scrollHistory: !1, hashGenerator: 'compact', highlightDefault: !0}, _create: function () { var n = this; n.tocifyWrapper = t('.tocify-wrapper'), n.extendPageScroll = !0, n.items = [], n._generateToc(), n.cachedHeights = [], n.cachedAnchors = [], n._addCSSClasses(), n.webkit = (function () { for (var t in e) if (t && t.toLowerCase().indexOf('webkit') !== -1) return !0; return !1 }()), n._setEventHandlers(), t(e).load(function () { n._setActiveElement(!0), t('html, body').promise().done(function () { setTimeout(function () { n.extendPageScroll = !1 }, 0) }) }) }, _generateToc: function () { var e, n, r = this, o = r.options.ignoreSelector; return e = t(this.options.context).find(this.options.selectors.indexOf(',') !== -1 ? this.options.selectors.replace(/ /g, '').substr(0, this.options.selectors.indexOf(',')) : this.options.selectors.replace(/ /g, '')), e.length ? (r.element.addClass(i), void e.each(function (e) { t(this).is(o) || (n = t('