Sphinx创建类属性表

时间:2019-03-22 10:29:05

标签: python documentation python-sphinx

我正在将sphinx-buildnumpy-stylescipy-sphinx-theme配合使用,以根据__init__文档字符串自动构建项目文档。

我希望狮身人面像将表格中的类属性设置为格式而不是描述列表,这与自动汇总创建好的方法表的方式相同,因为我发现这样做浪费了空间并且破坏了类属性的概述正如您在下图中看到的那样,它们很多。

enter image description here

我的课程Attributes文档看起来大致像这样。由于属性是在运行时定义的,因此我需要在.. rubric:: Methods .. autoautosummary:: htmdmol.molecule.Molecule :methods: .. rubric:: Attributes Attributes ---------- numAtoms : int Number of atoms in the Molecule numFrames : int Number of conformers / simulation frames in the Molecule 部分中明确记录它们。但是默认情况下,这些内容然后放在描述列表中而不是表格中。

<dd> <dl>

我尝试在属性列表中查找生成Attributes元素的模板,但没有成功。如果有人可以帮助我使Methods部分看起来与export class MonthYearPicker { @Input() date: FormControl; momentDate: Moment; ngOnInit() { this.momentDate = _moment(this.date.value); } chosenYearHandler(normalizedYear: _moment.Moment) { this.momentDate.year(normalizedYear.year()); } chosenMonthHandler(normlizedMonth: _moment.Moment, datepicker: MatDatepicker<_moment.Moment>) { this.momentDate.month(normlizedMonth.month()); this.date.setValue(this.momentDate); datepicker.close(); } } <div class="col-xl-4 col-lg-5 layout-row-flex"> <month-year-picker [date]="addressInProgressControls?.occupiedUntil"></month-year-picker> </div> 部分相同,那我会很高兴的。

0 个答案:

没有答案