Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix __dunder__ methods in asciidoc posts #2

Closed
ramalho opened this issue Jun 25, 2021 · 1 comment
Closed

Fix __dunder__ methods in asciidoc posts #2

ramalho opened this issue Jun 25, 2021 · 1 comment

Comments

@ramalho
Copy link
Member

ramalho commented Jun 25, 2021

Asciidoc uses single and double underscores for italic text. Many occurrences of __dunder__ names need to be fixed in the .adoc files by replacing each _ with _, the escape code for _. For example: __dunder__. 馃槬

PS. The proprietary O'Reilly asciidoc toolchain doesn't use the double underscore for italic to avoid issues with __dunder__ notation, since they publish lots of books about Python. But in this site I use Asciidoctor, so this became an issue as I moved content from the book.

@ramalho
Copy link
Member Author

ramalho commented Jul 29, 2021

I found a better way to fix this: replace __xyz__ with +__xyz__+. Note: in both cases we need backticks around the whole string including the + signs, to render with a fixed-width code font in asciidoc.

I've done that in several places, but if you still find dunder method names rendering as italic without the underscores, please submit a PR with the fix described in this comment. Thanks!

@ramalho ramalho closed this as completed Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant