Skip to content

Commit

Permalink
feat: add buttons for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LogCreative committed Jul 8, 2024
1 parent 754fd4c commit 44a8ef1
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ __pycache__/
res/version.js
res/VERSION
deploy/error.log
.pkl_memoize_py3/
.pkl_memoize_py3/
.DS_Store
Binary file modified docs/figs/code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figs/code_chs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figs/compile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figs/compile_chs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figs/function.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figs/function_chs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figs/interface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figs/interface_chs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/figs/translation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if lang == "chs" then
-- -- luatex-ja could not output DVI, use babel as a workaround
-- -- https://tex.stackexchange.com/a/717269
-- tex.print("\\usepackage[chinese, provide=*]{babel}\\babelfont{rm}{FandolSong}\\babelfont{tt}{FandolSong}")
tex.print("\\usepackage{ctex}")
tex.print("\\usepackage[fontset=fandol]{ctex}")
end
if lang == nil then
lang = "en"
Expand Down
8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,18 @@
</div>
</div>
<div id="about">
<div class="about-buttons">
<button class="about-button" onclick="about()">{{ $t('start') }}</button>
<a :href="docPrefix + '/pgfplotsedt'+$t('docSuffix')+'.pdf'" target="_blank"><button class="about-button">{{ $t('documentation') }}</button></a>
</div>
<div><input type="checkbox" v-model="notusefast"> {{$t('copyright.fast-compiler-not-use')}}</input></div>
<div id="server-announce" v-html="$t('copyright.server-announce')"></div>
<div id="copyright" v-html="$t('copyright.line')"></div>
<div id="about-detail">
<div id="copyright-detail" v-html="$t('copyright.detail')"></div>
<div id="llama-detail" v-show="llm" v-html="$t('copyright.llama3')"></div>
<div id="privacy-policy" v-show="!notusefast" v-html="$t('copyright.privacy')"></div>
</div>
<div><input type="checkbox" v-model="notusefast"> {{$t('copyright.fast-compiler-not-use')}}</input></div>
<div id="server-announce" v-html="$t('copyright.server-announce')"></div>
<div id="copyright-hint" v-html="$t('copyright.hint')"></div>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions lang/chs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const chs = {
"Faster to PGFPlot in LaTeX": "PGFPlotsEdt",
"about": "关于 PGFPlotsEdt",
"repo": "PGFPlots GitHub 仓库",
"start": "开始使用",
"documentation": "帮助文档",
"docSuffix": "_chs",
"copyright": {
"line": "版权所有 © 2020&ndash;2024 Log Creative",
"detail": "<p>本程序为自由软件,在自由软件联盟发布的 GNU Affero 通用公共许可协议的约束下,你可以对其进行再发布及修改。协议版本为第三版或(随你)更新的版本。</p><p>我们希望发布的这款程序有用,但不提供任何担保,甚至不保证它有经济价值和适合特定用途。详情参见 <a href='https://github.com/LogCreative/PGFPlotsEdt/blob/master/LICENSE' target='_blank'>GNU Affero 通用公共许可协议</a>。</p>",
Expand Down
3 changes: 3 additions & 0 deletions lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const en = {
"Faster to PGFPlot in LaTeX": "Faster to PGFPlot in LaTeX",
"about": "About PGFPlotsEdt",
"repo": "PGFPlots GitHub Repository",
"start": "Start",
"documentation": "Docs",
"docSuffix": "",
"copyright": {
"line": "Copyright © 2020&ndash;2024 Log Creative",
"detail": "<p>This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p><p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the <a href='https://github.com/LogCreative/PGFPlotsEdt/blob/master/LICENSE' target='_blank'>GNU Affero General Public License</a> for more details.</p>",
Expand Down
18 changes: 18 additions & 0 deletions main.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ a{
font-weight: bold;
}

.about-buttons {
margin-bottom: 3vh;
}

.about-button {
width: 8em;
height: 2em;
margin: 0 1vh;
}

.about-button:hover::after {
content: ' 〉';
}

#server-announce {
margin: 2vh 0;
}

/* .container{
padding: 15px;
} */
Expand Down
10 changes: 10 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,7 @@ var app = new Vue({
chnpkg:"CJK",
notusefast:false,
llm: false,
docPrefix: "/PGFPlotsEdt-doc",
},
mounted: function (){
window.onbeforeunload = (e) => {
Expand All @@ -1338,6 +1339,15 @@ var app = new Vue({
this.dc_content = this.content;
this.lang = in_lang;

var request = new XMLHttpRequest();
request.open('GET', "/docs/pgfplotsedt.pdf", true);
request.onreadystatechange = function() {
if (request.status === 200) {
app.docPrefix = "/docs"
}
}
request.send();

this.compilerTest(function(){
app.requestid = Date.now() * 10000 + Math.floor(Math.random() * 10000);
}, function () {
Expand Down

0 comments on commit 44a8ef1

Please sign in to comment.