前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Syntax Highlighting

Syntax Highlighting

作者头像
caoayu
发布2020-09-23 11:15:44
3650
发布2020-09-23 11:15:44
举报
文章被收录于专栏:caoayu的分享caoayu的分享
代码语言:javascript
复制
function helloWorld () {
  alert("Hello, World!")
}
代码语言:javascript
复制
public class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello, World!");
  }
}
代码语言:javascript
复制
package hello

fun main(args: Array<String>) {
  println("Hello World!")
}
代码语言:javascript
复制
#include <stdio.h>

/* Hello */
int main(void){
  printf("Hello, World!");
  return 0;
}
代码语言:javascript
复制
// 'Hello World!' program 
 
#include <iostream>
 
int main(){
  std::cout << "Hello World!" << std::endl;
  return 0;
}
代码语言:javascript
复制
using System;
class HelloWorld{
  public static void Main(){ 
    System.Console.WriteLine("Hello, World!");
  }
}
代码语言:javascript
复制
<html>
<body>
  Hello, World!
</body>
</html>
代码语言:javascript
复制
package main
import fmt "fmt"

func main() 
{
   fmt.Printf("Hello, World!\n");
}
代码语言:javascript
复制
object HelloWorld with Application {
  Console.println("Hello, World!");
}
代码语言:javascript
复制
<?php
  echo 'Hello, World!';
?>
代码语言:javascript
复制
print("Hello, World!")
代码语言:javascript
复制
(defn hello-world
  "A function print 'Hello world'."
  []
  (prn "Hello world"))
代码语言:javascript
复制
<!DOCTYPE html>
<html>
<head>
  <title>{{ .Title }}</title>
</head>
<body>
  <h1>{{ .Title }}</h1>
  {{ .Content }}
</body>
</html>
代码语言:javascript
复制
{{ partial "header.html" . }}

  <h1>posts</h1>
  {{ range first 10 .Data.Pages }}
    {{ if eq .Type "post"}}
      <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
    {{ end }}
  {{ end }}

  <h1>pages</h1>
  {{ range .Data.Pages }}
    {{ if or (eq .Type "page") (eq .Type "about") }}
      <h2><a href="{{ .Permalink }}">{{ .Type }} - {{ .Title }} - {{ .RelPermalink }}</a></h2>
    {{ end }}
  {{ end }}

{{ partial "footer.html" . }}

Detect the language

代码语言:javascript
复制
package hello

fun main(args: Array<String>) {
  println("Hello World!")
}
代码语言:javascript
复制
<?php
  echo 'Hello, World!';
?>

By {{< highlight go-html-template "linenos=table,hl_lines=1 3-7,linenostart=199" >}}..{{< / highlight >}}

代码语言:javascript
复制
<section id="main">
  <div>
   <h1 id="title">{{ .Title }}</h1>
    {{ range .Data.Pages }}
        {{ .Render "summary"}}
    {{ end }}
  </div>
</section>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-08-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档