Syn*_*ose 5 restructuredtext python-sphinx
我尝试添加的文件包含许多评分细则,但我收到了一个奇怪的错误。我一定在做一些愚蠢的事情,但我似乎无法弄清楚。这是我的文档:
==========================
Coding Conventions
==========================
Below is list of coding conventions agreed upon by ________. Please adhere to these conventions to create a more readable codebase!
.. rubric:: Variables
Variables should be in the ``camelCase`` format in all cases.::
var = 3
anotherVar = 4
moreWordsThanPreviousVar = 5
.. rubric:: Functions
The same format as Variables, ``camelCase`` should be used.::
def func():
#...
def adheresToCodingConventionFunc():
#...
.. rubric:: Classes
Uppercase ``CamelCase`` should be used to repesent classes.::
class Shape(object):
#...
class SquareObject(Shape):
#...
.. rubric:: Tabs
Currently CALIPSO uses tabs instead of spaces.::
var = [1,2,3,4,5]
for v in var:
print v # tab should be 4 spaces long
.. rubric:: General Rules
No spaces should be left between conditional statements and loops code blocks.::
if x is not y:
# ...
for x in y:
# ...
Comments should be right justified when applicable, and only above lines when necessary to explain a section of code(not just one line).::
var = x - y + r*2 # calculate ___ and place in var
doFunc(var) # do some func with var param
if var[-1] is not var[:3]:
err() # error is var does not match criteria
Run Code Online (Sandbox Code Playgroud)
原来我不小心在标题下方缩进了我的段落,这是最终文档:
==========================
Coding Conventions
==========================
Below is list of coding conventions agreed upon by ______. Please adhere to these conventions to create a more readable codebase.
.. rubric:: Variables
Variables should be in the ``camelCase`` format in all cases.::
var = 3
anotherVar = 4
moreWordsThanPreviousVar = 5
.. rubric:: Functions
The same format as Variables, ``camelCase`` should be used.::
def func():
def adheresToCodingConventionFunc():
.. rubric:: Classes
Uppercase ``CamelCase`` should be used to repesent classes.::
class Shape(object):
class SquareObject(Shape):
.. rubric:: Tabs
Currently CALIPSO uses tabs instead of spaces.::
var = [1,2,3,4,5]
for v in var:
print v # tab should be 4 spaces long
.. rubric:: General Rules
No spaces should be left between conditional statements and loops code blocks.::
if x is not y:
# ...
for x in y:
# ...
Comments should be right justified when applicable, and only above lines when necessary to explain a section of code(not just one line).::
var = x - y + r*2 # calculate ___ and place in var
doFunc(var) # do some func with var param
if var[-1] is not var[:3]:
err() # error is var does not match criteria
# Set the value of var and pass var into a set of functions which calculate things based off var
var = x - y + r*2
doAllFuncs(var)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2114 次 |
| 最近记录: |