Comments (1)
There is a historical reason why we have these two directives but long-story short, .. code
is a docutils directive (that we support as a pure docutils) and .. code-block
is a Sphinx one (which is an improvement of the latter).
We don't really want to mention the two of them because what is generally needed is the code-block
directive and not the code
directive. If we were to mention it, users would maybe try to use the ..code
directive.
There was a very old issue (#2155) that I recently closed where it was debated whether to keep code
synced with the docutils one or not. One maintainer personnally preferred merging these two together but eventually made a PR where code
and code-block
are distinct. While I also share this opinion, having distinct code directives might be useful for extensions that assume that the code directive is compatible with docutils and has minimal processing in their run
method, so I would not change the behaviour.
Nevertheless, what we can do is mention the code
directive but stress that code-block
is better for most usage.
from sphinx.
Related Issues (20)
- Multiple labels inside math directives HOT 2
- LaTeX: footnote mark may indicate "Page N, M" but footnote M is already on page N
- Gettext builder cannot extract 'option' directive HOT 4
- `autodoc_class_signature = "separated"` cause a warning for enum with no `__init__` HOT 12
- [search] issues with the new HTML search algorithm HOT 15
- Pre-declared explicit links not working
- add_css_file return wrong URI when dealing with local files on windows platform HOT 6
- [search] Add ability to treat "-" as a normal letter, to not split search term into several words HOT 1
- Import command-line documentation from docopt HOT 2
- Add "skip to main content" a11y feature
- BUG: env.toctree_includes different between parallel and serial builds HOT 2
- LaTeX: for French language and lualatex engine polyglossia and not babel is used contrarily to Sphinx documentation HOT 1
- [docs] clarify the usage of `versionadded` & co HOT 9
- Re: :scale: for SVG images in HTML builds
- sphinx raises an exception when trying to build python 3.13 doc with devhelp HOT 3
- Yandex Browser ignores the translation ban HOT 1
- Issue with automodule and cython/numpy HOT 2
- TypeError: expected str, bytes or os.PathLike object, not StringList HOT 7
- test_autodoc_type_aliases failing on 3.12.4 HOT 3
- error on http link containing a dash with sphinx book/pydata theme HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx.