Markdoc is a lightweight Markdown-based wiki system. It’s been designed to allow you to create and manage wikis as quickly and easily as possible.
Potential use cases for Markdoc include, but aren’t limited to:
Technical Documentation/Manuals Markdoc can be used to write and render hand-written guides and manuals for software. Such documentation will normally be separate from automatically-generated API documentation, and might give a higher-level view than API docs alone. It might be used for client documentation for web/desktop applications, or even developer documentation for frameworks.
Internal Project Wikis Markdoc wikis consist of a single plain-text file per page. By combining a wiki with a DVCS (such as Mercurial or Git), you can collaborate with several other people. Use the DVCS to track, share and merge changes with one another, and view the wiki’s history.
Set up Google Analytics tracking in one line of configuration.
Barebones wikis that just look like directories with Markdown-formatted text files in them.
A built-in HTTP server and WSGI application to serve up a compiled wiki with a single command.
Continuous builds (via rsync
) mean the server can keep running whilst
Markdoc re-compiles the wiki. Just refresh your browser to see the changes.
Add Pygments-powered syntax highlighting to your Markdoc wiki with a single configuration parameter.
Markdoc is public domain software. It will always be completely free to use, and you can redistribute it (in part or in whole) under any circumstances (open-source, proprietary or otherwise) with no attribution or encumberances.
The minimum requirements to run the Markdoc utility are:
请保证您的操作系统上安装rsync并且在系统路径中,否则markdoc build时会报错,如下:
raise child_exception
OSError: [Errno 2] No such file or directory
$ pip install https://github.com/azhai/markdoc/tarball/master #OR
$ pip install https://gitcafe.com/azhai/markdoc/tarball/master #OR
$ pip install https://git.oschina.net/azhai/markdoc/tarball/master
markdoc init my-wiki
cd my-wiki/
vim wiki/somefile.md
# ... write some documentation ...
markdoc build
markdoc serve
# .. open http://localhost:8008/ in a browser ...
date: 2012-05-15
title: Python计算文件的MD5
category: Python
tag: python, md5, hash
下面两个函数,一个用于计算字符串的MD5,另一个用于计算指定文件的MD5
:::python
#-*- coding: utf-8 -*-
import hashlib
def md5hex(word):
""" MD5加密算法,返回32位小写16进制符号 """
if isinstance(word, unicode):
word = word.encode("utf-8")
elif not isinstance(word, str):
word = str(word)
m = hashlib.md5()
m.update(word)
return m.hexdigest()
def md5sum(fname):
""" 计算文件的MD5值 """
def read_chunks(fh):
fh.seek(0)
chunk = fh.read(8096)
while chunk:
yield chunk
chunk = fh.read(8096)
else: #最后要将游标放回文件开头
fh.seek(0)
m = hashlib.md5()
if isinstance(fname, basestring) \
and os.path.exists(fname):
with open(fname, "rb") as fh:
for chunk in read_chunks(fh):
m.update(chunk)
#上传的文件缓存 或 已打开的文件流
elif fname.__class__.__name__ in ["StringIO", "StringO"] \
or isinstance(fname, file):
for chunk in read_chunks(fname):
m.update(chunk)
else:
return ""
return m.hexdigest()
# Metadata
wiki-name: "xxx's Blog"
wiki-author: "xxx"
#google-analytics: UA-XXXXXX-X
# Directories
hide-prefix: ""
wiki-dir: "content"
static-dir: "static"
html-dir: "html"
template-dir: ""
temp-dir: ".tmp"
cvs-exclude: true
# Building
document-extensions: [.md, .rst]
generate-listing: always
listing-filename: "default.html"
use-default-static: true
use-default-templates: true
disqus-sitename: "xxx-disqus"
# Rendering
markdown:
safe-mode: false
output-format: xhtml1
extensions: [meta, codehilite, def_list, sane_lists, toc]
extension-configs:
codehilite:
css_class: codehilite
force_linenos: true
# Serving
server:
bind: '192.168.0.1'
port: 8008
num-threads: 10
#name: 'myblog.github.com'
request-queue-size: 5
timeout: 10
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to http://unlicense.org/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型