|
| 1 | +<%! |
| 2 | +# D = DoxyDocs.D in DoxyDocs.py |
| 3 | +ret = '<br>' |
| 4 | +
|
| 5 | +def getParameters(parameters,detailed_doc): |
| 6 | + """ parameters |
| 7 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['parameters']={} |
| 8 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['parameters'] ['1']={} |
| 9 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['parameters'] ['1'] ['declaration_name'] = '''a''' |
| 10 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['parameters'] ['1'] ['type'] = '''int &''' |
| 11 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['parameters'] ['2']={} |
| 12 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['parameters'] ['2'] ['type'] = '''int &''' |
| 13 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['parameters'] ['2'] ['declaration_name'] = '''b''' |
| 14 | + # when it declare without name (for example, (const QCString &) ) , it does not have 'declaration_name' value |
| 15 | + D ['classes'] ['4'] ['private_methods'] ['members'] ['5'] ['parameters'] ['1'] ['type'] = '''const QCString &''' |
| 16 | + D ['classes'] ['4'] ['private_methods'] ['members'] ['5'] ['parameters'] ['1'] ['definition_name'] = '''name''' |
| 17 | + """ |
| 18 | + retParameters = [] |
| 19 | + for k,v in parameters.items(): |
| 20 | + if v.get('declaration_name',''): |
| 21 | + retParameters.append('{t} {d}'.format(t=v.get('type',''),d=v.get('declaration_name',''))) |
| 22 | + else: |
| 23 | + retParameters.append('{t} {d}'.format(t=v.get('type',''),d=v.get('definition_name',''))) |
| 24 | +
|
| 25 | + """ detailed_doc |
| 26 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['4'] ['params'] ['1'] ['doc'] ['1']={} |
| 27 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['4'] ['params'] ['1'] ['doc'] ['1'] ['type'] = '''text''' |
| 28 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['4'] ['params'] ['1'] ['doc'] ['1'] ['content'] = '''example of out ''' |
| 29 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['4'] ['params'] ['1'] ['parameters']={} |
| 30 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['4'] ['params'] ['1'] ['parameters'] ['1']={} |
| 31 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['4'] ['params'] ['1'] ['parameters'] ['1'] ['name'] = '''b''' |
| 32 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['4'] ['params'] ['1'] ['parameters'] ['1'] ['dir'] = '''out''' |
| 33 | + """ |
| 34 | + retIn = [] |
| 35 | + retOut = [] |
| 36 | + for k,v in detailed_doc.items(): # k = '4' |
| 37 | + for k2,v2 in v.items(): # k2 = 'params' |
| 38 | + if k2 == 'params': |
| 39 | + for k3,v3 in v2.items(): # k3 = '1' |
| 40 | + ldesc = getDescription(doc=v3.get('doc')) |
| 41 | + ldir = v3.get('parameters',{}).get('1',{}).get('dir','') |
| 42 | + lname = v3.get('parameters',{}).get('1',{}).get('name','') |
| 43 | + # lname is connected to 'declaration_name' of 'parameters' when it has no warning. |
| 44 | + if ldir.find('in') >= 0: |
| 45 | + retIn.append([lname,ldesc]) |
| 46 | + if ldir.find('out') >= 0: |
| 47 | + retOut.append([lname,ldesc]) |
| 48 | +
|
| 49 | +
|
| 50 | +
|
| 51 | + # params = { 'parameters': [] , 'in':[] , 'out':[] } |
| 52 | + return { 'parameters': retParameters , 'in':retIn , 'out':retOut } |
| 53 | +
|
| 54 | +def getReturnDescription(doc): |
| 55 | + """ |
| 56 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['1']={} |
| 57 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['1'] ['type'] = '''text''' |
| 58 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['1'] ['content'] = '''The area of the ''' |
| 59 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['2']={} |
| 60 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['2'] ['content'] = '''Triangle''' |
| 61 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['2'] ['link'] = '''classTriangle''' |
| 62 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['2'] ['type'] = '''url''' |
| 63 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['3']={} |
| 64 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['3'] ['content'] = ''' object. ''' |
| 65 | + D ['classes'] ['9'] ['public_methods'] ['members'] ['16'] ['detailed'] ['doc'] ['3'] ['return'] ['3'] ['type'] = '''text''' |
| 66 | + """ |
| 67 | + ret = [] |
| 68 | + for k,v in doc.items(): # k : '3' , v [return]... |
| 69 | + s = '' |
| 70 | + for k2,v2 in v.items(): |
| 71 | + if k2 == 'return': |
| 72 | + ret.append(getDescription(doc=doc[k][k2])) |
| 73 | + return ret |
| 74 | +
|
| 75 | +def getPlantuml(doc): |
| 76 | + """ |
| 77 | + D ['classes'] ['2'] ['detailed'] ['doc'] ['3'] ['type'] = '''plantuml''' |
| 78 | + D ['classes'] ['2'] ['detailed'] ['doc'] ['3'] ['content'] = '''package "customer domain" #DDDDDD { ... ''' |
| 79 | + """ |
| 80 | + l = [] |
| 81 | + for k,v in doc.items(): # k = '3' |
| 82 | + type = v.get('type','') |
| 83 | + if type == 'plantuml': |
| 84 | + l.append(v['content']) |
| 85 | + return l |
| 86 | +
|
| 87 | +def getDescription(doc): |
| 88 | + ''' |
| 89 | + link = D ['classes'] ['2'] ['public_methods'] ['members'] ['1'] ['brief'] ['doc'] |
| 90 | + link = D ['classes'] ['2'] ['public_methods'] ['members'] ['2'] ['detailed'] ['doc'] |
| 91 | + ''' |
| 92 | + s = '' |
| 93 | + for k,v in doc.items(): |
| 94 | + type = v.get('type','') |
| 95 | + if type in ['url','text']: |
| 96 | + s += v.get('content','') |
| 97 | + elif type in ['linebreak']: # 'parbreak' |
| 98 | + s += ret |
| 99 | + return s |
| 100 | +%> |
| 101 | + |
| 102 | +<!DOCTYPE html> |
| 103 | +<html> |
| 104 | +<head> |
| 105 | + <meta charset="UTF-8"> |
| 106 | + <title>DoxyDocs</title> |
| 107 | + <style> |
| 108 | + body { |
| 109 | + font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, |
| 110 | + Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; |
| 111 | + line-height: 1.4; |
| 112 | + color: #333; |
| 113 | + background-color: #fff; |
| 114 | + padding: 0 5vw; |
| 115 | + } |
| 116 | + |
| 117 | + /* Standard Tables */ |
| 118 | + |
| 119 | + table { |
| 120 | + margin: 1em 0; |
| 121 | + border-collapse: collapse; |
| 122 | + border: 0.1em solid #d6d6d6; |
| 123 | + } |
| 124 | + |
| 125 | + caption { |
| 126 | + text-align: left; |
| 127 | + font-style: italic; |
| 128 | + padding: 0.25em 0.5em 0.5em 0.5em; |
| 129 | + } |
| 130 | + |
| 131 | + th, |
| 132 | + td { |
| 133 | + padding: 0.25em 0.5em 0.25em 1em; |
| 134 | + vertical-align: text-top; |
| 135 | + /* text-align: left; */ |
| 136 | + text-indent: -0.5em; |
| 137 | + } |
| 138 | + |
| 139 | + th { |
| 140 | + vertical-align: top; |
| 141 | + /* background-color: #666; |
| 142 | + color: #fff; */ |
| 143 | + } |
| 144 | + |
| 145 | + tr:nth-child(even) th[scope=row] { |
| 146 | + background-color: #f2f2f2; |
| 147 | + } |
| 148 | + |
| 149 | + tr:nth-child(odd) th[scope=row] { |
| 150 | + background-color: #fff; |
| 151 | + } |
| 152 | + |
| 153 | + tr:nth-child(even) { |
| 154 | + background-color: rgba(0, 0, 0, 0.05); |
| 155 | + } |
| 156 | + |
| 157 | + tr:nth-child(odd) { |
| 158 | + background-color: rgba(255, 255, 255, 0.05); |
| 159 | + } |
| 160 | + |
| 161 | + td:nth-of-type(2) { |
| 162 | + font-style: italic; |
| 163 | + } |
| 164 | + |
| 165 | + th:nth-of-type(1) { |
| 166 | + text-align: left; |
| 167 | + vertical-align: top; |
| 168 | + background-color: #666; |
| 169 | + color: #fff; |
| 170 | + } |
| 171 | + /* |
| 172 | + th:nth-of-type(3), |
| 173 | + td:nth-of-type(3) { |
| 174 | + text-align: right; |
| 175 | + }
|
| 176 | + */ |
| 177 | + |
| 178 | + /* Fixed Headers */ |
| 179 | + |
| 180 | + th { |
| 181 | + position: -webkit-sticky; |
| 182 | + position: sticky; |
| 183 | + top: 0; |
| 184 | + z-index: 2; |
| 185 | + } |
| 186 | + |
| 187 | + th[scope=row] { |
| 188 | + position: -webkit-sticky; |
| 189 | + position: sticky; |
| 190 | + left: 0; |
| 191 | + z-index: 1; |
| 192 | + } |
| 193 | + |
| 194 | + th[scope=row] { |
| 195 | + vertical-align: top; |
| 196 | + color: inherit; |
| 197 | + background-color: inherit; |
| 198 | + background: linear-gradient(90deg, transparent 0%, transparent calc(100% - .05em), #d6d6d6 calc(100% - .05em), #d6d6d6 100%); |
| 199 | + } |
| 200 | + |
| 201 | + table:nth-of-type(2) th:not([scope=row]):first-child { |
| 202 | + left: 0; |
| 203 | + z-index: 3; |
| 204 | + background: linear-gradient(90deg, #666 0%, #666 calc(100% - .05em), #ccc calc(100% - .05em), #ccc 100%); |
| 205 | + } |
| 206 | + |
| 207 | + /* Strictly for making the scrolling happen. */ |
| 208 | + |
| 209 | + /* |
| 210 | + th[scope=row] + td { |
| 211 | + min-width: 24em; |
| 212 | + } |
| 213 | + |
| 214 | + th[scope=row] { |
| 215 | + min-width: 20em; |
| 216 | + } |
| 217 | + */ |
| 218 | + |
| 219 | + body { |
| 220 | + padding-bottom: 90vh; |
| 221 | + } |
| 222 | + </style> |
| 223 | +<style> |
| 224 | +* { |
| 225 | + box-sizing: border-box; |
| 226 | +} |
| 227 | +
|
| 228 | +#myTableInput { |
| 229 | + /* background-image: url('/css/searchicon.png'); */ |
| 230 | + background-position: 10px 10px; |
| 231 | + background-repeat: no-repeat; |
| 232 | + width: 100%; |
| 233 | + font-size: 16px; |
| 234 | + padding: 12px 20px 12px 40px; |
| 235 | + border: 1px solid #ddd; |
| 236 | + margin-bottom: 12px; |
| 237 | +} |
| 238 | +
|
| 239 | +#myCbInput { |
| 240 | + /* background-image: url('/css/searchicon.png'); */ |
| 241 | + background-position: 10px 10px; |
| 242 | + background-repeat: no-repeat; |
| 243 | + width: 100%; |
| 244 | + font-size: 16px; |
| 245 | + padding: 12px 20px 12px 40px; |
| 246 | + border: 1px solid #ddd; |
| 247 | + margin-bottom: 12px; |
| 248 | +} |
| 249 | +</style> |
| 250 | +</head> |
| 251 | + |
| 252 | +<body> |
| 253 | +<h1>classes</h1> |
| 254 | +<table> |
| 255 | + <tr><th>Class</th><th>Derived</th><th>Includes</th><th>Brief</th><th>Detailed Description</th></tr> |
| 256 | +% for k,v in D['classes'].items(): |
| 257 | + <% derived=[] %>\ |
| 258 | + % for k1,v2 in v.get('derived',{}).items(): |
| 259 | + <% derived.append(v2.get('name','')) %>\ |
| 260 | + % endfor |
| 261 | + <% brief = getDescription(doc=v.get('brief',{}).get('doc',{})) %>\ |
| 262 | + <% detail = getDescription(doc=v.get('detailed',{}).get('doc',{})) %>\ |
| 263 | + <tr><td>${v['name']}</td><td>${' '.join(derived)}</td><td>${v.get('includes',{}).get('name','')}</td><td>${brief}</td><td>${detail}</td></tr> |
| 264 | +% endfor |
| 265 | +</table> |
| 266 | + |
| 267 | + |
| 268 | +<% plantumlCnt = 0 %>\ |
| 269 | +% for k,v in D['classes'].items(): |
| 270 | +<h2>Function Lists of ${v['name']} class</h2> |
| 271 | + <% plantuml = getPlantuml(doc=v.get('detailed',{}).get('doc',{})) %>\ |
| 272 | + % for p in plantuml: |
| 273 | + <% |
| 274 | + plantumlCnt += 1 |
| 275 | + with open('test-{c}.puml'.format(c=plantumlCnt),'w') as f: |
| 276 | + f.write('@startuml test-{c}.png\n'.format(c=plantumlCnt)) |
| 277 | + f.write(p) |
| 278 | + f.write('\n@enduml\n') |
| 279 | + proxylink = '{proxy}&src={puml}/{file}'.format(proxy=myPlantumlServerProxy , puml=mySrcDirHttp , file='test-{c}.puml'.format(c=plantumlCnt)) |
| 280 | + pnglink = '../../../img/{file}'.format(proxy=myPlantumlServerProxy , puml=mySrcDirHttp , file='test-{c}.png'.format(c=plantumlCnt)) |
| 281 | + %> |
| 282 | + <img src="${proxylink}" onerror="this.onerror=null;this.src='${pnglink}';" alt="test-${plantumlCnt}.puml"> |
| 283 | + % endfor |
| 284 | + <table> |
| 285 | + <tr><th>Accessibility</th><th>Function</th><th>Description</th><th>Parameters</th><th>param input</th><th>param output</th><th>Returns</th><th>return Description</th></tr> |
| 286 | + % for accessibility,v2 in v.items(): |
| 287 | + % if accessibility == 'public_methods': |
| 288 | + % for k3,v3 in v2.get('members',{}).items(): |
| 289 | + <% |
| 290 | + t = v2['members'][k3] |
| 291 | + func = t['name'] |
| 292 | + brief = getDescription(doc=t.get('brief',{}).get('doc',{})) |
| 293 | + detailed = getDescription(doc=t.get('detailed',{}).get('doc',{})) |
| 294 | + returnType = t.get('type','') |
| 295 | + # returnDoc = [] |
| 296 | + returnDoc = ret.join(getReturnDescription(doc=t.get('detailed',{}).get('doc',{}))) |
| 297 | + # params = { 'parameters': [] , 'in':[] , 'out':[] } |
| 298 | + params = getParameters(parameters=t.get('parameters',{}),detailed_doc=t.get('detailed',{}).get('
72D6
doc',{})) |
| 299 | + %> |
| 300 | + <tr><td>${accessibility}</td><td>${func}</td><td>${detailed}</td><td>${ret.join(params['parameters'])}</td><td>${ret.join([ x for x,y in params['in']])}</td><td>${ret.join([x for x,y in params['out']])}</td><td>${returnType}</td><td>${returnDoc}</td></tr> |
| 301 | + % endfor |
| 302 | + % endif |
| 303 | + % endfor |
| 304 | + </table> |
| 305 | +% endfor |
| 306 | + |
| 307 | +</body> |
| 308 | +</html> |
0 commit comments