From e9a6e73c54e24f7e4f6066da3897a2fb1f925cbb Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Mon, 7 Dec 2020 20:33:03 +0100 Subject: [PATCH] docs: better syntax highlighting (#21959) --- _layouts/default.html | 2 +- docs/_install-and-build/Installing-Geth.md | 6 +- static/styles/custom/common.css | 4 +- static/styles/custom/default.css | 69 ---------------------- static/styles/custom/vss.css | 38 ++++++++++++ static/styles/highlight.min.css | 1 - 6 files changed, 45 insertions(+), 75 deletions(-) delete mode 100644 static/styles/custom/default.css create mode 100644 static/styles/custom/vss.css delete mode 100644 static/styles/highlight.min.css diff --git a/_layouts/default.html b/_layouts/default.html index a5241dc214..d2aa1c5e0c 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -4,7 +4,7 @@ common-css: - /static/styles/flatly.min.css - /static/styles/font-awesome.min.css - /static/styles/custom/common.css -- /static/styles/custom/default.css +- /static/styles/custom/vss.css common-js: - /static/scripts/jquery.min.js - /static/scripts/bootstrap.min.js diff --git a/docs/_install-and-build/Installing-Geth.md b/docs/_install-and-build/Installing-Geth.md index c6b92ed1a9..d6a25cfbce 100644 --- a/docs/_install-and-build/Installing-Geth.md +++ b/docs/_install-and-build/Installing-Geth.md @@ -197,7 +197,7 @@ The Chocolatey package manager provides an easy way to get the required build to Then open an Administrator command prompt and install the build tools you need: -```shell +``` C:\Windows\system32> choco install git C:\Windows\system32> choco install golang C:\Windows\system32> choco install mingw @@ -207,11 +207,11 @@ Installing these packages sets up the path environment variables, you need to op The following steps don't need Administrator privileges. First create and set up a Go workspace directory layout, then clone the source and build it. -```shell +``` C:\Users\xxx> mkdir src\github.com\ethereum C:\Users\xxx> git clone https://github.com/ethereum/go-ethereum src\github.com\ethereum\go-ethereum C:\Users\xxx> cd src\github.com\ethereum\go-ethereum -C:\Users\xxx> go get -u -v golang.org/x/net/context +C:\Users\xxx\src\github.com\ethereum\go-ethereum> go get -u -v golang.org/x/net/context C:\Users\xxx\src\github.com\ethereum\go-ethereum> go install -v ./cmd/... ``` diff --git a/static/styles/custom/common.css b/static/styles/custom/common.css index a6140ab0c7..606d466c6d 100644 --- a/static/styles/custom/common.css +++ b/static/styles/custom/common.css @@ -12,11 +12,13 @@ pre code { } code { - color: #7b8a8b; + color: #4b5a5b; background-color: #ecf0f1; overflow-x: scroll; overflow-y: hidden; } +/* Darken down code highlighting */ +.highlight { color: #4b5a5b } /* Name */ a code { color: #18bc9c; diff --git a/static/styles/custom/default.css b/static/styles/custom/default.css deleted file mode 100644 index 572069c1d2..0000000000 --- a/static/styles/custom/default.css +++ /dev/null @@ -1,69 +0,0 @@ -.highlight .hll { background-color: #ffffcc } -.highlight { background: #f8f8f8; } -.highlight .c { color: #408080; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #008000; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */ -.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #BC7A00 } /* Comment.Preproc */ -.highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ -.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #888888 } /* Generic.Output */ -.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0044DD } /* Generic.Traceback */ -.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #008000 } /* Keyword.Pseudo */ -.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #B00040 } /* Keyword.Type */ -.highlight .m { color: #666666 } /* Literal.Number */ -.highlight .s { color: #BA2121 } /* Literal.String */ -.highlight .na { color: #7D9029 } /* Name.Attribute */ -.highlight .nb { color: #008000 } /* Name.Builtin */ -.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ -.highlight .no { color: #880000 } /* Name.Constant */ -.highlight .nd { color: #AA22FF } /* Name.Decorator */ -.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -.highlight .nf { color: #0000FF } /* Name.Function */ -.highlight .nl { color: #A0A000 } /* Name.Label */ -.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #19177C } /* Name.Variable */ -.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mb { color: #666666 } /* Literal.Number.Bin */ -.highlight .mf { color: #666666 } /* Literal.Number.Float */ -.highlight .mh { color: #666666 } /* Literal.Number.Hex */ -.highlight .mi { color: #666666 } /* Literal.Number.Integer */ -.highlight .mo { color: #666666 } /* Literal.Number.Oct */ -.highlight .sa { color: #BA2121 } /* Literal.String.Affix */ -.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ -.highlight .sc { color: #BA2121 } /* Literal.String.Char */ -.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */ -.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #BA2121 } /* Literal.String.Double */ -.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ -.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -.highlight .sx { color: #008000 } /* Literal.String.Other */ -.highlight .sr { color: #BB6688 } /* Literal.String.Regex */ -.highlight .s1 { color: #BA2121 } /* Literal.String.Single */ -.highlight .ss { color: #19177C } /* Literal.String.Symbol */ -.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ -.highlight .fm { color: #0000FF } /* Name.Function.Magic */ -.highlight .vc { color: #19177C } /* Name.Variable.Class */ -.highlight .vg { color: #19177C } /* Name.Variable.Global */ -.highlight .vi { color: #19177C } /* Name.Variable.Instance */ -.highlight .vm { color: #19177C } /* Name.Variable.Magic */ -.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/static/styles/custom/vss.css b/static/styles/custom/vss.css new file mode 100644 index 0000000000..af4b2a094f --- /dev/null +++ b/static/styles/custom/vss.css @@ -0,0 +1,38 @@ +.highlight .hll { background-color: #ffffcc } +.highlight { background: #ffffff; } +.highlight .c { color: #008000 } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #0000ff } /* Keyword */ +.highlight .ch { color: #008000 } /* Comment.Hashbang */ +.highlight .cm { color: #008000 } /* Comment.Multiline */ +.highlight .cp { color: #0000ff } /* Comment.Preproc */ +.highlight .cpf { color: #008000 } /* Comment.PreprocFile */ +.highlight .c1 { color: #008000 } /* Comment.Single */ +.highlight .cs { color: #008000 } /* Comment.Special */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gh { font-weight: bold } /* Generic.Heading */ +.highlight .gp { font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { font-weight: bold } /* Generic.Subheading */ +.highlight .kc { color: #0000ff } /* Keyword.Constant */ +.highlight .kd { color: #0000ff } /* Keyword.Declaration */ +.highlight .kn { color: #0000ff } /* Keyword.Namespace */ +.highlight .kp { color: #0000ff } /* Keyword.Pseudo */ +.highlight .kr { color: #0000ff } /* Keyword.Reserved */ +.highlight .kt { color: #2b91af } /* Keyword.Type */ +.highlight .s { color: #a31515 } /* Literal.String */ +.highlight .nc { color: #2b91af } /* Name.Class */ +.highlight .ow { color: #0000ff } /* Operator.Word */ +.highlight .sa { color: #a31515 } /* Literal.String.Affix */ +.highlight .sb { color: #a31515 } /* Literal.String.Backtick */ +.highlight .sc { color: #a31515 } /* Literal.String.Char */ +.highlight .dl { color: #a31515 } /* Literal.String.Delimiter */ +.highlight .sd { color: #a31515 } /* Literal.String.Doc */ +.highlight .s2 { color: #a31515 } /* Literal.String.Double */ +.highlight .se { color: #a31515 } /* Literal.String.Escape */ +.highlight .sh { color: #a31515 } /* Literal.String.Heredoc */ +.highlight .si { color: #a31515 } /* Literal.String.Interpol */ +.highlight .sx { color: #a31515 } /* Literal.String.Other */ +.highlight .sr { color: #a31515 } /* Literal.String.Regex */ +.highlight .s1 { color: #a31515 } /* Literal.String.Single */ +.highlight .ss { color: #a31515 } /* Literal.String.Symbol */ \ No newline at end of file diff --git a/static/styles/highlight.min.css b/static/styles/highlight.min.css deleted file mode 100644 index 7ba3eec2d5..0000000000 --- a/static/styles/highlight.min.css +++ /dev/null @@ -1 +0,0 @@ -.hljs{display:block;overflow-x:auto;padding:0.5em;color:#000;background:#f8f8ff}.hljs-comment,.hljs-quote{color:#408080;font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-subst{color:#954121}.hljs-number{color:#40a070}.hljs-string,.hljs-doctag{color:#219161}.hljs-selector-id,.hljs-selector-class,.hljs-section,.hljs-type{color:#19469d}.hljs-params{color:#00f}.hljs-title{color:#458;font-weight:bold}.hljs-tag,.hljs-name,.hljs-attribute{color:#000080;font-weight:normal}.hljs-variable,.hljs-template-variable{color:#008080}.hljs-regexp,.hljs-link{color:#b68}.hljs-symbol,.hljs-bullet{color:#990073}.hljs-built_in,.hljs-builtin-name{color:#0086b3}.hljs-meta{color:#999;font-weight:bold}.hljs-deletion{background:#fdd}.hljs-addition{background:#dfd}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold} \ No newline at end of file