From 1d7c74e9b5c416c58b66246a6bbc907399fe9083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=A1=E8=BF=9C=E8=8D=A3?= <416828041@qq.com> Date: Sat, 16 Feb 2019 00:15:44 +0800 Subject: Syntax highlighting on the website paegs (#1780) --- website/index.html | 20 ++++++++++++++++---- website/manual.html | 11 +++++++++++ website/manual.md | 6 +++--- website/style.css | 9 +++++++++ website/style_guide.html | 11 +++++++++++ 5 files changed, 50 insertions(+), 7 deletions(-) diff --git a/website/index.html b/website/index.html index ffd83a253..156c9f946 100644 --- a/website/index.html +++ b/website/index.html @@ -3,6 +3,10 @@ Deno + + + + @@ -98,9 +102,7 @@ href="https://github.com/denoland/deno_install/blob/master/install.ps1">https://

Or a more complex one:

-
-import { serve } from "https://deno.land/x/http/server.ts";
+      
import { serve } from "https://deno.land/x/http/server.ts";
 const s = serve("0.0.0.0:8000");
 
 async function main() {
@@ -109,7 +111,7 @@ async function main() {
   }
 }
 
-main(); 
+main();

Dig in... #

@@ -138,6 +140,16 @@ main(); >A curated list of awesome Deno things

+ + + diff --git a/website/manual.html b/website/manual.html index cbdbd79e1..e51a827ec 100644 --- a/website/manual.html +++ b/website/manual.html @@ -3,6 +3,10 @@ Deno Manual + + + + @@ -32,6 +36,13 @@ let el = document.getElementById(window.location.hash.slice(1)); window.scrollTo({ top: el.offsetTop }); } + + // Disable automatic language detection + hljs.configure({ + languages: [], + }); + + hljs.initHighlighting(); } main(); diff --git a/website/manual.md b/website/manual.md index 271974d26..c79ba43e1 100644 --- a/website/manual.md +++ b/website/manual.md @@ -115,7 +115,7 @@ deno https://deno.land/welcome.js ### Build from source -``` +```bash # Fetch deps. git clone --recurse-submodules https://github.com/denoland/deno.git cd deno @@ -170,7 +170,7 @@ Extra steps for Windows users: #### Other useful commands -``` +```bash # Call ninja manually. ./third_party/depot_tools/ninja -C target/debug @@ -556,7 +556,7 @@ Rust. These common data structures are defined in ### Updating prebuilt binaries -``` +```bash ./third_party/depot_tools/upload_to_google_storage.py -b denoland \ -e ~/.config/gcloud/legacy_credentials/ry@tinyclouds.org/.boto `which sccache` mv `which sccache`.sha1 prebuilt/linux64/ diff --git a/website/style.css b/website/style.css index b16d33eb7..0b78c4e07 100644 --- a/website/style.css +++ b/website/style.css @@ -91,3 +91,12 @@ header h1 { } } +code { + background: rgba(36, 126, 233, 0.1); + padding: 2px 5px; + color: #333; +} + +.hljs { + background: transparent; +} \ No newline at end of file diff --git a/website/style_guide.html b/website/style_guide.html index ec6012b23..6bcfe6434 100644 --- a/website/style_guide.html +++ b/website/style_guide.html @@ -3,6 +3,10 @@ Deno Style Guide + + + + @@ -32,6 +36,13 @@ let el = document.getElementById(window.location.hash.slice(1)); window.scrollTo({ top: el.offsetTop }); } + + // Disable automatic language detection + hljs.configure({ + languages: [], + }); + + hljs.initHighlighting(); } main(); -- cgit v1.2.3