Giter VIP home page Giter VIP logo

markdoc's Introduction

Markdoc

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.

What is it good for?

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.

  • Static Site Generation
    Markdoc converts wikis into raw HTML files and media. This allows you to manage a blog, personal website or a collection of pages in a Markdoc wiki, perhaps with custom CSS styles, and publish the rendered HTML to a website. Markdoc need not be installed on the hosting site, since the resultant HTML is completely independent.

Cool Features

  • 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.

Quickstart

Requirements

The minimum requirements to run the Markdoc utility are:

  • Python 2.4 or later (2.5+ highly recommended)
  • A UNIX (or at least POSIX-compliant) operating system
  • rsync -- installed out of the box with most modern OSes, including Mac OS X and Ubuntu. In the future Markdoc may include a pure-Python implementation.

Installation

$ easy_install Markdoc  # OR
$ pip install Markdoc

Making a Wiki

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 ...

(Un)license

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/

markdoc's People

Contributors

zacharyvoase avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

markdoc's Issues

Loading directory meta information from file

Just like extracting the title from wiki pages as the HTML title, I want to have a special file in a directory to provide meta information of this directory.

something like this:

| 
`-- directory_name
    `-- .meta

in system/.meta file:

title: "This_is_used_when_link_to_this_directory"
descrpiton: "We can display this text in the directory's index.html page, make this index page more informative"

Responsive Layout

It needs a responsive layout like bootstrap or something else. Today is unacceptable a document not to be accessible everywhere ;)

markdoc build deletes .htaccess file

I hope I'm not misinterpreting here, but it seemed to me like invoking markdoc build would remove potentially created .htaccess files in the .html output directory.

This was a bit confusing to me when I read this tip.

All went well in the end, I just configured it directly in the profile for the virtual host :)

ImportError: No module named wsgiserver2

What seems to be the problem here?
Just installed (via easy_install and then through also through pip), run "markdoc init my-wiki", entered the directory and neither "markdoc build" nor "markdoc serve" work.
This is the message on running "markdoc serve":

c:\temp_a\my-wiki>markdoc serve
Traceback (most recent call last):
File "c:\programs\dev\Python27\Scripts\markdoc-script.py", line 9, in
load_entry_point('markdoc==0.6.6', 'console_scripts', 'markdoc')()
File "C:\programs\dev\Python27\lib\site-packages\markdoc-0.6.6-py2.7.egg\markdoc\cli\main.py", line 38, in main
return command(config, args)
File "C:\programs\dev\Python27\lib\site-packages\markdoc-0.6.6-py2.7.egg\markdoc\cli\commands.py", line 29, in wrapper
return function(config, args)
File "C:\programs\dev\Python27\lib\site-packages\markdoc-0.6.6-py2.7.egg\markdoc\cli\commands.py", line 341, in serve
server = config.server_maker()(app)
File "C:\programs\dev\Python27\lib\site-packages\markdoc-0.6.6-py2.7.egg\markdoc\server.py", line 27, in server_maker
from cherrypy.wsgiserver import CherryPyWSGIServer
File "C:\programs\dev\Python27\lib\site-packages\cherrypy-3.2.5-py2.7-win-amd6
4.egg\cherrypy\wsgiserver__init__.py", line 11, in
from wsgiserver2 import *
ImportError: No module named wsgiserver2

c:\temp_a\my-wiki>

Sync-html command doesn't sync listing or index files

The sync-html command should sync everything inside your temp folder to HTML root. However, it doesn't sync the listing or index files to HTML root.

This is because the build_listing method puts the files directly into the HTML root. Instead, it should put them in the temp folder, and have the sync_html method sync those over to the HTML root. Once this change is made, lines 270 and 271 should be flip-flopped in the build method in commands.py.

Exception on 404

I get the following response when I request a page that does not exist:

Traceback (most recent call last):
File "/Users/jonathan/.virtualenvs/wiki/lib/python2.7/site-packages/cherrypy/wsgiserver/init.py", line 1245, in communicate
req.respond()
File "/Users/jonathan/.virtualenvs/wiki/lib/python2.7/site-packages/cherrypy/wsgiserver/init.py", line 775, in respond
self.server.gateway(self).respond()
File "/Users/jonathan/.virtualenvs/wiki/lib/python2.7/site-packages/cherrypy/wsgiserver/init.py", line 2018, in respond
response = self.req.server.wsgi_app(self.env, self.start_response)
File "/Users/jonathan/.virtualenvs/wiki/lib/python2.7/site-packages/markdoc/wsgi.py", line 53, in call
response = self.get_response(request)
File "/Users/jonathan/.virtualenvs/wiki/lib/python2.7/site-packages/markdoc/wsgi.py", line 65, in get_response
return self.file(request)
File "/Users/jonathan/.virtualenvs/wiki/lib/python2.7/site-packages/markdoc/wsgi.py", line 117, in file
return self.not_found(request)
File "/Users/jonathan/.virtualenvs/wiki/lib/python2.7/site-packages/markdoc/wsgi.py", line 173, in
not_found = lambda self, request: self.error(request, 404)
File "/Users/jonathan/.virtualenvs/wiki/lib/python2.7/site-packages/markdoc/wsgi.py", line 161, in error
context['reason'] = webob.statusreasons.status_reasons[status]
AttributeError: 'module' object has no attribute 'statusreasons'

I'm currently using webob 1.0.7. It seems that webob.status_reasons has been moved to the util module.

Increase default page width

If I may, I would suggest that the default template's body width could perhaps be slightly increased. Right now, e.g. http://markdoc.org/ looks really (too) tiny on a decent-sized screen. The http://unlicense.org/ template, by contrast, looks rather more readable; I don't recall whether I adjusted that myself, or whether the default template back in the day used to be wider.

HTML tags <sup> and <sub> switched

The CSS provided after building a markdoc site switch the position of <sub> and <sup> text in Safari 8 on OS X Yosemite. Using the opposite tag puts the text in the correct location.

More RDFa page metadata

Looking over the Meta-Data extension for the Markdown implementation you're using, it occurs to me that it would be possible to have a number of important RDFa metadata attributes -- the key three being dc:title, dc:created, and dc:creator -- specified inline in the Markdown page source itself. Just a thought.

Excluding static files?

Is there a way to exclude certain static files being synced, using wildcard matching for example?

An issue I've been seeing is that if I e.g. edit my robots.txt, my editor will leave a robots.txt~ backup file lying around; as I'm sure you know, this is a fairly common convention in shell-based editors. Unfortunately, that backup file then gets copied to .html/robots.txt~ when I do a markdoc build. Not that it's a huge problem, but it is a little annoying.

If the build process ignored ~ files, that'd solve the specific issue above. But even more useful (if wishes were horses) would be the ability to exclude patterns of files, including then "*~". This would come very handy in repositories where the static files are located directly on the top level, meaning that some extraneous non-static files get copied in the build process as well, particularly README.md and Rakefile in my typical use cases.

I bet you've already thought of this, and I have just overlooked it in the documentation ;-)

Handling of missing rsync executable

When rsync is missing on the system, markdoc build exits with a fairly cryptic stacktrace:

Traceback (most recent call last):
  File "/usr/bin/markdoc", line 9, in <module>
    load_entry_point('Markdoc==0.6.6', 'console_scripts', 'markdoc')()
  File "/usr/lib/python2.7/site-packages/markdoc/cli/main.py", line 38, in main
    return command(config, args)
  File "/usr/lib/python2.7/site-packages/markdoc/cli/commands.py", line 29, in wrapper
    return function(config, args)
  File "/usr/lib/python2.7/site-packages/markdoc/cli/commands.py", line 271, in build
    sync_html(config, args)
  File "/usr/lib/python2.7/site-packages/markdoc/cli/commands.py", line 29, in wrapper
    return function(config, args)
  File "/usr/lib/python2.7/site-packages/markdoc/cli/commands.py", line 239, in sync_html
    subprocess.check_call(command)
  File "/usr/lib/python2.7/subprocess.py", line 536, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 523, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I think it would help a lot of people if markdoc would check on the availability of rsync first and error if it's not available.

Confusing error message if `rsync` is not installed

On Windows, running Markdoc without rsync installed causes the following confusing error message to be displayed:

PS C:\Users\lws\Documents\GitHub\morrowind-dnd3.5> markdoc build
Traceback (most recent call last):
  File "C:\Python27\Scripts\markdoc-script.py", line 9, in <module>
    load_entry_point('Markdoc==0.6.6', 'console_scripts', 'markdoc')()
  File "C:\Python27\lib\site-packages\markdoc\cli\main.py", line 38, in main
    return command(config, args)
  File "C:\Python27\lib\site-packages\markdoc\cli\commands.py", line 29, in wrapper
    return function(config, args)
  File "C:\Python27\lib\site-packages\markdoc\cli\commands.py", line 270, in build
    sync_html(config, args)
  File "C:\Python27\lib\site-packages\markdoc\cli\commands.py", line 29, in wrapper
    return function(config, args)
  File "C:\Python27\lib\site-packages\markdoc\cli\commands.py", line 238, in sync_html
    subprocess.check_call(command)
  File "C:\Python27\lib\subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Python27\lib\subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

If we run with the --verbose option we can see this is just after the Markdoc attempts to call rsync which is not installed.

markdoc.sync-html: DEBUG: rsync -vaxq --cvs-exclude --delete --ignore-errors --include=.htaccess --exclude=.* --exclude=_* .tmp/ default-static/ static/ .html/

Markdoc should trap this exception and produce a more useful error message, such as OSError: rsync not installed or could not be found.


Actually it's even worse than this; I do have rsync installed (via cwRsync) but Python can't find it. This is a Windows specific bug. The problem is at commands.py:238 where subprocess.check_call() is called with the default argument of shell=False. To quote from Walter Mundt's StackOverflow answer - "Also, on Windows with shell=False, it pays no attention to PATH at all, and will only look in relative to the current working directory". So even though rsync is on my path, Python on Windows can't find it.

TOC output improvement

There's a bit of an issue with being able to effectively use the TOC extension with Markdoc: the TOC output includes the h1-level header used as the Markdoc page title, which goes against the principle of least surprise. This means in practice that the TOC output is a little uselessly redundant, since Markdoc pages are not likely to have more than one h1. If one places the TOC directly after the page title, the redundancy really pokes one in the eye.

In case there exists some way to specify that the TOC output should only include h2-level headers and their children, that'd be fantastic. I realize this isn't really a Markdoc issue per se, but one concerning the TOC extension. However, perhaps Markdoc has some degree of control here internally, within which scope the output could be remedied? I can't really imagine that when using the TOC extension with Markdoc anyone could want the h1-level titles as part of the TOC, so it wouldn't even need to be configurable.

Strikethrough not supported?

Even though there is an option in Markdown (presented in February 2014) to strike through the text, it seems that markdoc is not supporting it currently.

So:

~~text~~

should return the text with a strike through (like this one).

An "edit" link on markdoc pages?

A wiki isn't really a wiki unless the rendered pages (can) have an edit link. A markdown-format wiki is exactly what I'm after, but I'd like to be able to add / edit content via my web browser, and not just the command line. Or is this there, and I just missed it (after reading all the documentation)?

pkg_resources.DistributionNotFound: Pygments

I installed markdoc successfully in a Debian server, but failed on running markdoc command. it report below error:

root@aFEWS:~# markdoc
Traceback (most recent call last):
  File "/usr/local/bin/markdoc", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: Pygments

My server environment:

  • OS
    root@aFEWS:~# uname -a
    Linux aFEWS 3.2.0-4-amd64 #1 SMP Debian 3.2.63-2+deb7u1 x86_64 GNU/Linux
    root@aFEWS:~# python -V
    Python 2.7.3
  • python installed pkgs:
root@aFEWS:~# pip freeze
ansible==1.8.2
chardet==2.0.1
CherryPy==3.6.0
ecdsa==0.11
fpconst==0.7.2
Jinja2==2.7.3
Markdoc==0.6.6
Markdown==2.5.2
MarkupSafe==0.23
paramiko==1.15.2
pycrypto==2.6.1
Pygments==2.0.2
python-apt==0.8.8.2
python-debian==0.1.21
python-debianbts==1.11
PyYAML==3.11
reportbug==6.4.4
SOAPpy==0.12.0
WebOb==1.4

Can't use Anchors in Pages

links of the form [/foo/bar#drek] don't work. Markdoc doesn't recognize this as an attempt to link to an anchor (hand entered via HTML) on page /foo/bar. This is not exactly earth-shaking but I was trying to use anchors to take readers to one of many items on a bibliography page or to something buried on a longer text-page.

Thanks ... love markdoc!

Implementing search feature

Is there a possibility to implement search feature in markdoc?

A searchbar at the top that will search all the markdown files. A simple line-based search is fine.

Revision control?

I have looked around but couldn't find anything about it. Markdoc is labeled as a wiki but I don't seem to be able and see a way to edit a page via the browser and further more see the history of page changes. Am I missing something?

How to modify defult site look and feel ?

Hi

I'd like to modify the default CSS to have a larger space for my content.
Where can i find the default CSS sothat each time i will create a site and build it i will have my custom modification ?

Regards

Error during build with group user

Hi.
I discovered strange behavior while using Markdoc. I'm not expert on Unix system, but it makes me can't use Markdoc as I expected. Please read this issue and let me know what the problem is :(

I was trying to configure Markdoc to use with group account.
I configured Markdoc and set its repository being owned by a new user:group markdoc:markdoc.
I pushed all users who will use Markdoc into markdoc group. And last, I set the repository directory permission like this.

find . -type d -exec chmod ug+wrxs {} \;  
find . -type f -exec chmod ug+wr-xs {} \;

It worked properly, before I run markdoc build with other user account rather than markdoc itself.

rsync: failed to set times on "/srv/markdoc/var/.html/.": Operation not permitted (1)
rsync: failed to set times on "/srv/markdoc/var/.html/media": Operation not permitted (1)
rsync: failed to set times on "/srv/markdoc/var/.html/media/css": Operation not permitted (1)
rsync: failed to set times on "/srv/markdoc/var/.html/media/sass": Operation not permitted (1)
rsync: failed to set times on "/srv/markdoc/var/.html/project": Operation not permitted (1)
rsync: failed to set times on "/srv/markdoc/var/.html/project/gigaknight-system-prototyping": Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1060) [sender=3.0.7]
Traceback (most recent call last):
  File "/usr/local/bin/markdoc", line 9, in <module>
    load_entry_point('Markdoc==0.6.6', 'console_scripts', 'markdoc')()
  File "/usr/local/lib/python2.6/dist-packages/markdoc/cli/main.py", line 38, in main
    return command(config, args)
  File "/usr/local/lib/python2.6/dist-packages/markdoc/cli/commands.py", line 29, in wrapper
    return function(config, args)
  File "/usr/local/lib/python2.6/dist-packages/markdoc/cli/commands.py", line 270, in build
    sync_html(config, args)
  File "/usr/local/lib/python2.6/dist-packages/markdoc/cli/commands.py", line 29, in wrapper
    return function(config, args)
  File "/usr/local/lib/python2.6/dist-packages/markdoc/cli/commands.py", line 238, in sync_html
    subprocess.check_call(command)
  File "/usr/lib/python2.6/subprocess.py", line 498, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['rsync', '-vaxq', '--cvs-exclude', '--delete', '--ignore-errors', '--include=.htaccess', '--exclude=.*', '--exclude=_*', '/srv/markdoc/var/.tmp/', '/usr/local/lib/python2.6/dist-packages/markdoc/static/default-static/', '/srv/markdoc/var/static/', '/srv/markdoc/var/.html/']' returned non-zero exit status 23

I googled and found some opinions it could be a problem of rsync.

This was my final approach to figure out what the problem is. What should I do to make it work?

Error when accessing rendered files with file://...

I would like to be able to build a set of linked html files locally readable without a server. I can individually open the pages as

file://~/html/index.html  

but any links do not work as they are missing the .html extension. I know servers will add the extension as required (and the index.html if address ends in "/"). Would it be possible to add an option to include the extension on build?

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.