惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
V
Visual Studio Blog
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 叶小钗
I
InfoQ
B
Blog RSS Feed
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
IT之家
IT之家
P
Proofpoint News Feed
WordPress大学
WordPress大学
小众软件
小众软件
B
Blog
MongoDB | Blog
MongoDB | Blog
人人都是产品经理
人人都是产品经理
量子位
Hugging Face - Blog
Hugging Face - Blog
月光博客
月光博客

OhYee 博客

小鹏辅助驾驶测评|OhYee 博客 小鹏非支持手机开启自动解锁|OhYee 博客 使用函数计算实现 301 重定向|OhYee 博客 针对 HTML 内容使用 Ant Design 图片弹框|OhYee 博客 博客进程泄露及僵尸进程解决|OhYee 博客 蓝易云服务器体验|OhYee 博客 SSH 调起本地 VSCode|OhYee 博客 【2022 秋招内推】阿里云后端研发工程师|OhYee 博客 使用函数计算获取 IP 地址信息|OhYee 博客 正确获取客户端 IP/HTTP Header 也可能重复|OhYee 博客 评测 Oculus Quest2 及 BigScreen|OhYee 博客 NextJS 热重载保留状态|OhYee 博客 如何优雅地贴 gist 代码|OhYee 博客 Linux 精细化文件权限|OhYee 博客 VSCode 容器开发环境|OhYee 博客 Clash 的不兼容更新排查|OhYee 博客 Zeek 导出 PCAP|OhYee 博客 记一次 ssh 配置问题|OhYee 博客 Git Commit 规范化工具|OhYee 博客 谈谈《星之卡比-探索发现》|OhYee 博客 VSCode 快捷键绑定 Shell 命令|OhYee 博客 ASN.1 语法及 X.509 证书格式解析解析|OhYee 博客 腾讯企业邮箱忽略 MX 记录发信|OhYee 博客 Chrome/Edge 标签组插件|OhYee 博客 【应届内推】阿里云后端研发工程师|OhYee 博客 损坏的 Typecho 备份处理为 JSON|OhYee 博客 VS Code VIM 插件高效使用|OhYee 博客 SSH 正反向代理|OhYee 博客 Let's Encrypt 根证书过期引发的问题|OhYee 博客 OpenWRT 忽略内核依赖|OhYee 博客
Gitea 添加 jupyter 支持|OhYee 博客
2021-10-04 · via OhYee 博客

Gitea 添加 jupyter 支持

论文的部分代码需要用到 jupyter,但是 Gitea 本身不像 Github 那样支持 jupyter notebook 的渲染
因此,需要为其添加 jupyter 支持

官网已经有了对应的教程: External renderers - Docs
但可惜的是没有对应的镜像

因此对照对应的内容,编译一个支持 jupyter 的 Gitea 镜像
(如果有需要,可以直接使用 ohyee/gitea:latest

2021-12-31 更新,添加了 curl 依赖

ARG TAG=latest
FROM gitea/gitea:${TAG}

RUN sed -i 's/https/http/' /etc/apk/repositories && \
    apk add curl && \
    apk --no-cache add \
    asciidoctor \
    freetype \
    freetype-dev \
    gcc \
    g++ \
    libpng \
    libffi-dev \
    py-pip \
    python3-dev \
    py3-pip \
    py3-pyzmq

RUN pip3 install --upgrade pip && \
    pip3 install -U setuptools && \
    pip3 install jupyter docutils

每次有新的版本,只需要执行下面的脚本

#!/bin/bash

export TAG=1.15.3

docker build --build-arg TAG=${TAG} -t ohyee/gitea:${TAG} . && \
docker tag ohyee/gitea:${TAG} ohyee/gitea:latest
docker push ohyee/gitea:${TAG}
docker push ohyee/gitea:latest

除此之外,在 gitea/conf/app.ini 中还需要添加

[markup.jupyter]
ENABLED = true
FILE_EXTENSIONS = .ipynb
RENDER_COMMAND = "jupyter-nbconvert --stdin --stdout --to html --template basic"

[markup.sanitizer.jupyter.img]
ALLOW_DATA_URI_IMAGES = true