diff options
author | Herbert <github@prinsherbert.nl> | 2017-02-07 22:18:11 +0100 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2017-02-07 16:18:11 -0500 |
commit | 9af0dd23dd6afc9b4103a8aeb17e6eba1c649f6c (patch) | |
tree | 7859855f3bfbdb476b570caa20ff7e4c74f97e1a /routers/repo | |
parent | 39eb6df769909c91a6a70b8ec1346daf67f54ee6 (diff) |
Ipython notebook support (#4070)
* added marked and notebookjs javascript libraries
* added ipython notebook render support using javascript libraries
* recompiled gogs.css to include ipynb-related css
* removed superflous javascript library files
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/view.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index 18c79e08..06e922ed 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -156,6 +156,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st ctx.Data["IsMarkdown"] = isMarkdown ctx.Data["ReadmeExist"] = isMarkdown && markdown.IsReadmeFile(blob.Name()) + ctx.Data["IsIPyNB"] = strings.HasSuffix(blob.Name(), ".ipynb") + if isMarkdown { ctx.Data["FileContent"] = string(markdown.Render(buf, path.Dir(treeLink), ctx.Repo.Repository.ComposeMetas())) } else { |