From: Tuukka Lehtonen Date: Fri, 9 Aug 2019 11:12:04 +0000 (+0300) Subject: Added anchors for SCL data types and classes in HTML documentation X-Git-Tag: v1.43.0~136^2~118 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F85%2F3085%2F2;p=simantics%2Fplatform.git Added anchors for SCL data types and classes in HTML documentation * data Foo anchor: `data-Foo` * class Bar anchor: `class-Bar` Also changed data types, classes and values to have different background coloring in the SCL HTML documentation for better readability. gitlab #337 Change-Id: I731489cbb1a972dd6e2bc95645b66f41877e843d --- diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SCLDocumentationExtensionNodeHandler.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SCLDocumentationExtensionNodeHandler.java index d9e65e28c..e719aaf8c 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SCLDocumentationExtensionNodeHandler.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SCLDocumentationExtensionNodeHandler.java @@ -178,7 +178,7 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle StringBuilder signature = new StringBuilder(); signature.append("
"); + .append("\" class=\"code-doc-box\">
"); char firstChar = name.charAt(0); if(!Character.isAlphabetic(firstChar) && firstChar != '_') name = "(" + name + ")"; @@ -231,7 +231,9 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle TypeUnparsingContext tuc = new TypeUnparsingContext(); StringBuilder signature = new StringBuilder(); - signature.append("
"); + signature.append("
"); signature.append("class "); if(typeClass.context.length > 0) { signature.append('('); @@ -293,7 +295,9 @@ public class SCLDocumentationExtensionNodeHandler implements ExtensionNodeHandle TypeUnparsingContext tuc = new TypeUnparsingContext(); StringBuilder signature = new StringBuilder(); - signature.append("
"); + signature.append("
"); signature.append("data "); signature.append(typeDescriptor.name.name); if(typeDescriptor instanceof TypeConstructor) { diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SclDoc.css b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SclDoc.css index 27ecb48eb..7dd204348 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SclDoc.css +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/html/SclDoc.css @@ -491,7 +491,6 @@ vertical-align:1px; .code-doc-box>.code { font-size: 12px; font-family: Consolas, "Liberation Mono", Courier, monospace; - background-color: #f0f0ff; white-space: pre; padding: 10px 15px; border-bottom: 1px solid; @@ -500,7 +499,19 @@ vertical-align:1px; display: block; } -.code-doc-box>.doc {display: block; +.code-doc-box>.value { + background-color: #f0f0ff; +} + +.code-doc-box>.data { + background-color: #f0fff0; +} + +.code-doc-box>.class { + background-color: #fff0f0; +} + +.code-doc-box>.doc { padding: 0px 15px ; display: block; }