如何将外部文件包含为类似于代码块的 Sphinx 文档?
我怎样才能让它设置语法颜色的样式?
输入参数两边的括号是什么意思?
考虑这个例子:
cv.boxPoints(box[,points])
示例文档链接
最让我困惑的是第二个输入参数点括号内的逗号。为什么表示为[,points]. 任何有关这方面的信息将不胜感激。谢谢!
我正在使用 Emacs、SBCL 和 Slime 学习 Common Lisp。
我想确切地知道内置函数的代码定义是什么。
我知道如何使用(documentation ...)和(describe ...)。但是,它们仅提供高级别的信息。我想看看代码细节。
以nth内置函数为例。
Documentation 给我们:
CL-USER> (documentation 'nth 'function)
"Return the nth object in a list where the car is the zero-th element."
Run Code Online (Sandbox Code Playgroud)
Describe 给我:
CL-USER> (describe 'nth)
COMMON-LISP:NTH
[symbol]
NTH names a compiled function:
Lambda-list: (SB-IMPL::N LIST)
Declared type: (FUNCTION (UNSIGNED-BYTE LIST) (VALUES T &OPTIONAL))
Derived type: (FUNCTION (T T) (VALUES T &OPTIONAL))
Documentation:
Return the nth object in a list where …Run Code Online (Sandbox Code Playgroud) 假设我有这门课
public sealed class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string DisplayName => $"{FirstName} {LastName}";
}
Run Code Online (Sandbox Code Playgroud)
我想记录该DisplayName财产。
/// <summary>
/// A space seperated string of the FirstName and LastName
/// </summary>
public string DisplayName => $"{FirstName} {LastName}";
Run Code Online (Sandbox Code Playgroud)
但我现在的问题是,如果我将属性重命名LastName为FamilyName. 我的代码当然仍然可以编译,但我的文档将引用不存在的属性。
有没有一种方法可以像这种伪语法一样在属性DisplayName中引用实际属性LastName。
/// <summary>
/// A space seperated string of the <prop=FirstName> and <prop=LastName>
/// </summary>
Run Code Online (Sandbox Code Playgroud)
这样重构我的代码也会重构文档或者编译器至少会给出警告或者可能是错误?