diff --git a/.gitignore b/.gitignore index 0d20b64..cec05fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ *.pyc +build/ +dist/ +zippydoc.egg-info/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..c011d97 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include src/zippydoc/data/* diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..920e824 --- /dev/null +++ b/setup.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python + +""" +distutils/setuptools install script. See inline comments for packaging documentation. +""" + +import os +import sys + +try: + from setuptools import setup + # hush pyflakes + setup +except ImportError: + from distutils.core import setup + +try: + from distutils.command.build_py import build_py_2to3 as build_py +except ImportError: + from distutils.command.build_py import build_py + +packages = ['zippydoc'] + +package_dir = {"zippydoc": "src/zippydoc"} + +package_data = {"zippydoc": ["data/template.html"]} + +scripts = [ + 'zpy2html' +] + +print repr(package_data) + +setup( + name='zippydoc', + version='1.0', + maintainer='Sven Slootweg', + maintainer_email='admin@cryto.net', + description='Documentation markup language and library, including HTML converter.', + url='http://www.cryto.net/zippydoc', + packages=packages, + package_dir=package_dir, + package_data=package_data, + include_package_data=True, + scripts=scripts, + install_requires=['argparse'], + cmdclass={'build_py': build_py} +) + diff --git a/site/documentation.html b/site/documentation.html new file mode 100644 index 0000000..1110b69 --- /dev/null +++ b/site/documentation.html @@ -0,0 +1,285 @@ + + +
+ + + +^ my_function(**argument**, **another_argument**) + + Some kind of text describing the function goes here. `Also some mono-spaced text.` + + ! Only ever use this function with the number '42'! + + argument:: + This is the first argument to this example function. + + another_argument:: + This is the second argument to this example function. + As you can see, it's possible to split the explanation over multiple lines as well. + We can also add an {>documentation}(internal link) and an {http://google.com/}(external link). + + @ Using this function + + $ if some_variable == True: + + $$ my_function(42, "The answer to everything") + + > The answer to everything is 42! + + >> Did you know The answer to everything is 42?
if some_variable == True: + + my_function(42, "The answer to everything")
The answer to everything is 42! + + Did you know The answer to everything is 42?
^ my_function(argument1, argument2) + + ! This is just an example! + + This is a function. + + argument1:: + This is the first argument. + + argument2:: + This is the second argument. + + @ How to call my_function + + $ my_function("ZippyDoc", "awesome") + + > "ZippyDoc is awesome!"
%s' % self.escape_html(text) + + def transform_output(self, text): + return '
%s' % self.escape_html(text) + + def transform_exclamation(self, text, children): + return '
%s' % self.fix_preformatted(self.data) - -class Output(TreeLevel): - def render(self): - return '
%s' % self.fix_preformatted(self.data) - -class Definition(TreeLevel): - def get_anchor(self): - first = self.clear_markup(self.data.splitlines()[0]) - anchor = first.replace("...", "") - anchor = anchor.replace(".", "_") - anchor = re.sub("[^a-zA-Z0-9_]", "", anchor) - return anchor - - def get_description(self): - for element in self.elements: - if element.__class__.__name__ == "Text": - data = self.process_inline_markup(element.data) - - if len(data) > 80: - matches = re.match("^(.{0,80})\W", data) - return matches.group(1) + "..." - else: - return data - - return "" - - def render(self): - return '' % (self.get_anchor(), self.process_inline_markup(self.data.replace("\n", "