MCPcopy Create free account
hub / github.com/pytorch/pytorch / GHMarkdown

Class GHMarkdown

caffe2/python/docs/github.py:22–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21
22class GHMarkdown(Markdown):
23 def addHeader(self, text, h=1):
24 self.addLine("\n{header} {text}\n".format(header=h * '#', text=text), True)
25
26 def addDocHeader(self):
27 self.addLine("---")
28 self.addLine("docid: operators-catalog")
29 self.addLine("title: Operators Catalog")
30 self.addLine("layout: operators")
31 self.addLine("permalink: /docs/operators-catalogue.html")
32 self.addLine("---")
33 self.addLine("* TOC")
34 self.addLine("{:toc}")
35
36 def addTable(self, table, noTitle=False):
37 self.addLinebreak()
38 assert(len(table) > 1)
39 self.addLine(' | '.join(['----------' for i in range(len(table[0]))]))
40 self.addLine(' | '.join(table[0]))
41 for row in table[1:]:
42 self.addLine(' | '.join(row))
43
44 def addTableHTML(self, table, noTitle=False):
45 self.addRaw("<table>")
46 for row in table:
47 self.addRaw("<tr>")
48 for cell in row:
49 self.addRaw("<td>")
50 self.addLine("{cell}".format(cell=cell))
51 self.addRaw("</td>")
52 self.addRaw("</tr>")
53 self.addRaw("</table>")
54
55def getCodeLink(formatter, schema):
56 formatter = formatter.clone()

Callers 1

github.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…