Total Pageviews

Saturday 24 April 2021

静态文件服务器程序mdserver

 登陆linux vps.安装go环境,然后,

git clone https://github.com/artyom/mdserver mdserver-by-artyom

cd mdserver-by-artyom

go install

(可执行文件mdserver就会出现在$GOPATH/bin/里面)

cd ~

mdserver -h

会显示:

Usage of mdserver:

  -addr string

    address to listen (default "localhost:8080")

  -css string

    path to custom CSS file (embedded into page unless run with -csslink)

  -csslink

    treat -css argument as local href inside <link rel=stylesheet>

  -dir string

    directory with markdown (.md) files (default ".")

  -github

    rewrite github wiki links to local when rendering

  -hljs

    syntax-highlight code blocks with defined language using highlight.js

  -open

    open index page in default browser on start

  -rootindex

    render autogenerated index at / in addition to /?index

  -search

    enable substring search


运行:

 mdserver -addr :7070


在本地机器的浏览器里访问http://vps-public-ip:7070 


项目地址:https://github.com/artyom/mdserver

No comments:

Post a Comment