Git Product home page Git Product logo

markup's Introduction

Markup - 微型Markdown文档服务器

Markdown静态文档服务器,提供内容目录、搜索功能

所有文档都缓存在内存中,针对少量文档(博客、接口文档)场景优化

部署

方式1. 下载markup.jar,命令行启动

java -jar markup.jar
# 根据提示输入
git: https://github.com/canghailan/notes.git # Git仓库地址

方式2. docker

version: '2'

services:
  markup:
    image: registry.cn-hangzhou.aliyuncs.com/yitong/markup
    environment:
      - 'MARKUP_GIT=https://github.com/canghailan/notes.git' # Git仓库地址

启动后,通过 http://localhost 即可访问,默认UI仅提供文件浏览、搜索功能,建议在Git仓库中提供index.html覆盖默认UI

配置

方式1. markup.yml文件配置

配置文件与markup.jar放在同一目录下

markup.jar
markup.yml

配置项:

git: https://github.com/canghailan/notes.git
port: 80 # 可选,默认80

方式2. 环境变量配置

MARKUP_GIT
MARKUP_PORT

方式3. 交互配置

java -jar markup.jar
git:

启动后将会自动保存到 markup.yml

接口

首页

GET /

或者

GET /index.html

文件

与版本库文件路径一致

GET /**/*.*

目录(Table Of Content)

GET /.toc

全文搜索

搜索参数:

  • p 目录
  • q 关键词,有关键词结果按相关性排序,无关键词结果按文件创建时间倒序排序
  • n 分页大小
  • c 分页标识

搜索结果:

  • list 搜索数据
  • cursor 分页标识,null表示已到最后一页

第一次请求

GET /.s?p=&q=&n=

{
  "list": [],
  "cursor": "CURSOR"
}

翻页

GET /.s?c=CURSOR

{
  "list": [],
  "cursor": ""
}

更新,支持Webhook

GET /.updater

或者

POST /.updater

依赖

License

MIT

预览

screenshot

markup's People

Contributors

canghailan avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.