summaryrefslogtreecommitdiff
path: root/sandbox/docpy-writer/expected/codemarkup.tex
blob: 078117f71503c0d23d18c0b3b413e828a0e5c680 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
\ifx\locallinewidth\undefined\newlength{\locallinewidth}\fi
\setlength{\locallinewidth}{\linewidth}


\section{Pydoc writer codemarkups\label{-pydoc-writer-codemarkups}}


\subsection{literals\label{-literals}}

Literal are recognized by a text specific markup.py


\subsection{informational units\label{-informational-units}}

these are markups to allow index creation.
\begin{verbatim}
\begin{datadesc} {name}
\begin{datadescni} {name}
\begin{excdesc} {name}
\begin{classdesc*} {name}
\begin{csimplemacrodesc} {name}
\end{verbatim}


\subsection{ctype with{\_}tag and{\_}name\label{-ctype-with_tag-and_name}}

bla bla

\begin{verbatim}
\begin{ctypedesc} [tag]{name}
\begin{memberdesc} [type name]{name}
\begin{memberdescni} [type name]{name}
\end{verbatim}


\subsection{sizeof(type{\_}or{\_}object)\label{-sizeof}}

Returns the size in bytes of a ctypes type or instance memory
buffer.  Does the same as the C sizeof() function.

\begin{verbatim}
\begin{cvardesc} {type}{name}
\begin{excclassdesc} {name}{constructor parameters}
\begin{funcdesc} {name}{parameters}
\begin{funcdescni} {name}{parameters}

\begin{methoddesc} [type name]{name}{parameters}
\begin{methoddescni} [type name]{name}{parameters}

\begin{cmemberdesc} {container}{type}{name}
\begin{classdesc} {name}{constructor parameters}
\begin{cfuncdesc} {type}{name}{args}
\end{verbatim}


\subsubsection{definition lists\label{-definition-lists}}

with classifier
\begin{verbatim}
sizeof(type_or_object) : funcdesc
    Returns the size in bytes of a ctypes type or instance memory
        buffer.  Does the same as the C sizeof() function.
\end{verbatim}

plain definitions are set as datadescni, maybe latex description would
be better
\begin{verbatim}
standalone :
   is marked as datadescni
\end{verbatim}


\subsubsection{test samples\label{-test-samples}}

\begin{datadescni}{standalone :}
is marked as datadescni
\end{datadescni}

\begin{datadescni}{which :}
might be a not so optimal solution.
\end{datadescni}

Real informational units

\begin{classdesc*}{Class}
without constructor documentation.
\end{classdesc*}

\begin{funcdesc}{sizeof}{type_or_object}
Returns the size in bytes of a ctypes type or instance memory
buffer.  Does the same as the C sizeof() function.
\end{funcdesc}

a function with optional parameter

\begin{funcdesc}{create_string_buffer}{init\optional{, size}}
does this or that
\end{funcdesc}

\begin{datadesc}{file}
also datadescni, excdesc, classdesc*, csimplemacrodesc
\end{datadesc}

\begin{ctypedesc}{FileRO}
without tag
\end{ctypedesc}

\begin{ctypedesc}[ftag]{FileRW}
with tag
also memberdesc, memberdescni
\end{ctypedesc}

\begin{funcdescni}{read}{int bytes \optional{, bool flush \optional{, bool after}}}
two optional parameter.
also cvardesc, funcdesc, funcdescni, classdesc, excclassdesc
\end{funcdescni}

\begin{methoddesc}{force_it}{string s}
without return type
\end{methoddesc}

\begin{methoddescni}[bool]{write}{string s}
with return type
\end{methoddescni}

\begin{cfuncdesc}{int}{read}{File}
not a tag but a type
\end{cfuncdesc}

\begin{cmemberdesc}{PyTypeObject}{long}{tp_flags}
This field is a bit mask of various flags. Some flags indicate
variant semantics for certain situations; others are used to
\end{cmemberdesc}

extra markup to the definition does not change anything as the writer processes
only the text version.

\begin{funcdesc}{sizeof}{type_or_object}
Returns the size in bytes of a ctypes type or instance memory
buffer.  Does the same as the C sizeof() function.
\end{funcdesc}

\begin{methoddesc}{from_address}{address}
This method returns a ctypes type instance using the memory
specified by address.
\end{methoddesc}


\subsubsection{alternatives\label{-alternatives}}
\begin{itemize}
\item {} 
customroles
\begin{verbatim}
.. role:: funcdesc

:funcdesc:`sizeof(type_or_object)`

    Returns the size in bytes of a ctypes type or instance memory
    buffer.  Does the same as the C sizeof() function.
\end{verbatim}

But the block after funcdesc should be inside funcdesc not in a separate
block quote.

\item {} 
admonitions :
Have a text block and a title.
\begin{verbatim}
.. admonition:: sizeof(type_or_object)
   :class: funcdesc

   Returns the size in bytes of a ctypes type or instance memory
   buffer.  Does the same as the C sizeof() function.
\end{verbatim}

\item {} 
directives

see sandbox/edloper/docpy/asyncore.rst.

\item {} 
topics

Have a text block and a title:
\begin{verbatim}
.. topic:: c_char
   :class: datadesc

   the ...
\end{verbatim}

\end{itemize}