Skip to content

Commit

Permalink
Update styling of SourceFilePage
Browse files Browse the repository at this point in the history
  • Loading branch information
huangsam committed Apr 7, 2024
1 parent 337c80f commit 5c70d41
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
@@ -0,0 +1,2 @@
[*.java]
indent_style = tab
Expand Up @@ -60,8 +60,8 @@ public SourceFilePage(final ISourceNode sourceFileNode,

@Override
protected void content(final HTMLElement body) throws IOException {
final SourceHighlighter hl = new SourceHighlighter(context.getLocale());
hl.render(body, getNode(), sourceReader);
final SourceHighlighter highlighter = new SourceHighlighter(context.getLocale());
highlighter.render(body, getNode(), sourceReader);
sourceReader.close();
}

Expand All @@ -76,8 +76,9 @@ protected void head(final HTMLElement head) throws IOException {

@Override
protected String getOnload() {
return format("window['PR_TAB_WIDTH']=%d;prettyPrint()",
Integer.valueOf(tabWidth));
String setTabWidth = format("window['PR_TAB_WIDTH']=%d", tabWidth);
String invokePrettyPrint = "prettyPrint()";
return setTabWidth + ";" + invokePrettyPrint;
}

@Override
Expand Down
Expand Up @@ -77,9 +77,6 @@ public final class Styles {
/** Block of source code */
public static final String SOURCE = "source";

/** Line number before each source line */
public static final String NR = "nr";

/** Part of source code where instructions are not covered */
public static final String NOT_COVERED = "nc";

Expand Down
Expand Up @@ -80,6 +80,9 @@ h1 {
pre.source {
border:#d6d3ce 1px solid;
font-family:monospace;
background-color: #f3f3f3;
border-radius: 20px;
padding: 10px;
}

pre.source ol {
Expand All @@ -88,8 +91,8 @@ pre.source ol {
}

pre.source li {
border-left: 1px solid #D6D3CE;
color: #A0A0A0;
border-left: 0px;
color: black;
padding-left: 0px;
}

Expand Down

0 comments on commit 5c70d41

Please sign in to comment.