All Sphinx Directives¶
Sphinx comes with a huge number of directives. Some are inherited from RST, others come from the many extensions that are available. But the is no list of all, or the most used directives in Sphinx.
Until now …
Updated on 2018/05/13
Added more opensource projects as a reference to show “all” Directives.
The most used directives to document Sphinx itself¶
With a simple iPython-script, I counted all directives in all (.rst & .py) files of Sphinx-doc (the latest version, on May 10, 2018); 1758 in total. The table below shows them all, sorted in most-used-order. As you can see many directives are only used once (0.06%) or twice …
Directive |
% |
Directive |
% |
Directive |
% |
Directive |
% |
---|---|---|---|---|---|---|---|
|
17.35% |
|
1.14% |
|
0.28% |
|
0.11% |
|
14.39% |
|
1.14% |
|
0.28% |
|
0.11% |
|
6.88% |
|
1.14% |
|
0.28% |
|
0.11% |
|
4.89% |
|
1.08% |
|
0.28% |
|
0.11% |
|
4.32% |
|
1.08% |
|
0.23% |
|
0.11% |
|
4.10% |
|
1.08% |
|
0.23% |
|
0.06% |
|
3.53% |
|
1.02% |
|
0.23% |
|
0.06% |
|
2.90% |
|
1.02% |
|
0.23% |
|
0.06% |
|
2.84% |
|
0.91% |
|
0.23% |
|
0.06% |
|
2.84% |
|
0.91% |
|
0.23% |
|
0.06% |
|
2.67% |
|
0.74% |
|
0.17% |
|
0.06% |
|
1.93% |
|
0.74% |
|
0.17% |
|
0.06% |
|
1.93% |
|
0.68% |
|
0.17% |
|
0.06% |
|
1.65% |
|
0.51% |
|
0.17% |
|
0.06% |
|
1.59% |
|
0.46% |
|
0.17% |
|
0.06% |
|
1.59% |
|
0.46% |
|
0.11% |
|
0.06% |
|
1.54% |
|
0.46% |
|
0.11% |
|
0.06% |
|
1.42% |
|
0.40% |
|
0.11% |
|
0.06% |
|
1.14% |
|
0.34% |
|
0.11% |
|
0.06% |
More directives¶
As promised, I want to show all directives. That is hardly possibly, as RST (and so, Sphinx) is extendable; anybody can add directives… Still, we can come close, by scanning more documentation-projects.
The same script can scan several (documentation) projects; by summing the resulting DirectiveCounter
s together, the
big-table below is produced.
Currently, I scan some of my personal projects, and a few open-source ones:
Directive |
% |
Directive |
% |
Directive |
% |
Directive |
% |
---|---|---|---|---|---|---|---|
|
12.54% |
|
0.41% |
|
0.10% |
|
0.02% |
|
12.33% |
|
0.40% |
|
0.10% |
|
0.02% |
|
8.61% |
|
0.37% |
|
0.10% |
|
0.02% |
|
7.95% |
|
0.36% |
|
0.09% |
|
0.01% |
|
6.11% |
|
0.35% |
|
0.09% |
|
0.01% |
|
5.52% |
|
0.34% |
|
0.09% |
|
0.01% |
|
4.17% |
|
0.33% |
|
0.09% |
|
0.01% |
|
4.15% |
|
0.31% |
|
0.09% |
|
0.01% |
|
3.79% |
|
0.30% |
|
0.08% |
|
0.01% |
|
3.54% |
|
0.22% |
|
0.07% |
|
0.01% |
|
3.48% |
|
0.22% |
|
0.07% |
|
0.01% |
|
2.83% |
|
0.22% |
|
0.07% |
|
0.01% |
|
2.18% |
|
0.21% |
|
0.05% |
|
0.00% |
|
1.68% |
|
0.21% |
|
0.05% |
|
0.00% |
|
1.12% |
|
0.19% |
|
0.04% |
|
0.00% |
|
1.11% |
|
0.19% |
|
0.04% |
|
0.00% |
|
1.09% |
|
0.18% |
|
0.04% |
|
0.00% |
|
1.08% |
|
0.18% |
|
0.04% |
|
0.00% |
|
1.04% |
|
0.18% |
|
0.03% |
|
0.00% |
|
1.04% |
|
0.17% |
|
0.03% |
|
0.00% |
|
0.95% |
|
0.16% |
|
0.03% |
|
0.00% |
|
0.79% |
|
0.15% |
|
0.03% |
|
0.00% |
|
0.74% |
|
0.15% |
|
0.02% |
|
0.00% |
|
0.61% |
|
0.14% |
|
0.02% |
|
0.00% |
|
0.57% |
|
0.14% |
|
0.02% |
|
0.00% |
|
0.53% |
|
0.14% |
|
0.02% |
|
0.00% |
|
0.52% |
|
0.12% |
|
0.02% |
|
0.00% |
|
0.48% |
|
0.12% |
|
0.02% |
||
|
0.47% |
|
0.11% |
|
0.02% |
||
|
0.47% |
|
0.11% |
|
0.02% |
Note
Are you missing a directive?
Find a project using it and let me know! And I will rerun the scripts. And simular when a major documentation-project should be included to get better stats.