评估功能与设定
落雪的随笔小屋 River's Blog

评估功能与设定

1995-09-01
River

内部测试网站功能与设定页面
代码高亮的配置与色系设定
数学公式排版测试
绘图与显示增强插件测试
emoji 精选范例测试
图床测试


  1. 代码高亮
    1. C
    2. Python
    3. JavaScript
    4. TypeScript
    5. Html
    6. Scss/Css
    7. Liquid
    8. Jinja2
    9. Bash
    10. Java
    11. Kotlin
    12. Go
    13. Php
    14. Nasm
    15. Sql
    16. Ruby
    17. Fortran
    18. Lua
    19. Yaml
    20. Perl
    21. C++
    22. C#.
    23. Swift
    24. Pascal
    25. Http
    26. Json
    27. Llvm
  2. PrismJS
    1. 语种代码
    2. 配色主题
  3. 数学图表
    1. MathJax
    2. Mermaid
    3. Echarts
    4. Timeline
    5. MindMap
  4. Emoji
  5. 图床测试

[TOC]


代码高亮

C

#include <stdio.h>

/* the n-th fibonacci number.
 */
unsigned int fib(unsigned int n) {
  unsigned int a = 1, b = 1;
  unsigned int tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

int main(void)
{
  printf("%u", fib(10));
  return 0;
}

Python

#!/usr/bin/env python3

def fib():
  '''
  a generator that produces the elements of the fibonacci series
  '''

  a = 1
  b = 1
  while True:
    a, b = a + b, a
    yield a

def nth(series, n):
  '''
  returns the nth element of a series,
  consuming the earlier elements of the series
  '''

  for x in series:
    n = n - 1
    if n <= 0: return x

def main():
  print(nth(fib(), 10))

if __name__ == '__main__':
  main()

JavaScript

/**
 * nth element in the fibonacci series.
 * @param n >= 0
 * @return the nth element, >= 0.
 */
function fib(n) {
  var a = 1,
    b = 1;
  var tmp;
  while (--n >= 0) {
    tmp = a;
    a += b;
    b = tmp;
  }
  return a;
}

document.write(fib(10));

// ES6 numbers

var myBin = 0b10;
var myOct = 0o67;

// ES6 regexes

let x = /abc/u;
let x = /abc/y;

// Unicode example
class Œuvre {
  résumer(语言 = "français") {
    书名 = "Les Misérables";
  }
}

TypeScript

// vim: ft=typescript

var myFloat = 0.123;
var myOctal = 0x123;
var myRegex = /asdf/;
var myComplicatedRegex = /.[.](?=x\h\[[)])[^.{}abc]{foo}{3,}x{2,3}/;
var myObject = { a: 1, b: 2 };

var ternary = 0 ? 1 : { object_key: 2 ? variable : 3 };
var ternary2 = a ? { object_key: c } + variable : e;
var ternary3 = a
  ? {
      key1: var1,
      key2: var2
        ? function () {
            // break label, not an object key!
            label1: while (true) {
              break label1;
            }

            // also a break label
            label2: while (true) {
              break label2;
            }
          } + var3
        : var4, // ternary, not object key
      key3: "foo",
    }
  : 2;

var a = {
  num: 0,
  func: function () {},
  str: "",
  bool: true,
};

var obj = {
  // comment
  key: val,
};

/*!
 * multiline comment
 */

var quotedKeys = {
  one: 1,
  two: 2,
  three: 3,
};

Blag = {};
jQuery.noConflict();

if (cond) {
  label1: while (cond) break label1;
}

Blag.ReadMore = (function ($) {
  function getFold(button) {
    return $(button).siblings(".fold");
  }

  function expand(e) {
    e.preventDefault();

    var self = $(this);

    getFold(self).show();
    self.html("&laquo; less");
  }

  function contract(e) {
    e.preventDefault();

    var self = $(this);

    getFold(self).hide();
    self.html("more &raquo;");
  }

  function init() {
    $("a.read-more").toggle(expand, contract);
  }

  $(document).ready(init);
})(jQuery);

Html

<!DOCTYPE html>
<html>
<head>
<script>
    function initCodeBlock(id); {
        var el = document.getElementById(id);
    }
</script>
<script> "hello < world" </script>
<style>
/* comment */
.syntax { color: #60a0b0; font-style: italic; }
</style>
<link rel="stylesheet" href="/assets/css/style.css?v=1">
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
</head>
<body>
  <h1>Hello world!</h1>

  <h2 class="outer">
    <span class="inner">Goodbye world!</span>
  </h2>

  <pre id = "code-block" class="syntax">
    <span class="cm"># -*- coding: utf-8 -*-</span>
    <span class="st st-db">&quot;&quot;&quot;</span><span class="st">
      hello.world.goodbye.world
    </span>
  </pre>
</body>
</html>

<!-- free-floating tags -->
<strong>Hello free-floating world!</strong>

<!-- different attribute styles -->
<span id=unquoted>Hello unquoted attribute world!</span>
<span id='single'>Hello single-quoted attribute world!</span>
<span id="double">Hello double-quoted attribute world!</span>
<span id = spaced>Hello spaced attribute world!</span>

<!-- broken tags -->
<\div>Hello broken world!</div>
<div>Hello broken world!<div\>

<!-- nested tags -->
<table><tr><td>Hello nested world!</td></tr></table>

<!-- no tags -->
Hello tagless world!

<!-- custom Angular 2-style tags -->
<custom-element *ng-structural-directive></custom-element>
<custom-element #ref></custom-element>
<custom-element [target]="expression"></custom-element>
<custom-element (target)="expression"></custom-element>

<!-- Unicode example -->
<œuvre>
	<书名 语言="français">Les Misérables</书名>
</œuvre>

Scss/Css

@import "compass";
@import "blueprint";
@import "blueprint/fancy_type";

$blueprint-grid-columns: 5;
$blueprint-grid-width: 150px;
$blueprint-grid-margin: 20px;

$blueprint-font-family: Helvetica Neue, Arial, Helvetica, sans-serif;
$blueprint-fixed-font-family: "andale mono", "lucida console", monospace;
$blueprint-font-size: 12px;

$text-color: #555555;
$light-text-color: #a0a0a0;
$quote-text-color: #f27a00;
$disclosure-text-color: #ed7c06;

$thick-border: 8px solid black;
$dotted-border: 1px dotted #999999;

$header-background-color: #f07c05;
$paging-background-color: black;
$unfocused-background-color: #f1f0ec;
$quote-background-color: #f1f0ec;

$story-title-color: #f07c05;

@include global-reset;
@include blueprint-typography;

body {
  background: $unfocused-background-color image_url("white-bg.jpg") repeat-y 50% 0;
  color: $text-color;
}

.content_wrapper {
  @include container;
  width: 910px;
}

#header {
  height: 72px;
  background: $header-background-color;
  @include clearfix;

  ul {
    @include horizontal-list;
    padding: 0 0 0 25px;
    li {
      @include incr(18px);
      padding: 0 20px 0 0;
      text-transform: uppercase;
      a {
        color: #febf0f;
        text-decoration: none;
        width: 100px;
        height: 72px;
        display: block;
      }
      &#header-threads a {
        @include replace-text("header-threads-text.jpg");
      }
      &#header-timeline a {
        @include replace-text("header-timeline-text.jpg");
      }
    }
  }
}

#paging {
  background: $paging-background-color;
  height: 33px;
  padding: 15px 0 0 0;

  h6 {
    @include float-left;
    color: #908f8b;
    padding-right: 20px;
    text-transform: uppercase;
    a {
      color: #f07b07;
      text-decoration: none;
    }
  }
}

#content {
  position: relative;
  #previous {
    position: absolute;
    top: 0;
    left: 0;
    text-align: right;
  }
  #next {
    position: absolute;
    top: 0;
    right: 0;
    text-align: left;
  }
}

.js {
  #content {
    overflow: hidden;
    width: 100%;
  }

  #thread {
    padding: 0;
    width: 5000px;
    position: absolute;
  }
}

body {
  &.open > button::after {
    color: red;
  }
}

body {
  &::after {
    color: red;
  }
}

// Comment at EOF (#797)

Liquid

Just regular text - what happens?

{% comment %}My lovely {{comment}} {% comment %}{% endcomment %}

{% comment %}
  My lovely {{comment}} that is split
  across multiple lines {% comment %}
{% endcomment %}

{% custom_tag param1: true param2 : nil %}
{% custom_block my="abc" c = false %}
  Just usual {{liquid}}.
{% endcustom_block %}

{% another_tag "my string param" %}

{% unless a %}
Some {{ output }} right here.
{% else %}
{% endunless %}

{% case a %}
{% when 'B' %}
Some {{ output }}!
{% when 'C' %}
Some other {{ output }}!
{% else %}
{% endcase %}

{% include dir/file.html param = 'example.com' param2 = object %}
{% include 'snippet', param: 'example.com', param2: object %}
{% include product_page with products[0] %}
{% include {{product_page | split: "." | first}} for products %}

{% assign page_has_image = false %}
{% assign img_tag = '<' | append: 'img' %}
{% if link.object.content contains img_tag %}
  {% assign src = link.object.content | split: 'src="' %}
  {% assign src = src[1] | split: '"' | first %}
    {% if src.size %}
      {% assign page_has_image = true %}
      {% assign image_src = src | replace: '_small', '' | replace: '_compact', '' | replace: '_medium', '' |
                                  replace: '_large', '' | replace: '_grande', '' %}
    {% endif %}
{% endif %}

{% if page_has_image %}
  <a href="{{ link.object.url }}">
    <img src="{{ image_src }}" alt="{{ link.object.title }}">
  </a>
 {% else %}
  <a href="{{ link.object.url }}">
    {{ 'blank-page-image.jpg' | asset_url | img_tag: shop.name }}
  </a>
{% endif %}

{% for char in "Hello World" reversed %}
  {% echo char | upcase %}
{% endfor %}

Jinja2

{% include 'header.html' ignore missing with context %}
{% include 'subheader.html' without context %}

<ul>
{% for href, caption in [('index.html', 'Index'), ('about.html', 'About')] %}
  <li><a href="{{ href }}">{{ caption }}</a></li>
{% endfor %}
</ul>

{% set navigation = [('index.html', 'Index'), ('about.html', 'About')] %}
{% set key, value = call_something() %}

{# A comment #}

Hello {{ user.name|capitalize }} ! ## Comment

Cool list filter {{ listx | join(', ') }}

{% if user.admin is true %}
  <span>You're an admin !</span>
{% else %}
  <span>You're a normal user.</span>
{% endif %}

{# A comment on multiple lines
   to hide a piece of code or whatever #}

{# note: commented-out template because we no longer use this
    {% for user in users %}
        ...
    {% endfor %}
#}

{% include 'footer.html' %}

Bash

#!/bin/bash

# Fibonacci numbers
# Writes an infinite series to stdout, one entry per line
function fib() {
  local a=1
  local b=1
  while true ; do
    echo $a
    local tmp=$a
    a=$(( $a + $b ))
    b=$tmp
  done
}

# output the 10th element of the series and halt
fib | head -10 | tail -1

Java

package foo;

import java.util.Iterator;

/**
 * the fibonacci series implemented as an Iterable.
 */
public final class Fibonacci implements Iterable<Integer> {
  /** the next and previous members of the series. */
  private int a = 1, b = 1;

  @Override
  public Iterator<Integer> iterator() {
    return new Iterator<Integer>() {
      /** the series is infinite. */
      public boolean hasNext() { return true; }
      public Integer next() {
        int tmp = a;
        a += b;
        b = tmp;
        return a;
      }
      public void remove() { throw new UnsupportedOperationException(); }
    };
  }

  /**
   * the n<sup>th</sup> element of the given series.
   * @throws NoSuchElementException if there are less than n elements in the
   *   given Iterable's {@link Iterable#iterator iterator}.
   */
  public static <T>
  T nth(int n, Iterable<T> iterable) {
    Iterator<? extends T> it = iterable.iterator();
    while (--n > 0) {
      it.next();
    }
    return it.next();
  }

  public static void main(String[] args) {
    System.out.print(nth(10, new Fibonacci()));
  }
}

Kotlin

package test;

import kotlin.Int

// Single line comment
/*
 * Multiline
 * comment
 */

typealias SomeNumber = Int

val number: Long = 1_000L
var float: Float = 12.34f
0xFF_FF
3.14

314e-2
0.314e1

protected override fun ifBoolean(condition: Boolean? = null) {}

::ifBoolean

constructor() : super()

"\"true\""
'a'

"""
aaaaaaaaaaa
"""

loop@ for()

break @loop

enum class `true`

data class Person(val name: String)

enum class Size {
    BIG, MEDIUM, SMALL
}

class Ball(val color: String, val size: Size) {
    companion object {}

    fun isBig() = size == Size.BIG

    val isMedium: Boolean
        get() = size == Size.MEDIUM
}

fun Boolean?.isNull(): Boolean = this == null

fun Boolean?.getOrThrow(): Boolean = this ?: throw Exception()

Go


Php

// PHP has a plethora of comment types
/* What is a
   "plethora"? */
function fib($n) {
  # I don't know.
  $a = 1;
  $b = 1;
  while (--$n >= 0) {
    echo "$a\n";
    $tmp = $a;
    $a += $b;
    $b = $tmp;
  }
}

fib(10);

Nasm

; Simple test of the NASM parser

; Data section, initialized variables
SECTION .data

fmt:  db "a=%d, eax=%d", 10, 0 ; the printf format
a:    dd  5                    ; int a = 5

%macro IRQ 2
    global irq%1
    irq%1:
        cli
        push byte 0     ; push a dummy error code
        push byte %2    ; push the IRQ number
        jmp  irq_common_stub
%endmacro

extern  printf    ; the C function to be called

; Code section
SECTION .text

global main       ; the standard gcc entry point

main:
  push  ebp
  mov   ebp, esp
  mov   eax, [a]
  add   eax, 2
  push  'a'
  push  dword [a] ; value of variable a
  push  dword fmt ; address of ctrl string
  call  printf    ; call C function
  add   esp, 12
  mov   esp, ebp  ; takedown stack frame
  pop   ebp
  mov   eax, 0    ; normal, no error, return value
  ret             ; return

irq_common_stub:
  pusha           ; pushes all general-purpose registers
  mov   ax, ds    ; lower 16-bits of eax = ds
  mov   ax, 0x10  ; load the kernel data segment descriptor
  mov   ds, ax
  popa            ; pops all general-purpose registers
  add   esp, 8    ; cleans up the pushed error code and pushed irq number
  sti             ; (re)-enable interrupts "set interrupt flag"
  iret            ; pops CS, EIP, EFLAGS, SS, and ESP

%assign i 0
%rep 16
IRQ i, i+32
%assign i i+1
%endrep

mov eax, [eax]
mov eax, [eax + ebx]
mov eax, [eax + ebx*2]
mov eax, [eax + 10]
mov eax, [eax + ebx*2 + 10]

Sql

/* A multi-line
 * comment */
'Another string /* Isn\'t a comment',
"A string */"
-- A line comment
SELECT * FROM users WHERE id IN (1, 2.0, +30e-1);
-- keywords are case-insensitive.
-- Note: user-table is a single identifier, not a pair of keywords
select * from user-table where id in (x, y, z);

Ruby

#######
# ruby 1.9 examples
#######

class Random
  RANDOM_VAR = 1
  RANDOM_2 = 2
  RANDOM_3 = 3
end

state :foo do
  rule %r(/) do
    token Operator
    goto :expr_start
  end

  rule(//) { goto :method_call_spaced }
end

state :foo do
  rule %r(/), Thing
end

%i(this is an array of symbols)
%I(this is too, but with #{@interpolation})
hash = { answer: 42, special?: true }
link_to 'new', new_article_path, class: 'btn'

Fortran

! vim: set ts=4 sw=4 et ft=fortran:

module rats

    type rational
        integer :: numerator
        integer :: denominator
    end type rational

    type, extends(rational) :: printable_rational
        contains
        procedure, pass :: printme => rat_print
    end type printable_rational

    interface operator(+)
        module procedure rat_add
    end interface

    interface operator(-)
        module procedure rat_sub
    end interface

    interface operator (*)
        module procedure rat_mul
    end interface

    interface operator(/)
        module procedure rat_div
    end interface

    ! Interface to allow implementation of rat_print in submodule
    interface
        module subroutine rat_print(self)
        class(printable_rational), intent(inout) :: self
        end subroutine rat_print
    end interface

contains

    integer function gcd(a, b)
        integer, intent(in) :: a, b
        integer :: j, k, t

        j = a; k = b

        do while (k /= 0)
            t = mod(j, k)
            j = k
            k = t
        end do

        gcd = a
    end function gcd

    integer function lcm(a, b)
        integer, intent(in) :: a, b
        lcm = abs(a * b) / gcd(a, b)
    end function lcm

    type(rational) function rat_normalize(q)
        type(rational), intent(in) :: q
        integer :: n

        n = gcd(abs(q%numerator), abs(q%denominator))
        rat_normalize%numerator = sign(q%numerator / n, sign(1, q%numerator) * sign(1, q%denominator))
        rat_normalize%denominator = q%denominator / n
    end function rat_normalize

    integer function rat_numerator(q)
        type(rational), intent(in) :: q
        rat_numerator = q%numerator
    end function rat_numerator

    integer function rat_denominator(q)
        type(rational), intent(in) :: q
        rat_denominator =q%denominator
    end function rat_denominator

    type(rational) function rat_add(r, q)
        type(rational), intent(in) :: r, q
        integer :: n

        n = lcm(r%denominator, q%denominator)
        rat_add%numerator = (n / r%denominator) * r%numerator + (n / q%denominator) * q%numerator
        rat_add%denominator = n

        rat_add = rat_normalize(rat_add)
    end function rat_add

    type(rational) function rat_sub(r, q)
        type(rational), intent(in) :: r, q
        rat_sub = r + rational(- q%numerator, q%denominator)
    end function rat_sub

    type(rational) function rat_mul(r, q)
        type(rational), intent(in) :: r, q

        rat_mul%numerator = r%numerator * q%numerator
        rat_mul%denominator = r%denominator * q%denominator

        rat_mul = rat_normalize(rat_mul)
    end function rat_mul

    type(rational) function rat_div(r, q)
        type(rational), intent(in) :: r, q
        rat_div = r * rational(q%denominator, q%numerator)
    end function rat_div

end module rats

submodule (rats) rats_print_implementation
contains
    module procedure rat_print
    print '(I0, "/", I0)', self%numerator, self%denominator
    end procedure rat_print
end submodule rats_print_implementation

program bottles
    use rats
    implicit none

    character(len=*), parameter :: towels = 'Don''t Panic!'
    integer :: nbottles = 99
    type(rational) :: r = rational(1, 2), q = rational(1, 6)
    type(printable_rational) :: p

    do while (nbottles > 0)
        call print_bottles(nbottles)
        nbottles = nbottles - 1
    end do

    print *, towels

    r = r - q
    write(*, '(I0, "/", I0)') rat_numerator(r), rat_denominator(r)

    p = printable_rational(r)
    call p%printme()
contains

    subroutine print_bottles(n)
        implicit none
        integer, intent(in) :: n

#if defined(VERBOSE)
        select case (n)
        case (2)
            write(*, 100) n
            write(*, 110) n
            write(*, 120)
            write(*, 230)
        case (1)
            write(*, 200)
            write(*, 210)
            write(*, 120)
            write(*, 330)
        case default
            write(*, 100) n
            write(*, 110) n
            write(*, 120)
            write(*, 130) n - 1
        end select

100     format (I0, 1X, 'bottles of beer on the wall,')
110     format (I0, 1X, 'bottles of beer.')
120     format ('Take one down, pass it around,')
130     format (I0, 1X, 'bottles of beer on the wall.', /)
200     format ('One last bottle of beer on the wall,')
210     format ('one last bottle of beer.')
230     format ('one last bottle of beer on the wall.', /)
330     format ('no more bottles of beer on the wall.', /)
#endif

    end subroutine print_bottles

    subroutine share_bottles(n, m)
      use, intrinsic :: ieee_arithmetic
      implicit none
      integer, intent(in) :: n, m

      double precision :: double
      doubleprecision  :: another_double

      if (m == 0) then
        double = ieee_value(double, IEEE_QUIET_NAN)
        error stop
      else
        double = real(n, kind(double)) / real(m, kind(another_double))
        print '(A,F0.2,A)', 'Everyone gets ', double, ' bottles!'
      endif
    end subroutine share_bottles

end program bottles

Lua

#!/usr/local/bin/lua

--[[ Example code by Steve Donovan from luanova.org ]]

-- basic1.lua
require"orbit"

-- declaration
module("basic1", package.seeall, orbit.new)

-- handler
function index(web)
  return render_index()
end

snowman('☃')

-- dispatch
basic1:dispatch_get(index, "/", "/index")

-- render
function render_index()
   return [[
    <head></head>
    <html>
    <h2>Pretty Easy!</h2>
    </html>
    ]]
end

Yaml

application: mirah-lang
version: 1

# Here's a comment
handlers:
  - url: /red/*
    servlet: mysite.server.TeamServlet
    init_params:
      teamColor: red
      bgColor: "#CC0000"
    name: redteam
  - url: /blue/*
    servlet: mysite.server.TeamServlet
    init_params:
      teamColor: blue
      bgColor: "#0000CC"
    name: blueteam
  - url: /register/*
    jsp: /register/start.jsp
  - url: *.special
    filter: mysite.server.LogFilterImpl
    init_params:
      logType: special

Perl

#!/usr/bin/perl

use strict;
use integer;

# the nth element of the fibonacci series
# param n - an int >= 0
# return an int >= 0
sub fib($) {
  my $n = shift, $a = 1, $b = 1;
  ($a, $b) = ($a + $b, $a) until (--$n < 0);
  return $a;
}

print fib(10);

C++

#include <iostream>

using namespace std;

//! fibonacci numbers with gratuitous use of templates.
//! \param n an index into the fibonacci series
//! \param fib0 element 0 of the series
//! \return the nth element of the fibonacci series
template <class T>
T fib(unsigned int n, const T& fib0) {
  T a(fib0), b(fib0);
  for (; n; --n) {
    T tmp(a);
    a += b;
    b = tmp;
  }
  return a;
}

int main(int argc, char **argv)
{
  cout << fib(10, 1U);
  return 0;
}

C#.


Swift


Pascal

(* some comment here *)
PROCEDURE TestCase.AssertEquals(msg:String; expect, act:Longint);
VAR ex, ac:String;
BEGIN
  IF expect <> act THEN
  BEGIN
    Str(expect, ex);
    Fail(Concat(msg,' expected ',ex,' but was ',ac));
  END;

  factors := new(ArrayListPtr, Init);

  FOR candidate := 2 TO i DO
  BEGIN
    WHILE i MOD candidate = 0 DO
    BEGIN
      factors^.Add(candidate);
      i := i DIV candidate;
    END;
  END;
END;

Http

HTTP/1.1 200 OK
Date: Tue, 13 Dec 2011 00:11:44 GMT
Status: 200 OK
X-Transaction: 50b85fff78dab4a3
X-RateLimit-Limit: 150
ETag: "b31143be48ebfe7512b65fe64fe092f3"
X-Frame-Options: SAMEORIGIN
Last-Modified: Tue, 13 Dec 2011 00:11:44 GMT
X-RateLimit-Remaining: 145
X-Runtime: 0.01190
X-Transaction-Mask: a6183ffa5f8ca943ff1b53b5644ef1145f6f285d
Content-Type: application/json; charset=utf-8
Content-Length: 2389
Pragma: no-cache
X-RateLimit-Class: api
X-Revision: DEV
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
X-MID: a55f21733bc52bb11d1fc58f9b51b4974fbb8f83
X-RateLimit-Reset: 1323738416
Set-Cookie: k=10.34.234.116.1323735104238974; path=/;
	expires=Tue, 20-Dec-11 00:11:44 GMT; domain=.twitter.com
Set-Cookie: guest_id=v1%3A13237351042425496; domain=.twitter.com; path=/;
	expires=Thu, 12-Dec-2013 12:11:44 GMT
Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCPS6wjQ0ATsA--6b502f30a083e8a41a64f10930e142ea362b1561; domain=.twitter.com; path=/; HttpOnly
Vary: Accept-Encoding
Server: tfe

[{"contributors_enabled":false,"profile_background_tile":true,"followers_count":644,"protected":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/69064242\/gb_normal.jpg"}]

Json

{
  "problems": [
    { "question": "how many miles?", "answer": "6" },
    { "question": "how many kilometers?", "answer": "10" }
  ],
  "testing \" something \"": 1,
  "firstName": "John",
  "lastName": "Smith",
  "age": 25,
  "address": {
    "streetAddress": "21 2nd Street",
    "city": "New York",
    "state": "NY",
    "postalCode": "10021"
  },
  "strings": ["one", "two", "three", "four"],
  "nested1": [[1], [2], [3]],
  "numbers": [1, 2, 3, 4],
  "phoneNumber": [
    {
      "type": "home",
      "number": "212 555-1234"
    },
    {
      "type": "fax",
      "number": "646 555-4567"
    }
  ],
  "life_is_good": true,
  "life_is_bad": 10e-4,
  "errors": {
    "object": { "a": 1, "b": 2, "c": "some string" }
  },
  "emptyObject": {},
  "color": {
    "rgba": [0, 255, 0, 1],
    "string": "black",
    "hex": "#0F0"
  }
}

Llvm

; Declare the string constant as a global constant.
@.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00"

; External declaration of the puts function
declare i32 @puts(i8* nocapture) nounwind

; Definition of main function
define i32 @main() {   ; i32()*
  ; Convert [13 x i8]* to i8  *...
  %cast210 = getelementptr [13 x i8]* @.str, i64 0, i64 0

  ; Call puts function to write out the string to stdout.
  call i32 @puts(i8* %cast210)
  ret i32 0
}

; Named metadata
!1 = metadata !{i32 42}
!foo = !{!1, null}

PrismJS

语种代码

  • Markup - markup, html, xml, svg, mathml, ssml, atom, rss
  • CSS - css
  • C-like - clike
  • JavaScript - javascript, js
  • ABAP - abap
  • ABNF - abnf
  • ActionScript - actionscript
  • Ada - ada
  • Agda - agda
  • AL - al
  • ANTLR4 - antlr4, g4
  • Apache Configuration - apacheconf
  • Apex - apex
  • APL - apl
  • AppleScript - applescript
  • AQL - aql
  • Arduino - arduino
  • ARFF - arff
  • AsciiDoc - asciidoc, adoc
  • ASP.NET (C#) - aspnet
  • 6502 Assembly - asm6502
  • AutoHotkey - autohotkey
  • AutoIt - autoit
  • Bash - bash, shell
  • BASIC - basic
  • Batch - batch
  • BBcode - bbcode, shortcode
  • Birb - birb
  • Bison - bison
  • BNF - bnf, rbnf
  • Brainfuck - brainfuck
  • BrightScript - brightscript
  • Bro - bro
  • BSL (1C:Enterprise) - bsl, oscript
  • C - c
  • C# - csharp, cs, dotnet
  • C++ - cpp
  • CIL - cil
  • Clojure - clojure
  • CMake - cmake
  • CoffeeScript - coffeescript, coffee
  • Concurnas - concurnas, conc
  • Content-Security-Policy - csp
  • Crystal - crystal
  • CSS Extras - css-extras
  • Cypher - cypher
  • D - d
  • Dart - dart
  • DataWeave - dataweave
  • DAX - dax
  • Dhall - dhall
  • Diff - diff
  • Django/Jinja2 - django, jinja2
  • DNS zone file - dns-zone-file, dns-zone
  • Docker - docker, dockerfile
  • EBNF - ebnf
  • EditorConfig - editorconfig
  • Eiffel - eiffel
  • EJS - ejs, eta
  • Elixir - elixir
  • Elm - elm
  • Embedded Lua templating - etlua
  • ERB - erb
  • Erlang - erlang
  • Excel Formula - excel-formula, xlsx, xls
  • F# - fsharp
  • Factor - factor
  • Firestore security rules - firestore-security-rules
  • Flow - flow
  • Fortran - fortran
  • FreeMarker Template Language - ftl
  • GameMaker Language - gml, gamemakerlanguage
  • G-code - gcode
  • GDScript - gdscript
  • GEDCOM - gedcom
  • Gherkin - gherkin
  • Git - git
  • GLSL - glsl
  • Go - go
  • GraphQL - graphql
  • Groovy - groovy
  • Haml - haml
  • Handlebars - handlebars
  • Haskell - haskell, hs
  • Haxe - haxe
  • HCL - hcl
  • HLSL - hlsl
  • HTTP - http
  • HTTP Public-Key-Pins - hpkp
  • HTTP Strict-Transport-Security - hsts
  • IchigoJam - ichigojam
  • Icon - icon
  • .ignore - ignore, gitignore, hgignore, npmignore
  • Inform 7 - inform7
  • Ini - ini
  • Io - io
  • J - j
  • Java - java
  • JavaDoc - javadoc
  • JavaDoc-like - javadoclike
  • Java stack trace - javastacktrace
  • Jolie - jolie
  • JQ - jq
  • JSDoc - jsdoc
  • JS Extras - js-extras
  • JSON - json, webmanifest
  • JSON5 - json5
  • JSONP - jsonp
  • JS stack trace - jsstacktrace
  • JS Templates - js-templates
  • Julia - julia
  • Keyman - keyman
  • Kotlin - kotlin, kt, kts
  • LaTeX - latex, tex, context
  • Latte - latte
  • Less - less
  • LilyPond - lilypond, ly
  • Liquid - liquid
  • Lisp - lisp, emacs, elisp, emacs-lisp
  • LiveScript - livescript
  • LLVM IR - llvm
  • LOLCODE - lolcode
  • Lua - lua
  • Makefile - makefile
  • Markdown - markdown, md
  • Markup templating - markup-templating
  • MATLAB - matlab
  • MEL - mel
  • Mizar - mizar
  • MongoDB - mongodb
  • Monkey - monkey
  • MoonScript - moonscript, moon
  • N1QL - n1ql
  • N4JS - n4js, n4jsd
  • Nand To Tetris HDL - nand2tetris-hdl
  • Naninovel Script - naniscript, nani
  • NASM - nasm
  • NEON - neon
  • nginx - nginx
  • Nim - nim
  • Nix - nix
  • NSIS - nsis
  • Objective-C - objectivec, objc
  • OCaml - ocaml
  • OpenCL - opencl
  • Oz - oz
  • PARI/GP - parigp
  • Parser - parser
  • Pascal - pascal, objectpascal
  • Pascaligo - pascaligo
  • PC-Axis - pcaxis, px
  • PeopleCode - peoplecode, pcode
  • Perl - perl
  • PHP - php
  • PHPDoc - phpdoc
  • PHP Extras - php-extras
  • PL/SQL - plsql
  • PowerQuery - powerquery, pq, mscript
  • PowerShell - powershell
  • Processing - processing
  • Prolog - prolog
  • PromQL - promql
  • .properties - properties
  • Protocol Buffers - protobuf
  • Pug - pug
  • Puppet - puppet
  • Pure - pure
  • PureBasic - purebasic, pbfasm
  • PureScript - purescript, purs
  • Python - python, py
  • Q (kdb+ database) - q
  • QML - qml
  • Qore - qore
  • R - r
  • Racket - racket, rkt
  • React JSX - jsx
  • React TSX - tsx
  • Reason - reason
  • Regex - regex
  • Ren’py - renpy, rpy
  • reST (reStructuredText) - rest
  • Rip - rip
  • Roboconf - roboconf
  • Robot Framework - robotframework, robot
  • Ruby - ruby, rb
  • Rust - rust
  • SAS - sas
  • Sass (Sass) - sass
  • Sass (Scss) - scss
  • Scala - scala
  • Scheme - scheme
  • Shell session - shell-session, sh-session, shellsession
  • Smali - smali
  • Smalltalk - smalltalk
  • Smarty - smarty
  • SML - sml, smlnj
  • Solidity (Ethereum) - solidity, sol
  • Solution file - solution-file, sln
  • Soy (Closure Template) - soy
  • SPARQL - sparql, rq
  • Splunk SPL - splunk-spl
  • SQF: Status Quo Function (Arma 3) - sqf
  • SQL - sql
  • Stan - stan
  • Structured Text (IEC 61131-3) - iecst
  • Stylus - stylus
  • Swift - swift
  • T4 templating - t4-templating
  • T4 Text Templates (C#) - t4-cs, t4
  • T4 Text Templates (VB) - t4-vb
  • TAP - tap
  • Tcl - tcl
  • Template Toolkit 2 - tt2
  • Textile - textile
  • TOML - toml
  • Turtle - turtle, trig
  • Twig - twig
  • TypeScript - typescript, ts
  • TypoScript - typoscript, tsconfig
  • UnrealScript - unrealscript, uscript, uc
  • V - v
  • Vala - vala
  • VB.Net - vbnet
  • Velocity - velocity
  • Verilog - verilog
  • VHDL - vhdl
  • vim - vim
  • Visual Basic - visual-basic, vb, vba
  • WarpScript - warpscript
  • WebAssembly - wasm
  • Wiki markup - wiki
  • Xeora - xeora, xeoracube
  • XML doc (.net) - xml-doc
  • Xojo (REALbasic) - xojo
  • XQuery - xquery
  • YAML - yaml, yml
  • YANG - yang
  • Zig - zig

配色主题

  • OKAIDIA
  • TWILIGHT
  • TOMORROW NIGHT

数学图表

MathJax

Mermaid

Echarts

Timeline

MindMap


Emoji

Markdown HTML Emoji Unicode
:ok_hand: &#x1F44C; :ok_hand: 👌
:+1: &#x1F44D; :+1: 👍
:-1: &#x1F44E; :-1: 👎
:100: &#x1F4AF; :100: 💯
:point_right: &#x1F449; :point_right: 👉
:point_left: &#x1F448; :point_left: 👈
:clock5: &#x1F554; :clock5: 🕔
:calendar: &#x1F4C6; :calendar: 📆
:punch: &#x1F44A; :punch: 👊
:v: &#x270C;&#xFE0F; :v: ✌️
:hand: &#x270B; :hand:
:clap: &#x1F44F; :clap: 👏
:muscle: &#x1F4AA; :muscle: 💪
:pray: &#x1F64F; :pray: 🙏
:runner: &#x1F3C3; :runner: 🏃
:metal: &#x1F918; :metal: 🤘
:couple: &#x1F46B; :couple: 👫
:dancer: &#x1F483; :dancer: 💃
:bow: &#x1F647; :bow: 🙇
:ear: &#x1F442; :ear: 👂
:eyes: &#x1F440; :eyes: 👀
:kiss: &#x1F48B; :kiss: 💋
:sunny: &#x2600;&#xFE0F; :sunny: ☀️
:zap: &#x26A1;&#xFE0F; :zap: ⚡️
:cat: &#x1F431; :cat: 🐱
:dog: &#x1F436; :dog: 🐶
:pig: &#x1F437; :pig: 🐷
:frog: &#x1F438; :frog: 🐸
:bear: &#x1F43B; :bear: 🐻
:rat: &#x1F400; :rat: 🐀
:earth_asia: &#x1F30F; :earth_asia: 🌏
:gift: &#x1F381; :gift: 🎁
:computer: &#x1F4BB; :computer: 💻
:telephone: &#x260E;&#xFE0F; :telephone: ☎️
:sound: &#x1F509; :sound: 🔉
:email: &#x2709;&#xFE0F; :email: ✉️
:key: &#x1F511; :key: 🔑
:date: &#x1F4C5; :date: 📅
:gun: &#x1F52B; :gun: 🔫
:bomb: &#x1F4A3; :bomb: 💣
:sos: &#x1F198; :sos: 🆘
:accept: &#x1F251; :accept: 🉑
:secret: &#x3299;&#xFE0F; :secret: ㊙️
:congratulations: &#x3297;&#xFE0F; :congratulations: ㊗️

图床测试



上一篇 本站的来由

Comments

Content