Creates a LaTeX `\\input{}` or an RST '.. literalinclude:: ' command for including a netlist file. :param netlistFile: Name of the netlist file relative to the project circuit directory :type netlistFile: str :pa
(self, netlistFile, lineRange=None, firstNumber=None)
| 31 | pass |
| 32 | |
| 33 | def netlist(self, netlistFile, lineRange=None, firstNumber=None): |
| 34 | """ |
| 35 | Creates a LaTeX `\\input{}` or an RST '.. literalinclude:: ' |
| 36 | command for including a netlist file. |
| 37 | |
| 38 | :param netlistFile: Name of the netlist file relative to the project |
| 39 | circuit directory |
| 40 | :type netlistFile: str |
| 41 | |
| 42 | :param lineRange: range of lines to be included |
| 43 | :type lineRange: str |
| 44 | |
| 45 | :param firstNumber: start number of the displayed line numbers |
| 46 | :type firstNumber: str |
| 47 | |
| 48 | :return: SLiCAP Snippet object |
| 49 | :rtype: SLiCAP.SLiCAPprotos.Snippet |
| 50 | |
| 51 | :example: |
| 52 | |
| 53 | >>> import SLiCAP as sl |
| 54 | >>> rst = sl.RSTformatter() # Creates a ReStructuredText formatter |
| 55 | >>> rst.netlist("myFirstRCnetwork.cir").save("netlist") |
| 56 | |
| 57 | This will save a file `netlist.rst` in the `sl.ini.rst_snippets` folder |
| 58 | with the following contents: |
| 59 | |
| 60 | .. code:: |
| 61 | |
| 62 | .. literalinclude:: <full path to myFirstRCnetwork.cir> |
| 63 | :linenos: |
| 64 | """ |
| 65 | RST = '.. literalinclude:: /' + ini.project_path |
| 66 | RST += ini.cir_path + netlistFile + '\n' |
| 67 | RST += ' :linenos:\n' |
| 68 | if lineRange != None: |
| 69 | RST += ' :lines: ' + lineRange + '\n' |
| 70 | if firstNumber != None: |
| 71 | RST += ' :lineno-start: ' + str(firstNumber) + '\n' |
| 72 | return Snippet(RST, self.format) |
| 73 | |
| 74 | def elementData(self, circuitObject, label="", caption=""): |
| 75 | """ |