Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gitcode_dev
jupyter-render
提交
7e53a074
J
jupyter-render
项目概览
gitcode_dev
/
jupyter-render
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jupyter-render
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7e53a074
编写于
9月 16, 2021
作者:
璃白.
🌻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
ca98dca1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
48 addition
and
22 deletion
+48
-22
src/assets/css/marked.less
src/assets/css/marked.less
+7
-2
src/assets/img/stop.svg
src/assets/img/stop.svg
+1
-0
src/components/cell.vue
src/components/cell.vue
+14
-6
src/main.ts
src/main.ts
+16
-14
vite.config.ts
vite.config.ts
+10
-0
未找到文件。
src/assets/css/marked.less
浏览文件 @
7e53a074
...
...
@@ -215,11 +215,13 @@
font-size: 90%;
text-transform: uppercase;
}
pre {
.jupyter_code
pre {
white-space: pre-wrap;
word-wrap: break-word;
margin: 0 0 14px;
overflow-x: auto;
background: inherit;
border: none;
code {
overflow-x: auto;
white-space: pre;
...
...
@@ -390,13 +392,16 @@ p[align="center"] {
.jupyter_container em strong {
font-style: italic;
}
.jupyter_container p,
.jupyter_container h1,
.jupyter_container h2,
.jupyter_container h3,
.jupyter_container h4,
.jupyter_container h5,
.jupyter_container h6 {
// color: #4f4f4f;
color: #abb2bf;
border: none;
margin: 0;
// margin: 8px 0 16px;
font-weight: 700;
}
...
...
src/assets/img/stop.svg
0 → 100644
浏览文件 @
7e53a074
<svg
t=
"1631789535144"
class=
"icon"
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"2883"
width=
"200"
height=
"200"
><path
d=
"M518.86 921.21c-224.81 0-407.71-182.9-407.71-407.71S294 105.79 518.86 105.79s407.71 182.9 407.71 407.71-182.9 407.71-407.71 407.71z m0-754c-190.94 0-346.28 155.34-346.28 346.29s155.33 346.29 346.28 346.29S865.14 704.45 865.14 513.5 709.8 167.22 518.86 167.22z"
p-id=
"2884"
fill=
"#409eff"
></path><path
d=
"M392.17 386.81h253.38v253.38H392.17z"
p-id=
"2885"
fill=
"#409eff"
></path></svg>
\ No newline at end of file
src/components/cell.vue
浏览文件 @
7e53a074
<
template
>
<div>
<div
class=
"jupyter_input"
>
<div
v-if=
"output"
class=
"run_btn"
@
click=
"run"
></div>
<div
v-if=
"output && !loading"
class=
"run_btn"
@
click=
"run"
></div>
<div
v-if=
"output && loading"
class=
"stop_btn"
></div>
<div
class=
"jupyter_code"
>
<pre><p
v-html=
"input"
></p></pre>
</div>
...
...
@@ -74,7 +75,7 @@ export default defineComponent({
data
()
{
return
{
showResult
:
false
,
loading
:
tru
e
loading
:
fals
e
};
},
methods
:
{
...
...
@@ -127,15 +128,21 @@ export default defineComponent({
padding-left: 52px;
box-sizing: border-box;
position: relative;
.run_btn {
.run_btn,
.stop_btn {
width: 32px;
height: 32px;
position: absolute;
left: 12px;
top: 12px;
}
.run_btn {
cursor: pointer;
background: url("../assets/img/run.svg") center / 24px no-repeat;
}
.stop_btn {
background: url("../assets/img/stop.svg") center / 30px no-repeat;
}
}
.jupyter_output {
background: rgb(58, 65, 79);
...
...
@@ -146,9 +153,10 @@ export default defineComponent({
border-radius: 4px;
box-sizing: border-box;
.loading {
width: 32px;
height: 32px;
background: url("../assets/img/loading.svg") center / 24px no-repeat;
width: 24px;
height: 24px;
margin: 0;
background: url("../assets/img/loading.svg") center / cover no-repeat;
animation: loading 2s linear infinite;
}
:deep(.jupyter_result) {
...
...
src/main.ts
浏览文件 @
7e53a074
...
...
@@ -2,18 +2,20 @@ import { createApp } from 'vue'
import
App
from
'
./App.vue
'
import
'
./assets/css/style.less
'
;
// document.addEventListener('DOMContentLoaded', () => {
console
.
log
(
'
render jupyter
'
)
const
jupyterLinks
=
Array
.
from
(
document
.
querySelectorAll
(
'
a
'
))
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
console
.
log
(
'
render jupyter
'
)
const
jupyterLinks
=
Array
.
from
(
document
.
querySelectorAll
(
'
a
'
))
if
(
jupyterLinks
.
length
)
{
jupyterLinks
.
forEach
(
item
=>
{
const
url
=
item
.
innerHTML
if
(
url
.
includes
(
'
.ipynb
'
))
createApp
(
App
,
{
url
}).
mount
(
item
)
})
};
})
if
(
jupyterLinks
.
length
)
{
jupyterLinks
.
forEach
(
item
=>
{
const
url
=
item
.
innerHTML
if
(
!
url
.
includes
(
'
.ipynb
'
))
return
const
targetEL
=
document
.
createElement
(
'
div
'
)
item
.
parentElement
?.
insertBefore
(
targetEL
,
item
)
item
.
style
.
display
=
'
none
'
createApp
(
App
,
{
url
}).
mount
(
targetEL
)
})
};
// })
vite.config.ts
浏览文件 @
7e53a074
...
...
@@ -3,6 +3,7 @@ import { defineConfig } from 'vite'
import
path
from
'
path
'
export
default
defineConfig
({
base
:
'
./
'
,
plugins
:
[
vue
()],
resolve
:
{
alias
:
{
...
...
@@ -17,6 +18,15 @@ export default defineConfig({
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
)
}
}
},
build
:
{
rollupOptions
:
{
output
:
{
entryFileNames
:
'
assets/[name].js
'
,
chunkFileNames
:
'
assets/[name].js
'
,
assetFileNames
:
'
assets/[name].[ext]
'
}
}
}
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录