Browse Source

Update syntax examples

simov 7 years ago
parent
commit
e3dd69c1df
3 changed files with 458 additions and 348 deletions
  1. 268 0
      test/syntax/highlighting.md
  2. 137 0
      test/syntax/mathjax.md
  3. 53 348
      test/syntax/syntax.md

+ 268 - 0
test/syntax/highlighting.md

@@ -0,0 +1,268 @@
+
+# Syntax Highlighting
+
+#### actionscript
+
+```actionscript
+var some = new actionscript();
+```
+
+#### apacheconf
+
+```apacheconf
+ServerName apacheconf
+```
+
+#### aspnet
+
+```aspnet
+<asp:Label runat="server" id="aspnet"></asp:Label>
+```
+
+#### bash
+
+```bash
+$some = "bash";
+```
+
+#### basic
+
+```basic
+Dim basic As Integer
+```
+
+#### batch
+
+```batch
+set some="batch"
+```
+
+#### c
+
+```c
+char some = "c";
+```
+
+#### coffeescript
+
+```coffeescript
+some = "coffeescript"
+```
+
+#### cpp
+
+```cpp
+char some = "cpp";
+```
+
+#### csharp
+
+```csharp
+string some = "csharp";
+```
+
+#### css
+
+```css
+#some { content: 'css'; }
+```
+
+#### dart
+
+```dart
+var some = "dart";
+```
+
+#### diff
+
+```diff
+     not changed
+-    removed
++    added
+```
+
+#### docker
+
+```docker
+MAINTAINER docker
+```
+
+#### erlang
+
+```erlang
+module(erlang).
+```
+
+#### go
+
+```go
+type go string
+```
+
+#### haskell
+
+```haskell
+haskell :: Str -> String
+```
+
+#### html
+
+```html
+<p id="some">html</p>
+```
+
+#### java
+
+```java
+public static final void main java();
+```
+
+#### javascript
+
+```javascript
+let some = 'javascript';
+```
+
+#### js
+
+```js
+const some = 'js';
+```
+
+#### json
+
+```json
+{"some": "json"}
+```
+
+#### jsonp
+
+```jsonp
+function({"some": "jsonp"})
+```
+
+#### lua
+
+```lua
+local some = "lua"
+```
+
+#### makefile
+
+```makefile
+check: makefile
+```
+
+#### markdown
+
+```markdown
+`some` **markdown**
+```
+
+#### html
+
+```html
+<p>some <strong>markup</strong></p>
+```
+
+#### nginx
+
+```nginx
+server_name nginx;
+```
+
+#### objectivec
+
+```objectivec
+char some = "objectivec";
+```
+
+#### perl
+
+```perl
+$some = "perl";
+```
+
+#### php
+
+```php
+$some = "php";
+```
+
+#### prolog
+
+```prolog
+some('prolog', 1972)
+```
+
+#### python
+
+```python
+some = 'python'
+```
+
+#### ruby
+
+```ruby
+some = "ruby"
+```
+
+#### rust
+
+```rust
+let some = 'rust';
+```
+
+#### sass
+
+```sass
+@include sass;
+```
+
+#### scheme
+
+```scheme
+(define some 'scheme')
+```
+
+#### scss
+
+```scss
+@include scss;
+```
+
+#### smalltalk
+
+```smalltalk
+'some smalltalk'
+```
+
+#### sql
+
+```sql
+select * from `language` where `name` = 'sql';
+```
+
+#### swift
+
+```swift
+var some = "swift"
+```
+
+#### typescript
+
+```typescript
+var some: string = "typescript";
+```
+
+#### xml
+
+```xml
+<some name="xml"></some>
+```
+
+#### yaml
+
+```yaml
+- language: yaml
+```

+ 137 - 0
test/syntax/mathjax.md

@@ -1,4 +1,141 @@
 
+# MathJax
+
+## Delimiters
+
+Delimiter                         | Format      | Expression                  | Result                    | Support
+:---                              | :---:       | :---                        | :---:                     | :---:
+No delimiters                     | `str`       | `\sqrt{3x-1}+(1+x)^2`       | \sqrt{3x-1}+(1+x)^2       | no
+Bracket without backslash         | `[str]`     | `[\sqrt{3x-1}+(1+x)^2]`     | [\sqrt{3x-1}+(1+x)^2]     | no
+Single backslash with bracket     | `\[str\]`   | `\[\sqrt{3x-1}+(1+x)^2\]`   | \[\sqrt{3x-1}+(1+x)^2\]   | **yes**
+Double backslash with bracket     | `\\[str\\]` | `\\[\sqrt{3x-1}+(1+x)^2\\]` | \\[\sqrt{3x-1}+(1+x)^2\\] | no
+Parentheses without backslash     | `(str)`     | `(\sqrt{3x-1}+(1+x)^2)`     | (\sqrt{3x-1}+(1+x)^2)     | no
+Single backslash with parentheses | `\(str\)`   | `\(\sqrt{3x-1}+(1+x)^2\)`   | \(\sqrt{3x-1}+(1+x)^2\)   | **yes**
+Double backslash with parentheses | `\\(str\\)` | `\\(\sqrt{3x-1}+(1+x)^2\\)` | \\(\sqrt{3x-1}+(1+x)^2\\) | no
+Single dollar sign                | `$str$`     | `$\sqrt{3x-1}+(1+x)^2$`     | $\sqrt{3x-1}+(1+x)^2$     | **yes**
+Double dollar sign                | `$$str$$`   | `$$\sqrt{3x-1}+(1+x)^2$$`   | $$\sqrt{3x-1}+(1+x)^2$$   | **yes**
+
+## Empty
+
+- `\(\)` \(\)
+- `$$` $$
+- `\[\]` \[\]
+- `$$$$` $$$$
+
+## Single Character
+
+- `\(a\)` \(a\)
+- `$a$` $a$
+- `\[a\]` \[a\]
+- `$$a$$` $$a$$
+
+## Multiple on single line
+
+- `\(a\)` \(a\) `\(b\)` \(b\)
+- `$a$` $a$ `$b$` $b$
+- `\[a\]` \[a\] `\[b\]` \[b\]
+- `$$a$$` $$a$$ `$$b$$` $$b$$
+
+## Underscore `_`
+
+## `\(` single line `\)`
+
+`\(x_i = x_\gamma\)` \(x_i = x_\gamma\)
+
+## `\(` multiline `\)`
+
+```
+\(
+x_i = x_\gamma
+\)
+```
+
+\(
+x_i = x_\gamma
+\)
+
+---
+
+## `\[` single line `\]`
+
+`\[x_i = x_\gamma\]` \[x_i = x_\gamma\]
+
+## `\[` multiline `\]`
+
+```
+\[
+x_i = x_\gamma
+\]
+```
+
+\[
+x_i = x_\gamma
+\]
+
+---
+
+## `$` single line `$`
+
+`$x_i = x_\gamma$` $x_i = x_\gamma$
+
+## `$` multiline `$` Not Supported!
+
+```
+$
+x_i = x_\gamma
+$
+```
+
+$
+x_i = x_\gamma
+$
+
+---
+
+## `$$` single line `$$`
+
+`$$x_i = x_\gamma$$` $$x_i = x_\gamma$$
+
+## `$$` multiline `$$`
+
+```
+$$
+x_i = x_\gamma
+$$
+```
+
+$$
+x_i = x_\gamma
+$$
+
+---
+
+## `\begin{}` multiline `\end{}`
+
+```
+\begin{align}
+x_i = x_\gamma
+\end{align}
+```
+
+\begin{align}
+x_i = x_\gamma
+\end{align}
+
+---
+
+## Escapes
+
+### Dollar Sign
+
+`\$6.20 and \$0.5` \$6.20 and \$0.5
+
+`$4.40` $4.40
+
+---
+
+# Examples
+
 # Using TeX notation
 
 When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are

+ 53 - 348
test/syntax/syntax.md

@@ -198,53 +198,6 @@ fenced code block using tilde
 ~~~
 
 
-# HTML
-
-<div style="text-decoration: underline;">
-  <p><strong>HTML</strong> tags</p>
-</div>
-
-
-## Details/Summary
-
-<details>
-<summary>Click to Expand</summary>
-
-```js
-var code = 'block'
-```
-
-### Inner Header
-
-[link](https://github.com/simov/markdown-viewer)
-</details>
-
-
-## Definition List
-
-<dl>
-  <dt>Name</dt>
-  <dd>Godzilla</dd>
-  <dt>Born</dt>
-  <dd>1952</dd>
-  <dt>Birthplace</dt>
-  <dd>Japan</dd>
-  <dt>Color</dt>
-  <dd>Green</dd>
-</dl>
-
-
-## KBD
-
-<kbd>the kbd tag</kbd>
-
-
-## Supscript/subscript
-
-- 19<sup>th</sup>
-- H<sub>2</sub>O
-
-
 # GFM
 
 
@@ -288,356 +241,108 @@ default      | align left      | centered           | align right
 - [ ] task
 
 
-# Extras
-
-## Escapes
-
-<em\>HTML tags</em\>
-
-\\ \` \* \_ \{ \} \# \+ \- \. \!
-
-\[ mathjax \]
-
-\( mathjax \)
-
-`` `\(` ``
-
-````
-```
-fenced code block
-```
-````
-
-
-## Mention
-
-@simov
-
-
-## Emoji
-
-- shortname: :wave: :alien:
-- unicode: 👋 👽
-- ascii: :D :/
-
-
-## Footnotes
-
-
-Something something[^named]
-
-And something else[^1], and a link[^2]
-
-
-[^1]: This reference footnote contains a paragraph...
-
-    * ...and a list
-
-[^2]: https://github.com/simov/markdown-viewer
-[^named]: https://github.com/simov/markdown-viewer
-
-
-## Syntax Highlighting
-
-```actionscript
-var some = new actionscript();
-```
-
-```apacheconf
-ServerName apacheconf
-```
-
-```aspnet
-<asp:Label runat="server" id="aspnet"></asp:Label>
-```
-
-```bash
-$some = "bash";
-```
-
-```basic
-Dim basic As Integer
-```
-
-```batch
-set some="batch"
-```
-
-```c
-char some = "c";
-```
-
-```coffeescript
-some = "coffeescript"
-```
-
-```cpp
-char some = "cpp";
-```
-
-```csharp
-string some = "csharp";
-```
-
-```css
-#some { content: 'css'; }
-```
-
-```dart
-var some = "dart";
-```
-
-```docker
-MAINTAINER docker
-```
-
-```erlang
-module(erlang).
-```
-
-```go
-type go string
-```
+# HTML
 
-```haskell
-haskell :: Str -> String
-```
+<h2>HTML Tags</h2>
+<div style="text-decoration: underline;">
+  <p><strong>bold</strong> and underline</p>
+</div>
 
-```html
-<p id="some">html</p>
-```
 
-```java
-public static final void main java();
-```
+## Details/Summary
 
-```javascript
-let some = 'javascript';
-```
+<details>
+<summary>Click to Expand</summary>
 
 ```js
-const some = 'js';
-```
-
-```json
-{"some": "json"}
-```
-
-```jsonp
-function({"some": "jsonp"})
-```
-
-```lua
-local some = "lua"
-```
-
-```makefile
-check: makefile
-```
-
-```markdown
-`some` **markdown**
-```
-
-```html
-<p>some <strong>markup</strong></p>
-```
-
-```nginx
-server_name nginx;
-```
-
-```objectivec
-char some = "objectivec";
-```
-
-```perl
-$some = "perl";
-```
-
-```php
-$some = "php";
-```
-
-```prolog
-some('prolog', 1972)
-```
-
-```python
-some = 'python'
-```
-
-```ruby
-some = "ruby"
-```
-
-```rust
-let some = 'rust';
-```
-
-```sass
-@include sass;
-```
-
-```scheme
-(define some 'scheme')
-```
-
-```scss
-@include scss;
-```
-
-```smalltalk
-'some smalltalk'
-```
-
-```sql
-select * from `language` where `name` = 'sql';
-```
-
-```swift
-var some = "swift"
-```
-
-```typescript
-var some: string = "typescript";
-```
-
-```xml
-<some name="xml"></some>
-```
-
-```yaml
-- language: yaml
-```
-
-```diff
-     not changed
--    removed
-+    added
+var code = 'block'
 ```
 
+### Inner Header
 
-# MathJax
-
-## Delimiters
+[link](https://github.com/simov/markdown-viewer)
+</details>
 
-Delimiter                         | Format      | Expression                  | Result                    | Support
-:---                              | :---:       | :---                        | :---:                     | :---:
-No delimiters                     | `str`       | `\sqrt{3x-1}+(1+x)^2`       | \sqrt{3x-1}+(1+x)^2       | no
-Bracket without backslash         | `[str]`     | `[\sqrt{3x-1}+(1+x)^2]`     | [\sqrt{3x-1}+(1+x)^2]     | no
-Single backslash with bracket     | `\[str\]`   | `\[\sqrt{3x-1}+(1+x)^2\]`   | \[\sqrt{3x-1}+(1+x)^2\]   | **yes**
-Double backslash with bracket     | `\\[str\\]` | `\\[\sqrt{3x-1}+(1+x)^2\\]` | \\[\sqrt{3x-1}+(1+x)^2\\] | no
-Parentheses without backslash     | `(str)`     | `(\sqrt{3x-1}+(1+x)^2)`     | (\sqrt{3x-1}+(1+x)^2)     | no
-Single backslash with parentheses | `\(str\)`   | `\(\sqrt{3x-1}+(1+x)^2\)`   | \(\sqrt{3x-1}+(1+x)^2\)   | **yes**
-Double backslash with parentheses | `\\(str\\)` | `\\(\sqrt{3x-1}+(1+x)^2\\)` | \\(\sqrt{3x-1}+(1+x)^2\\) | no
-Single dollar sign                | `$str$`     | `$\sqrt{3x-1}+(1+x)^2$`     | $\sqrt{3x-1}+(1+x)^2$     | **yes**
-Double dollar sign                | `$$str$$`   | `$$\sqrt{3x-1}+(1+x)^2$$`   | $$\sqrt{3x-1}+(1+x)^2$$   | **yes**
 
-## Markdown
+## Definition List
 
-Expressions containing underscore `_`:
+<dl>
+  <dt>Name</dt>
+  <dd>Godzilla</dd>
+  <dt>Born</dt>
+  <dd>1952</dd>
+  <dt>Birthplace</dt>
+  <dd>Japan</dd>
+  <dt>Color</dt>
+  <dd>Green</dd>
+</dl>
 
-### `\(` single line `\)`
 
-`\(x_i = x_\gamma\)` \(x_i = x_\gamma\)
+## KBD
 
-### `\(` multiline `\)`
+<kbd>the kbd tag</kbd>
 
-```
-\(
-x_i = x_\gamma
-\)
-```
 
-\(
-x_i = x_\gamma
-\)
+## Supscript/subscript
 
----
+- 19<sup>th</sup>
+- H<sub>2</sub>O
 
-### `\[` single line `\]`
 
-`\[x_i = x_\gamma\]` \[x_i = x_\gamma\]
 
-### `\[` multiline `\]`
+# Extras
 
-```
-\[
-x_i = x_\gamma
-\]
-```
+## Emoji
 
-\[
-x_i = x_\gamma
-\]
+- shortcode: :wave: :alien:
+- unicode: 👋 👽
+- ascii: :D :/
 
----
 
-### `$` single line `$`
+## MathJax
 
-`$x_i = x_\gamma$` $x_i = x_\gamma$
+- [Examples and Syntax](mathjax.md)
 
-### `$` multiline `$`
 
-**Not supported!**
+## Syntax Highlighting
 
-```
-$
-x_i = x_\gamma
-$
-```
+- [Examples and Syntax](highlighting.md)
 
-$
-x_i = x_\gamma
-$
 
----
+## Escapes
 
-### `$$` single line `$$`
+<em\>HTML tags</em\>
 
-`$$x_i = x_\gamma$$` $$x_i = x_\gamma$$
+\\ \` \* \_ \{ \} \# \+ \- \. \! \[ \] \( \)
 
-### `$$` multiline `$$`
+`` `\(` ``
 
+````
 ```
-$$
-x_i = x_\gamma
-$$
+fenced code block
 ```
+````
 
-$$
-x_i = x_\gamma
-$$
+## Mention
 
----
+@simov
 
-### `\begin{}` multiline `\end{}`
 
-```
-\begin{align}
-x_i = x_\gamma
-\end{align}
-```
+## Footnotes
 
-\begin{align}
-x_i = x_\gamma
-\end{align}
 
+Something something[^named]
 
-## HTML
+And something else[^1], and a link[^2]
 
-`<`, `>` and `&` symbols
 
-- `\(x<y\)` \(x<y\)
-- `\(x>y\)` \(x>y\)
-- `\(x&a\)` \(x&a\)
+[^1]: This reference footnote contains a paragraph...
 
-## **Money**
+    * ...and a list
 
-\$6.20 and \$0.5
+[^2]: https://github.com/simov/markdown-viewer
+[^named]: https://github.com/simov/markdown-viewer
 
-$4.40
 
 ---