Commit Graph

146 Commits

Author SHA1 Message Date
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
Dmitry Shachnev
1717a95a77 Fix a test failure which was uncovered by the previous change
In PR #3527 the LaTeX output for quotes has changed, but the test was
not updated.
2017-03-15 11:29:50 +03:00
Dmitry Shachnev
6e0467ca77 test_markup: Make verify functions test both HTML and LaTeX outputs
Previously it would return after performing the HTML check, without
running the LaTeX one.
2017-03-14 22:34:51 +03:00
Jean-François B
3128a4327d More robust hyperlink macros in LaTeX output (refs #3317, #3340, #3533) (#3538)
More robust hyperlink macros in LaTeX output (refs #3317, #3340, #3533)
2017-03-11 16:53:53 +01:00
Takeshi KOMIYA
cf2061dfad Fix flake8 violations 2017-01-26 01:13:17 +09:00
shimizukawa
561abdd164 pytest optimizatoin:
- remote using deprecated decorators
- remove gen_with_app
- remove yield testing
- remove pytest warnings
- refactoring
2017-01-08 15:14:38 +09:00
shimizukawa
baaef9146d pytest: remove deprecated with_app decorator functions 2017-01-06 01:14:47 +09:00
Takeshi KOMIYA
50bf7960bd Uninstall sphinx directives and roles of domains after build 2016-09-21 10:48:52 +09:00
Takeshi KOMIYA
f8c1c65c21 Refactor sphinx.environment: Reimplemnt process_refonly_bullet_lists() as a transform 2016-09-15 02:29:50 +09:00
Takeshi KOMIYA
d281a32b3b Refactor sphinx.environment: Reimplement filter_messages() as a transform 2016-09-15 02:29:50 +09:00
Takeshi KOMIYA
8a9459b308 Merge branch 'stable' 2016-08-09 23:19:11 +09:00
Yoshiki Shibukawa
90b3c79895 fix html entity to fix epub error 2016-08-09 16:58:56 +09:00
jfbu
b3d8961ca8 Enhance latex text styling customizability 2016-06-17 19:48:52 +02:00
jfbu
c2d417a032 Rename SphinxVerbatim to sphinxVerbatim for latex output 2016-06-15 18:34:00 +02:00
jfbu
2cec5a25b2 Merge branch 'stable'
Conflicts:
	sphinx/domains/cpp.py
	sphinx/texinputs/sphinx.sty
	tests/test_build_latex.py
2016-06-15 18:29:58 +02:00
jfbu
5510653d6e Fix #2629. Add new config option `latex_keep_old_macro_names`
The cause of the issue was a clash about ``\titleref`` macro being already
defined in memoir class context. To avoid similar problems, this makes
the text styling macros

  ``\strong``, ``\code``, ``\bfcode``, ``\email``, ``\tablecontinued``,
  ``\titleref``, ``\menuselection``, ``\accelerator``, ``\crossref``,
  ``\termref``, ``\optional``,

also available with ``\sphinx`` prefix, with a conf.py boolean option to
let sphinx.sty only define ``\sphinx``-prefixed macros. As default value
is False, backwards compatibility is maintained.

On this occasion, some internal non-public macros have been renamed with
prefix ``\spx@``. The command

    find . -name '*.sty' -exec grep -l \\\\spx@ {} \;

has been executed in TeXLive 2015 and 2016 installations to check no
package defines macros starting with ``\spx@``.

Some internal macros having public names (because they are written by
latex.py into the body of the latex document) have been renamed to have
``\sphinx`` prefix. The macros in sphinx.sty starting with \py@, or \DU,
or \PYG have not been modified. Similarly ``\release``, ``\version``,
``\releasename``, etc... have not been renamed.
2016-06-15 08:53:24 +02:00
Takeshi KOMIYA
88c026d0bd Merge branch 'stable' 2016-06-12 00:42:47 +09:00
Takeshi KOMIYA
80921b2ab8 Fix flake8 violation under tests/ 2016-06-12 00:02:11 +09:00
jfbu
f9880bfcc8 latex: keep original Verbatim under same name, use SphinxVerbatim for own 2016-06-10 18:48:33 +02:00
Takeshi KOMIYA
9cd5ba994c Fix #2445: rst_prolog and rst_epilog affect to non reST sources 2016-05-25 21:25:04 +09:00
Takeshi KOMIYA
89360dd3f1 Add testcase for rst_prolog and rst_epilog 2016-05-25 21:24:31 +09:00
Takeshi KOMIYA
cea81e7a70 Define `\menuselection and \accelerator macros to redefine the style of menuselection` roles. 2016-02-25 20:58:01 +09:00
Georg Brandl
46d7e8558e Obligatory copyright update. 2016-01-14 22:54:04 +01:00
Takeshi KOMIYA
2c5c54aa67 Closes #1987: Fix ampersand is ignored in `:menuselection: and :guilabel:` on LaTeX builder 2015-09-01 00:29:03 +09:00
Georg Brandl
8a273d139b Fix generating emphasis nodes without semantic reason
Roles ``ref``, ``term`` and ``menusel`` now don't generate :durole:`emphasis`
nodes anymore.  If you want to keep italic style, adapt your stylesheet.
2015-02-25 15:51:47 +01:00
Takeshi KOMIYA
b563fa44f2 Fix #1620: Use VerbatimBorderColor to add frame to code-block in LaTeX 2015-01-18 15:32:17 +09:00
Georg Brandl
a23903d8d5 Merge branch 'stable' 2015-01-03 21:41:14 +01:00
Georg Brandl
567d52f199 all: update copyright 2015-01-03 21:36:32 +01:00
tk0miya
f51b945d89 Add frame to code-block in LaTeX 2014-10-08 21:52:33 +09:00
Georg Brandl
d47a7587f9 Complete test suite overhaul.
* rename a few test modules to make the names more consistent

* do not copy/use Sphinx from build/ (unnecessary without 2to3)

* use a temporary dir for *all* test projects, the source tree
  will stay pristine that way  (default is tests/build)

* speed up tests by ~3x by splitting up test projects and avoiding
  rebuilds
2014-09-21 17:17:02 +02:00
Georg Brandl
e21d669089 Test suite adapted after :option: changes. 2014-09-20 20:54:23 +02:00
tk0miya
0943375069 Fix #1476 replace <tt> tag by <code> 2014-08-12 12:12:10 +09:00
Takayuki Shimizukawa
ba4dcaa8dd use b prefix for bytes instead of sphinx.pycompat.b function. 2014-05-01 22:54:09 +09:00
Takayuki Shimizukawa
6ae3b68859 replace ur'' prefix with r'' to support py2/py3 in one source. refs #1350 2014-04-30 23:04:21 +09:00
Georg Brandl
e030031321 Update copyright year. 2014-03-01 08:18:16 +01:00
Georg Brandl
c5b4ff0adc * add a test for the parsed-literal directive
* adapt test to pygments output versus Sphinx-emulated nohighlighting output
2014-01-11 10:25:34 +01:00
Georg Brandl
1af3e3ea71 tests: replace "from util import *" by explicit imports 2013-04-01 11:39:32 +02:00
Georg Brandl
151856819c Copyright update. 2013-01-01 22:13:15 +01:00
Georg Brandl
411f82d9b9 Fix markup test with latest pygments-related updates. 2011-10-02 19:39:42 +02:00
Georg Brandl
5d936d5ff1 Fix :samp: latex tests. 2011-09-21 10:05:37 +02:00
Georg Brandl
17efae5622 merge with 1.0 2011-01-04 11:29:09 +01:00
Georg Brandl
0e1db6ad90 New year update. 2011-01-04 10:00:51 +01:00
Georg Brandl
8bcf1f4511 Fix long line. 2010-05-25 00:50:15 +02:00
Georg Brandl
0238e83013 Merge with http://bitbucket.org/tpowers/sphinx/ (rewriting the external/internal distinction code)
In HTML output, references now get the class ``internal`` if they are internal to the whole project, as opposed to internal to the current page.

The ``menuselection`` and ``guilabel`` roles now support ampersand accelerators.
2010-05-24 12:57:07 +02:00
Georg Brandl
ec5a5e739b Move the "b" function to pycompat. 2010-07-28 18:43:40 +02:00
Daniel Neuhäuser
24f1d4c12d fixed test_markup test 2010-05-24 19:41:02 +02:00
Georg Brandl
ea8fa8aa02 Fix test_markup. 2010-02-28 12:08:06 +01:00
Georg Brandl
b4d03d9ff3 In HTML output, inline roles now get a CSS class with their name,
allowing styles to customize their appearance.  Domain-specific
roles get two classes, ``domain`` and ``domain-rolename``.
2010-02-28 10:17:59 +01:00
Georg Brandl
93e9221d66 Fix backslash escape. 2010-02-20 19:53:44 +01:00
Georg Brandl
b01e689896 Make test work with docutils 0.5. 2010-02-20 19:51:37 +01:00
Georg Brandl
c8ccbf9ce8 Fix test suite. 2010-01-18 00:41:34 +01:00
Georg Brandl
c00fd08aa9 Clean up unused imports. 2010-01-17 12:02:15 +01:00
Georg Brandl
cbd75346fd merge with trunk 2010-01-07 19:17:45 +01:00
Georg Brandl
faeec5cbbb merge with trunk 2010-01-02 21:03:56 +01:00
Georg Brandl
47ccbccc62 merge with 0.6 2010-01-01 14:10:48 +01:00
Georg Brandl
f6a56192d1 Happy new year! 2010-01-01 14:09:13 +01:00
Georg Brandl
68c545cf22 Refactor directive/role lookup from domains a bit to avoid code duplication. 2009-09-12 10:14:27 +00:00
Georg Brandl
288af885c2 merge with 0.6 2009-06-04 18:47:43 +02:00
Georg Brandl
501adbdb6f #191: Don't escape the tilde in URIs in LaTeX. 2009-06-04 18:11:17 +02:00
Georg Brandl
a07daf48cf merge with 0.6 2009-05-10 20:59:55 +02:00
Georg Brandl
ef01782f42 #157: fix make check. 2009-05-10 20:59:08 +02:00
Georg Brandl
ae1c7f9d56 Fix a few stylistic nits. 2009-04-13 08:35:05 +00:00
Georg Brandl
5ea87fd6c4 Fix autosummary test suite. 2009-03-16 11:41:35 +01:00
Georg Brandl
9d0a9f3f41 Fix the test suite. 2009-03-16 11:24:19 +01:00
Georg Brandl
2ba9ec3456 More generator tests. 2009-02-21 17:16:56 +01:00
Georg Brandl
0b28b3e6f6 Switch copyright and license tags to single style. Add contributor
names in AUTHORS instead, and add the license of etree13 to
LICENSE.
2009-01-03 11:57:07 +01:00
Georg Brandl
aedbdd953d Fix more line length and trailing whitespace. 2009-01-10 22:18:18 +01:00
Georg Brandl
b4a866e2fb merge with main 2009-01-03 12:35:15 +01:00
Georg Brandl
4d083fabbe Add tests for new literalinclude options, and fix an off-by-one bug. 2009-01-03 12:29:42 +01:00
Georg Brandl
f16f94f2cd Merge in copyright style changes from 0.5. 2009-01-03 12:15:19 +01:00
Georg Brandl
26d7aafaae Explicitly refer to the license in :license: tags. 2008-12-27 12:19:17 +01:00
Georg Brandl
9175e665b1 Move builders and writers into new packages. 2008-11-29 19:56:58 +01:00
Georg Brandl
410ac72590 Fix test after latex writer change. 2008-11-23 15:21:57 +01:00
Georg Brandl
2f392028cf Adapt markup test to renaming of highlighting escapes. 2008-09-16 07:52:19 +00:00
Georg Brandl
e93af0e57c Merged revisions 65566-65567,65623,65625 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x

........
  r65566 | georg.brandl | 2008-08-07 09:11:11 +0000 (Thu, 07 Aug 2008) | 2 lines

  Clarification for the ref role.
........
  r65567 | georg.brandl | 2008-08-07 09:11:25 +0000 (Thu, 07 Aug 2008) | 2 lines

  Rebuild everything if extensions change.
........
  r65623 | georg.brandl | 2008-08-10 11:18:42 +0000 (Sun, 10 Aug 2008) | 2 lines

  Unify handling of LaTeX escaping, and add some more replacements.
........
  r65625 | georg.brandl | 2008-08-10 11:25:41 +0000 (Sun, 10 Aug 2008) | 2 lines

  Make tex escapes a module.
........
2008-08-10 16:59:27 +00:00
Georg Brandl
432115123e Merged revisions 65529 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x

........
  r65529 | georg.brandl | 2008-08-04 22:19:30 +0000 (Mon, 04 Aug 2008) | 6 lines

  Revert r65499 which was not well thought out. Instead, put
  the whole build dir in exclude_trees by default in quickstart.

  Also, revisit application cleanup and make it consistently use
  less setup time while still trying to leave to traces.
........
2008-08-04 22:20:44 +00:00
Georg Brandl
b4f71aa642 Merged revisions 65283,65303,65316-65317,65372-65375,65377,65380,65483-65485,65494 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x

........
  r65283 | georg.brandl | 2008-07-29 10:07:26 +0000 (Tue, 29 Jul 2008) | 2 lines

  Update ez_setup.py.
........
  r65303 | benjamin.peterson | 2008-07-30 12:35:34 +0000 (Wed, 30 Jul 2008) | 1 line

  add a with_testapp decorator for test functions that passes the TestApp instance in a cleans up after it
........
  r65316 | benjamin.peterson | 2008-07-30 23:12:07 +0000 (Wed, 30 Jul 2008) | 1 line

  make the app for test_markup global to the module
........
  r65317 | benjamin.peterson | 2008-07-30 23:31:29 +0000 (Wed, 30 Jul 2008) | 1 line

  make TestApp.cleanup more aggressive
........
  r65372 | georg.brandl | 2008-08-01 19:11:22 +0000 (Fri, 01 Aug 2008) | 2 lines

  Add more tests, fix a few bugs in image handling.
........
  r65373 | georg.brandl | 2008-08-01 19:28:33 +0000 (Fri, 01 Aug 2008) | 2 lines

  Fix oversight.
........
  r65374 | benjamin.peterson | 2008-08-01 19:36:32 +0000 (Fri, 01 Aug 2008) | 1 line

  fix one broken test
........
  r65375 | georg.brandl | 2008-08-01 19:41:11 +0000 (Fri, 01 Aug 2008) | 2 lines

  Fix the handling of non-ASCII input in quickstart.
........
  r65377 | georg.brandl | 2008-08-01 19:48:24 +0000 (Fri, 01 Aug 2008) | 2 lines

  Allow REs in markup checks.
........
  r65380 | georg.brandl | 2008-08-01 20:31:18 +0000 (Fri, 01 Aug 2008) | 2 lines

  Don't rely on mtimes being different for changed files.
........
  r65483 | georg.brandl | 2008-08-04 09:01:40 +0000 (Mon, 04 Aug 2008) | 4 lines

  Add an "encoding" option to literalinclude.

  Add tests for include directives.
........
  r65484 | georg.brandl | 2008-08-04 09:11:17 +0000 (Mon, 04 Aug 2008) | 2 lines

  Add changelog entry.
........
  r65485 | georg.brandl | 2008-08-04 09:21:58 +0000 (Mon, 04 Aug 2008) | 2 lines

  Fix markup.
........
  r65494 | georg.brandl | 2008-08-04 16:34:59 +0000 (Mon, 04 Aug 2008) | 2 lines

  Correctly use HTML file suffix in templates.
........
2008-08-04 17:01:15 +00:00
Georg Brandl
6c2f991be0 Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x

........
  r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines

  #3416: fix missing parameter.
........
  r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines

  Now that we don't ship Jinja anymore by default the comment can go.
........
  r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines

  Reread documents with globbed toctrees when files are removed/added.
........
  r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines

  Fix by Markus Gritsch to place correct links to headings.
........
  r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines

  Make the writer's settings public.
........
  r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines

  Export test_root.
........
  r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines

  Add a markup test.
........
  r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines

  Bump version number.
........
  r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines

  Correct rendering of ``samp``.
........
2008-07-29 09:07:37 +00:00