aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-04-07 22:33:19 -0400
committerUnknwon <u@gogs.io>2017-04-07 22:33:19 -0400
commit6ebdf91b327313a0d258ee473b5da5314377e348 (patch)
tree7fcca8f9db8fed71f4f6b2115e7d69d48453e29a /templates
parent91cd350b631f721d1d6dd38bbafd3cac612e53c6 (diff)
templates/repo: fix README.ipynb not rendered (#4367)
Diffstat (limited to 'templates')
-rw-r--r--templates/.VERSION2
-rw-r--r--templates/base/head.tmpl2
-rw-r--r--templates/repo/view_file.tmpl37
3 files changed, 21 insertions, 20 deletions
diff --git a/templates/.VERSION b/templates/.VERSION
index d00fae39..caa02f19 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.11.7.0407 \ No newline at end of file
+0.11.8.0407 \ No newline at end of file
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 71551ac7..1f967f0e 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -47,7 +47,7 @@
<link rel="stylesheet" href="{{AppSubURL}}/assets/octicons-4.3.0/octicons.min.css">
<!-- notebook.js for rendering ipython notebooks and marked.js for rendering markdown in notebooks -->
- {{if .IsIPythonNotebook }}
+ {{if .IsIPythonNotebook}}
<script src="{{AppSubURL}}/plugins/notebookjs-0.2.6/notebook.min.js"></script>
<script src="{{AppSubURL}}/plugins/marked-0.3.6/marked.min.js"></script>
{{end}}
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 92bd7139..b8d6c1e4 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -36,28 +36,29 @@
{{end}}
</h4>
<div class="ui attached table segment">
- <div id="{{if .IsIPythonNotebook}}ipython-notebook{{end}}" class="file-view {{if .IsMarkdown}}markdown{{else if .ReadmeInList}}plain-text{{else if .IsIPythonNotebook}}ipython-notebook1{{else if and .IsTextFile}}code-view{{end}} has-emoji">
- {{if or .IsMarkdown .ReadmeInList}}
+ <div id="{{if .IsIPythonNotebook}}ipython-notebook{{end}}" class="file-view {{if .IsMarkdown}}markdown{{else if .IsIPythonNotebook}}ipython-notebook{{else if .ReadmeInList}}plain-text{{else if and .IsTextFile}}code-view{{end}} has-emoji">
+ {{if .IsMarkdown}}
{{if .FileContent}}{{.FileContent | Str2html}}{{end}}
{{else if .IsIPythonNotebook}}
- {{if .FileContent}}
- <script>
- var rendered = null;
- $.getJSON("{{.RawFileLink}}", null, function(notebook_json) {
- var notebook = nb.parse(notebook_json);
- rendered = notebook.render();
- $("#ipython-notebook").append(rendered);
- $("#ipython-notebook code").each(function(i, block) {
- $(block).addClass("py").addClass("python");
- hljs.highlightBlock(block);
- });
+ <script>
+ var rendered = null;
+ console.log("fuck")
+ $.getJSON("{{.RawFileLink}}", null, function(notebook_json) {
+ var notebook = nb.parse(notebook_json);
+ rendered = notebook.render();
+ $("#ipython-notebook").append(rendered);
+ $("#ipython-notebook code").each(function(i, block) {
+ $(block).addClass("py").addClass("python");
+ hljs.highlightBlock(block);
+ });
- $("#ipython-notebook .nb-markdown-cell").each(function(i, markdown) {
- $(markdown).html(marked($(markdown).html()));
- });
+ $("#ipython-notebook .nb-markdown-cell").each(function(i, markdown) {
+ $(markdown).html(marked($(markdown).html()));
});
- </script>
- {{end}}
+ });
+ </script>
+ {{else if .ReadmeInList}}
+ {{if .FileContent}}{{.FileContent | Str2html}}{{end}}
{{else if not .IsTextFile}}
<div class="view-raw ui center">
{{if .IsImageFile}}