Browse Source

Reorganize source tree and add a setup script

develop
Sven Slootweg 9 years ago
parent
commit
b97cec6aaa
  1. 3
      .gitignore
  2. 1
      MANIFEST.in
  3. 49
      setup.py
  4. 0
      site/documentation.html
  5. 0
      site/documentation.zpy
  6. 0
      site/example.html
  7. 0
      site/example.zpy
  8. 2
      site/index.html
  9. 6
      site/index.zpy
  10. 0
      src/zippydoc/__init__.py
  11. 0
      src/zippydoc/block_markup.py
  12. 0
      src/zippydoc/data/template.html
  13. 0
      src/zippydoc/document.py
  14. 0
      src/zippydoc/transformation_ruleset.py
  15. 0
      src/zippydoc/value.py
  16. 11
      zpy2html

3
.gitignore

@ -1 +1,4 @@
*.pyc
build/
dist/
zippydoc.egg-info/

1
MANIFEST.in

@ -0,0 +1 @@
include src/zippydoc/data/*

49
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}
)

0
documentation.html → site/documentation.html

0
documentation.zpy → site/documentation.zpy

0
example.html → site/example.html

0
example.zpy → site/example.zpy

2
index.html → site/index.html

@ -172,6 +172,6 @@
$ my_function("ZippyDoc", "awesome")
&gt; "ZippyDoc is awesome!"</pre><h7>Result:</h7><div class="definition"><a name="my_functionargument1argument2">my_function(argument1, argument2) <div class="children"><div class="exclamation"><strong>Important:</strong> This is just an example! <div class="children"></div></div><div class="text">This is a function.</div><dl><dt>argument1</dt><dd>This is the first argument.<div class="children"></div></dd></dl><dl><dt>argument2</dt><dd>This is the second argument.<div class="children"></div></dd></dl><div class="example">Example: How to call my_function <div class="children"><h7>Code:</h7><pre class="code">my_function("ZippyDoc", "awesome")</pre><h7>Output:</h7><pre class="output">"ZippyDoc is awesome!"</pre></div></div></div></a></div><h2>Documentation</h2><div class="text">The documentation for ZippyDoc can be found <a href="documentation.html">here</a>.</div><h2>Downloading ZippyDoc</h2><div class="text">ZippyDoc is still in a pretty messy stage, but it should already work reliably according to the current documentation. GitHub repository is coming soon, until that time you can <a href="zpy2html.py">download the conversion script here</a>. It's a Python script, so you'll need a Python interpreter of some sort. No dependencies are necessary, it only uses standard library functionality. Simply run it with all files you wish to convert as arguments, and it will convert each of them into a file with the same name, but a <em>.html</em> extension instead of the original extension. It's strongly recommended to name your ZippyDoc source files with the <em>.zpy</em> extension.</div></div>
&gt; "ZippyDoc is awesome!"</pre><h7>Result:</h7><div class="definition"><a name="my_functionargument1argument2">my_function(argument1, argument2) <div class="children"><div class="exclamation"><strong>Important:</strong> This is just an example! <div class="children"></div></div><div class="text">This is a function.</div><dl><dt>argument1</dt><dd>This is the first argument.<div class="children"></div></dd></dl><dl><dt>argument2</dt><dd>This is the second argument.<div class="children"></div></dd></dl><div class="example">Example: How to call my_function <div class="children"><h7>Code:</h7><pre class="code">my_function("ZippyDoc", "awesome")</pre><h7>Output:</h7><pre class="output">"ZippyDoc is awesome!"</pre></div></div></div></a></div><h2>Documentation</h2><div class="text">The documentation for ZippyDoc can be found <a href="documentation.html">here</a>.</div><h2>Downloading ZippyDoc</h2><div class="text">ZippyDoc is now a PyPi package! To install it, make sure you have pip installed, and run <span class="fixed">pip install zippydoc</span>. You can then use the <span class="fixed">zpy2html</span> command anywhere, to convert your ZippyDoc source files to HTML. The GitHub repository can be found <a href="https://github.com/joepie91/ZippyDoc">here</a>.</div></div>
</body>
</html>

6
index.zpy → site/index.zpy

@ -56,7 +56,5 @@ The documentation for ZippyDoc can be found {>documentation}(here).
## Downloading ZippyDoc
ZippyDoc is still in a pretty messy stage, but it should already work reliably according to the current documentation. GitHub repository is coming soon, until that time you can
{<zpy2html.py}(download the conversion script here). It's a Python script, so you'll need a Python interpreter of some sort. No dependencies are necessary, it only uses standard
library functionality. Simply run it with all files you wish to convert as arguments, and it will convert each of them into a file with the same name, but a **.html** extension
instead of the original extension. It's strongly recommended to name your ZippyDoc source files with the **.zpy** extension.
ZippyDoc is now a PyPi package! To install it, make sure you have pip installed, and run `pip install zippydoc`. You can then use the `zpy2html` command
anywhere, to convert your ZippyDoc source files to HTML. The GitHub repository can be found {https://github.com/joepie91/ZippyDoc}(here).

0
zippydoc/__init__.py → src/zippydoc/__init__.py

0
zippydoc/block_markup.py → src/zippydoc/block_markup.py

0
template.html → src/zippydoc/data/template.html

0
zippydoc/document.py → src/zippydoc/document.py

0
zippydoc/transformation_ruleset.py → src/zippydoc/transformation_ruleset.py

0
zippydoc/value.py → src/zippydoc/value.py

11
zpy2html.py → zpy2html

@ -1,6 +1,15 @@
#!/usr/bin/env python
import os, argparse, sys, re
import zippydoc
import os
_ROOT = os.path.abspath(os.path.dirname(zippydoc.__file__))
def get_data(path):
return os.path.join(_ROOT, 'data', path)
parser = argparse.ArgumentParser(description='Converts ZippyDoc source files to HTML.')
parser.add_argument('files', metavar='FILE', type=str, nargs='+',
@ -93,7 +102,7 @@ class HtmlRuleset(zippydoc.TransformationRuleset):
files = options["files"]
template = open("template.html").read()
template = open(get_data("template.html")).read()
for zpy in files:
destination = os.path.splitext(zpy)[0] + ".html"
Loading…
Cancel
Save