Skip to content

Commit

Permalink
Add descriptions in document.ejs
Browse files Browse the repository at this point in the history
Add screenshot
Update comments
  • Loading branch information
ShinChven committed Mar 2, 2020
1 parent 039143b commit 4013ec3
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/umi.css": "./umi.fbbadf17.css",
"/umi.js": "./umi.252937ab.js",
"/umi.js": "./umi.f4698402.js",
"/index.html": "./index.html"
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><link rel="stylesheet" href="./umi.fbbadf17.css"><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=0.2,minimum-scale=0.2,maximum-scale=5,user-scalable=1"><title>Android Syntax Highlighter</title><link rel="icon" href="/favicon.png" type="image/x-icon"><script>window.routerBase = "/";</script></head><body><noscript>Sorry, we need js to run correctly!</noscript><div id="root"></div><script src="./umi.252937ab.js"></script></body></html>
<!DOCTYPE html><html lang="en"><head><link rel="stylesheet" href="./umi.fbbadf17.css"><meta charset="UTF-8"><meta content="IE=edge" http-equiv="X-UA-Compatible"><meta name="viewport" content="width=device-width,initial-scale=0.2,minimum-scale=0.2,maximum-scale=5,user-scalable=1"><meta name="description" content="This is an Android Syntax Highlighter based on react-syntax-highlighter and UmiJS created by ShinChven."><meta name="author" content="[email protected]"><meta name="repository" content="https://github.com/ShinChven/AndroidSyntaxHighlighter"><title>Android Syntax Highlighter</title><script>window.routerBase = "/";</script></head><body><noscript>Sorry, we need js to run correctly!</noscript><!--suppress CheckTagEmptyBody --><div id="root"></div><script src="./umi.f4698402.js"></script></body></html>

Large diffs are not rendered by default.

Binary file added screenshot/Screenshot_1583156360.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 10 additions & 9 deletions syntax-highlighter/src/pages/document.ejs
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta
name="viewport"
content="width=device-width, initial-scale=0.2, minimum-scale=0.2, maximum-scale=5.0, user-scalable=1.0"
/>
<meta charset="UTF-8" />
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<meta name="viewport"
content="width=device-width, initial-scale=0.2, minimum-scale=0.2, maximum-scale=5.0, user-scalable=1.0" />
<meta name="description"
content="This is an Android Syntax Highlighter based on react-syntax-highlighter and UmiJS created by ShinChven." />
<meta name="author" content="[email protected]" />
<meta name="repository" content="https://github.com/ShinChven/AndroidSyntaxHighlighter" />
<title>Android Syntax Highlighter</title>
<link rel="icon" href="/favicon.png" type="image/x-icon"/>
</head>
<body>
<noscript>Sorry, we need js to run correctly!</noscript>
<div id="root">
</div>
<!--suppress CheckTagEmptyBody -->
<div id="root"></div>
</body>
</html>
20 changes: 14 additions & 6 deletions syntax-highlighter/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Component extends React.PureComponent {
language,
})
};

// setup global functions for Android WebView to call
/**
* style name
* @param hljsStyle
Expand All @@ -56,15 +58,21 @@ class Component extends React.PureComponent {
that.setState({startingLineNumber: parseInt(startingLineNumber)})
}
};
try {
// noinspection JSUnresolvedVariable,JSUnresolvedFunction
// Call Android JavaScriptInterface functions to send data and notify componentDidMount
try { // noinspection JSUnresolvedVariable,JSUnresolvedFunction
window.AndroidSyntaxHighlightView.listStyles(JSON.stringify(this.listStyles()));
// noinspection JSUnresolvedVariable,JSUnresolvedFunction
} catch (e) {
console.error(e);
}
try { // noinspection JSUnresolvedVariable,JSUnresolvedFunction
window.AndroidSyntaxHighlightView.listSupportedLanguages(JSON.stringify(SyntaxHighlighter.supportedLanguages));
// noinspection JSUnresolvedVariable,JSUnresolvedFunction
} catch (e) {
console.error(e);
}
try { // noinspection JSUnresolvedVariable,JSUnresolvedFunction
window.AndroidSyntaxHighlightView.componentDidMount();
} catch (e) {
console.error(e)
console.error(e);
}
}

Expand All @@ -85,7 +93,7 @@ class Component extends React.PureComponent {
render() {
const {style} = this.state;
return (
<div style={{height: '100%', background: style.hljs.background, }}>
<div style={{height: '100%', background: style.hljs.background,}}>
<SyntaxHighlighter
language={this.state.language}
style={style}
Expand Down

0 comments on commit 4013ec3

Please sign in to comment.