forked from jessevdk/cldoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
124 lines (98 loc) · 3.19 KB
/
Copy pathsetup.py
File metadata and controls
124 lines (98 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env python
from setuptools import setup, Command
import subprocess, os, shutil, glob
coffee_files = [
'cldoc.coffee',
'page.coffee',
'sidebar.coffee',
'node.coffee',
'type.coffee',
'doc.coffee',
'category.coffee',
'enum.coffee',
'struct.coffee',
'class.coffee',
'namespace.coffee',
'typedef.coffee',
'variable.coffee',
'function.coffee',
'field.coffee',
'method.coffee',
'constructor.coffee',
'destructor.coffee',
'base.coffee',
'subclass.coffee',
'coverage.coffee',
'arguments.coffee',
'report.coffee',
'references.coffee',
'union.coffee'
]
class cldoc_generate(Command):
description = "generate css, js and html files"
user_options = [
('coffee=', None, 'path to coffeescript compiler'),
('sass=', None, 'path to sass compiler'),
('inliner=', None, 'path to inliner')
]
def initialize_options(self):
self.coffee = 'coffee'
self.sass = 'sass'
self.inliner = 'inliner'
def finalize_options(self):
pass
def run_coffee(self):
print('running {0}'.format(self.coffee))
for d in ('html/javascript', 'cldoc/data/javascript'):
try:
os.makedirs(d)
except:
pass
args = [self.coffee, '--bare', '--join', 'html/javascript/cldoc.js', '--compile']
files = ['html/coffee/' + x for x in coffee_files]
subprocess.call(args + files)
for js in glob.glob('html/javascript/*.js'):
shutil.copyfile(js, 'cldoc/data/javascript/' + os.path.basename(js))
def run_sass(self):
print('running {0}'.format(self.sass))
for d in ('html/styles', 'cldoc/data/styles'):
try:
os.makedirs(d)
except:
pass
args = [self.sass, '--scss', '--line-numbers', '--no-cache', '--style', 'compressed']
files = ['html/sass/cldoc.scss', 'html/styles/cldoc.css']
subprocess.call(args + files)
for css in glob.glob('html/styles/*.css'):
shutil.copyfile(css, 'cldoc/data/styles/' + os.path.basename(css))
def run_inliner(self):
print('running {0}'.format(self.inliner))
args = [self.inliner, 'html/index.html']
try:
os.makedirs('cldoc/data')
except:
pass
fout = file('cldoc/data/index.html', 'w')
proc = subprocess.Popen(args, stdout=fout)
proc.wait()
def run(self):
self.run_coffee()
self.run_sass()
self.run_inliner()
cmdclass = {
'generate': cldoc_generate
}
setup(name='cldoc',
version='1.2',
description='clang based documentation generator for C/C++',
author='Jesse van den Kieboom',
author_email='jessevdk@gmail.com',
url='http://jessevdk.github.com/cldoc',
license='GPLv2',
keywords=['clang', 'c++', 'documentation'],
packages=['cldoc', 'cldoc.clang', 'cldoc.nodes', 'cldoc.generators'],
scripts=['scripts/cldoc'],
package_data={'cldoc': ['data/*.html', 'data/javascript/*.js', 'data/styles/*.css']},
cmdclass=cmdclass,
install_requires=['pyparsing'])
# vi:ts=4:et