Commit Graph

127 Commits

Author SHA1 Message Date
jfbu
d6e11b89e9 Fix suppression of needed whiteline, encapsulate into \sphinxAtStartPar
Define it to do nothing with lualatex engine
2021-01-29 10:40:50 +01:00
jfbu
185a2d27fe Fix #8780: long words in narrow columns may not be hyphenated
This is done by adding '\hskip0pt\relax\n' whenever a paragraph starts.
2021-01-29 00:24:44 +01:00
Takeshi KOMIYA
949ec8737f Close #1638: html: Add permalink icons to glossary terms 2021-01-24 23:35:37 +09:00
Takeshi KOMIYA
d6f41227d7 Fix #8714: html: kbd role with "Caps Lock" rendered incorrectly
`:kbd:` role has to support keys in consist of multiple words (ex. caps
lock, num lock, etc.)
2021-01-22 21:58:19 +09:00
Takeshi KOMIYA
7ecf6b88aa Merge branch '3.4.x' into 3.x 2021-01-01 13:56:19 +09:00
Takeshi KOMIYA
f996859420 A happy new year!
.. note::

   $ find sphinx tests LICENSE doc/conf.py -type f -exec sed -i '' -e 's/2007\-20../2007-2021/' {} \;
   $ git co sphinx/locale/**/*.js sphinx/templates/epub3/mimetype
2021-01-01 13:40:48 +09:00
Takeshi KOMIYA
2eb8927b89 Fix test: missing compound class for kbd tag 2020-12-31 21:20:38 +09:00
Takeshi KOMIYA
b31b8df9bf
Merge pull request #8620 from tk0miya/8619_compound_kbd
Close #8619: html: kbd role generates customizable HTML tags for compound keys
2020-12-31 21:11:42 +09:00
Takeshi KOMIYA
6a53c53d53 Fix #8618: html: incorrect HTML for single compound-kdb separators 2020-12-30 21:12:00 +09:00
Takeshi KOMIYA
8e5f4e5616 Close #8619: html: kbd role generates customizable HTML tags for compound keys 2020-12-30 20:36:09 +09:00
Takeshi KOMIYA
21a3bd4127 refactor: Fix flake8 violations under tests/ directory 2020-11-15 17:15:40 +09:00
François Freitag
0949735210
Sort imports with isort
Keep imports alphabetically sorted and their order homogeneous across
Python source files.

The isort project has more feature and is more active than the
flake8-import-order plugin.

Most issues caught were simply import ordering from the same module.
Where imports were purposefully placed out of order, tag with
isort:skip.
2020-11-11 13:19:05 +01:00
Takeshi KOMIYA
71b653719d Fix #7610: incorrectly renders consecutive backslashes 2020-05-07 00:54:36 +09:00
Takeshi KOMIYA
a5036270c8
Merge pull request #7605 from tk0miya/refactor_tests
Refactor tests
2020-05-04 01:27:54 +09:00
Takeshi KOMIYA
f01ea79092 refactor: Pass a theme instance to LaTeXTranslator 2020-05-03 23:56:59 +09:00
Takeshi KOMIYA
a148a8e7cb Close #7530: html: Support nested <kbd> elements 2020-05-02 22:48:57 +09:00
Jesse Tan
7c1b673076 Add LaTeX styling hook for :kbd: role 2020-01-09 16:35:40 +01:00
Takeshi KOMIYA
eaf495c3c4 A happy new year! 2020-01-01 14:27:43 +09:00
jfbu
30b26dd6a1 LaTeX: avoid quotes and TeX ligature replacements in PDF output
Refs: #6890

The comma character is not TeX-escaped because it is frequent in general
text and escaping it would make the LaTeX output larger for only dealing
with the problem of the LaTeX-ligature of ,, into a single character.
And one there is problem with the commas in options to Verbatim from
PygmentsBridge.

The hyphen character is escaped (not in ids and URIs!) to
\sphinxhyphen{} for both Unicode and non-Unicode engines. This is needed
to work around hyperref transforming -- and --- from section titles into
EN DASH resp. EM DASH in PDF bookmarks.

https://github.com/latex3/hyperref/issues/112

Note to expert LaTeX users: if Sphinx latex user with xelatex has

- turned off Smart Quotes for some reason,

- but does want TeX ligatures and thus overrode Sphinx
latex_elements['fontenc'] default (since #6888) to this effect,

then this should be added to LaTeX preamble:

    \def\sphinxhyphen#1{-}% (\protected is now not needed)
    \let\sphinxhyphenforbookmarks\sphinxhyphen
2019-12-15 14:19:50 +01:00
Takeshi KOMIYA
660e746cf8 Fix #6738: latex: literal_block does not support raw unicode characters 2019-11-16 16:47:20 +09:00
Takeshi KOMIYA
9b2c1c679a Fix #6444: test: replace example.com by existing page 2019-06-05 23:42:24 +09:00
Takeshi KOMIYA
90bf81bd37 test: Use get_doctree() to load doctree files 2019-02-17 20:27:48 +09:00
Takeshi KOMIYA
61f1477942 Add testcase for XRefRole class 2019-02-16 21:23:01 +09:00
Takeshi KOMIYA
6748a6de2f Add testcase for download role 2019-02-16 21:23:01 +09:00
Takeshi KOMIYA
3ec032fa39 Replace :file: and :samp: roles by class based implementation 2019-02-16 12:37:46 +09:00
Takeshi KOMIYA
ea4d8ca08d Replace :guilabel: and :menuselection: roles by class based implementation 2019-02-16 02:30:28 +09:00
Takeshi KOMIYA
cb49a6b091 Fix :pep: and :rfc: roles are broken 2019-02-16 01:47:52 +09:00
Takeshi KOMIYA
66228fb60f Fix #5906: LaTeX Builder is not initialized correctly on test_markup 2019-01-08 01:30:25 +09:00
Takeshi KOMIYA
1c34501e85 refactor: Move \figurename to sphinxmessage.sty 2019-01-04 23:06:34 +09:00
Takeshi KOMIYA
7459d8771a Fix HTML: Invalid HTML5 file is generated for glossary (refs: #4611)
Note: It was caused by a glossary having multiple terms for one
description.
2019-01-03 18:17:17 +09:00
Takeshi KOMIYA
a0e1390472 Remove use of deprecated APIs 2019-01-03 13:27:33 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00
Takeshi KOMIYA
1b1ebd2c75 A happy new year! 2019-01-02 16:00:30 +09:00
Jon Dufresne
bade33c7e4 Remove unnecessary encoding cookie from Python source files
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:

https://docs.python.org/3/howto/unicode.html#the-string-type

> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...

Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
2018-12-16 12:22:12 -08:00
jfbu
30ec4b6bba Merge branch '1.8' 2018-12-16 18:34:05 +01:00
jfbu
88a019dc99 LaTeX: allow sphinxVerbatim usage without explicit "hllines" extra setup
Fixes: #5810
2018-12-16 16:54:28 +01:00
Takeshi KOMIYA
c6bd84a614 refactor: Remove u-prefix from strings 2018-12-16 21:28:51 +09:00
Takeshi KOMIYA
3863256cb6 Add SphinxTranslator as an abstract class 2018-12-03 22:30:56 +09:00
jfbu
2825e338c2 LaTeX: support for Greek and Cyrillic
0. do not escape Unicode Greek letters via LaTeX math mark-up: pass them
   through un-modified to LaTeX document,

1. if "fontenc" receives extra option LGR, then pdflatex will support
   Unicode Greek letters (not in math), and with extra option T2A it
   will support (most) Unicode Cyrillic letters.

2. for pdflatex with LGR, this will use "textalpha" LaTeX package and
   "substitutefont" package to set up some automatic font substitution
   to work around the unavailability of Greek with "times"
   package (which is default font package chosen by Sphinx for
   pdflatex), same with T2A and "substitutefont" for Cyrillic.

3. for xelatex/lualatex, set up Computer Modern Unicode as default font,
   as it supports Cyrillic and Greek scripts,

4. for platex, don't do anything special as the engine already has
   its default font supporting Cyrillic and Greek (even in math mode!)

Closes: #5251
Fixes:  #5248
Fixes:  #5247
2018-11-16 21:14:51 +01:00
Takeshi KOMIYA
848224f641 Add LaTeXBuilder.context: Build context object by builder 2018-08-13 23:52:44 +09:00
Michael Tesch
e368ac21ef proposed enhancement #4830 2018-04-20 13:13:00 +02:00
Takeshi KOMIYA
f7027049b1 Fix flake8 violations 2018-02-19 23:20:56 +09:00
Takeshi KOMIYA
4d040abafb Fix #4079: Add notranslate class to let Google Translate know they are not translatable 2018-01-13 20:25:49 +09:00
jfbu
309f38a91f Split out fancy LaTeX macros from `\sphinxcode into \sphinxupquote`
Since #2627 (1.4.4), `\code`, and then again at #3116 (1.5)
`\sphinxcode` which is the new name has become more complicated than the
original `\texttt{#1}`. This was to obtain straight quotes in PDF output,
and to allow long inline literals to break across lines.

This means though that users who want to customize `\sphinxcode`, for
example to not only do `\texttt` but to use some colour, have to copy
about 10 lines of complicated LaTeX macros which should be not modified
in any way. This commit moves all the code out of `\sphinxcode` into a
separate macro `\sphinxupquote`.

The LaTeX writer will output `\sphinxcode{\sphinxupquote{foo}}` in place
of former `\sphinxcode{foo}`. Moving the `\texttt` from innermost to
outermost level is with no consequence.
2018-01-03 08:46:19 +01:00
Takeshi KOMIYA
2426cedb8b A happy new year! 2018-01-01 01:06:58 +09:00
jfbu
70f8d4ddfc Support `:emphasize-lines:` in PDF output (closes #1238) 2017-12-10 12:37:36 +01:00
Takeshi KOMIYA
da0fda3b0b Add tests for default-role 2017-07-31 00:46:26 +09:00
shimizukawa
d497d74370 refs #3458: add sphinx.testing that are moved from /tests directory. 2017-05-14 20:47:15 +09:00
Dmitry Shachnev
edc7f30b9c Remove the custom smartypants code
Instead rely on docutils’ ‘smart_quotes’ option which is available
since docutils 0.10.

This adds support for internationalization: our code supported only
English quotes, while docutils code supports 27 different languages.

Closes #498, #580, #3345, #3472.
2017-04-25 14:17:13 +03:00
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00