Commit Graph

115 Commits

Author SHA1 Message Date
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00
Ray Lehtiniemi
06b6e07b98 Add tests
Signed-off-by: Ray Lehtiniemi <rayl@mail.com>
2017-03-11 13:40:47 -07:00
Takeshi KOMIYA
675b5f4237 literalinclude directive allows combination of :pyobject: and :lines: 2017-02-22 00:29:24 +09:00
Takeshi KOMIYA
6b29792994 Fix typo 2017-02-18 22:43:27 +09:00
Takeshi KOMIYA
ce5d506fc4 Add testcases 2017-02-18 14:49:56 +09:00
Takeshi KOMIYA
2ebcbc882e Refactor testcases 2017-02-18 00:12:54 +09:00
Takeshi KOMIYA
d1b5f7227d Merge branch 'master' into refactor_literalinclude 2017-02-17 23:37:35 +09:00
Takeshi KOMIYA
88b84a532f Add testcase for :lineno-match: option 2017-02-17 23:36:12 +09:00
Jean-François B
32817f9efa Merge pull request #3413 from jfbu/literalincludelines
If ``:start-after:`` is used, make ``:lines:`` relative (close: #3412)
2017-02-17 09:00:40 +01:00
Takeshi KOMIYA
e1da72b59c Reduce DeprecationWarnings for regexp 2017-02-17 02:01:04 +09:00
Takeshi KOMIYA
6b20c72521 Add testcases for LiteralIncludeReader 2017-02-13 00:04:15 +09:00
jfbu
f7e5043949 disambiguate `test_literal_include_lineno_match` 2017-02-10 17:58:11 +01:00
jfbu
a2338e4838 If `:start-after: is used, make :lines:` relative (close: #3412) 2017-02-10 16:55:28 +01:00
Takeshi KOMIYA
cf2061dfad Fix flake8 violations 2017-01-26 01:13:17 +09:00
shimizukawa
baaef9146d pytest: remove deprecated with_app decorator functions 2017-01-06 01:14:47 +09:00
Takeshi KOMIYA
9fc53cecf7 Reduce deprecation warnings (refs: #3192) 2016-12-15 17:15:49 +09:00
jfbu
2e9ee59ee9 fix tests for latex build 2016-12-08 21:43:04 +01:00
Takeshi KOMIYA
111b7f4c72 Merge pull request #2843 from rthardin/issue_625_start_at_end_at
Add :start-at: and :end-at: parameters for literalinclude
2016-10-12 19:54:33 +09:00
Takeshi KOMIYA
cfddf17d35 Fix #2931: code-block directive with same :caption: causes warning of duplicate target 2016-09-17 18:13:17 +09:00
Ryan Hardin
560b5725c9 Added :start-at: and :end-at: parameters for literalinclude
This feature is discussed as part of issue #625.
2016-08-10 11:15:10 -04:00
Ville Skyttä
7cfbc2a702 Fix style checks 2016-07-07 16:48:12 +03:00
jfbu
01f1696d9b Remove usage by sphinx.sty of latex package newfloat.sty 2016-06-19 16:22:49 +02: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
jfbu
673222f20a Added Tests for latex(pdf) links to captioned or named literal blocks
As conf.py has now numfig = True, needed to modify accordingly test for
links in html output.

This topic branch fixes #2405, #2414, and also makes for latex(pdf)
functional hyperlinks to named references, but only for literal blocks
(code-block or literalinclude).

	modified:   tests/roots/test-directive-code/caption.rst
	modified:   tests/roots/test-directive-code/conf.py
	new file:   tests/roots/test-directive-code/namedblocks.rst
	modified:   tests/test_directive_code.py
2016-04-10 20:45:59 +02:00
jfbu
261ff1a9d2 Enable pdf hyperlinks to named literal-blocks without caption.
This is tango between latex.py and sphinx.sty to handle PDF hyperlinks
to literal-blocks (both code-block and literalinclude) either with name
or caption (then numref can be used) or both.

	modified:   sphinx/texinputs/sphinx.sty
	modified:   sphinx/writers/latex.py

This test file is now back to original.

	modified:   tests/test_directive_code.py
2016-04-07 11:27:33 +02:00
jfbu
a1647b6bb9 Fix broken numeric reference in PDF hyperlinks to "Listing " code-blocks
The `\label` is now inserted into the caption on top of the Verbatim,
and `\ref` will work as expected. No need for `\phantomsection`.

	modified:   sphinx/writers/latex.py
	modified:   tests/test_directive_code.py
2016-04-03 16:31:35 +02:00
Takeshi KOMIYA
9d82cad19d Merge pull request #2297 from jfbu/literalblockcaption
LaTeX captions of literal blocks now glued to framed verbatim
2016-03-06 15:01:52 +09:00
jfbu
12c6c9dad2 Fix broken test_literalinclude_caption_latex
modified:   tests/test_directive_code.py
2016-03-04 13:11:00 +01:00
jfbu
038dd00777 Changes of LaTeX macro names in sphinx.sty to use Sphinx prefix.
modified:   sphinx/texinputs/sphinx.sty
	modified:   sphinx/writers/latex.py
	modified:   tests/test_directive_code.py
2016-03-04 12:46:34 +01:00
jfbu
89e8cb3459 Address #2262 (latex): avoid pagebreaks after captions of literal blocks
This could fix https://github.com/sphinx-doc/sphinx/issues/2262

The 1.3.5 Verbatim environment from sphinx.sty has many places allowing
a page break after the caption: from the \smallskip, from the list
environment, and from the \MakeFramed: indeed framed package
documentation explains that it encourages page breaks above it.

The only way to avoid the pagebreaks is to put the caption inside the
environment whic is started by \MakeFramed. However, as this environment
typesets multiple times its contents, we must inhibit within it the
increase of counters (only the literal-block counter is concerned), this
is done thanks to a switch provided by the package amsmath which is
already loaded by sphinx.sty.

	modified:   sphinx/texinputs/sphinx.sty
	modified:   sphinx/writers/latex.py
	modified:   tests/test_directive_code.py
2016-02-10 10:50:52 +01:00
shimizukawa
b1a23817fc Merge with 'stable' 2016-01-24 13:47:51 +09:00
shimizukawa
0f2e62db24 Fix #2253: `:pyobject: option of literalinclude` directive can't detect indented body block when the block starts with blank or comment lines. 2016-01-20 22:50:59 +09:00
Georg Brandl
4f72bdb722 Merge branch 'stable' 2016-01-14 22:54:08 +01:00
Georg Brandl
46d7e8558e Obligatory copyright update. 2016-01-14 22:54:04 +01:00
Takeshi KOMIYA
4234c88f21 Fix #2113: Allow `:class:` option to code-block directive 2015-12-20 22:44:32 +09:00
Takaaki AOKI
07ed539ad3 modify test strings to be found after build_latex 2015-12-10 00:13:37 +09:00
shimizukawa
3ad810406c Fixed #1869: Fix problems when dealing with files containing non-ASCII characters. 2015-07-25 19:02:47 +02:00
Takeshi KOMIYA
64d2f22eb4 Fix #1790 literalinclude strips empty lines at the head and tail 2015-04-02 14:48:14 +09:00
Takeshi KOMIYA
aa66e7860b Fix #1789 :pyobject: option of literalinclude directive includes following lines after definitions 2015-04-02 14:47:51 +09:00
shimizukawa
e2a921ff07 refs #1742: :name: option is provided for toctree, code-block and literalinclude dirctives. 2015-03-08 21:59:37 +09:00
Georg Brandl
a23903d8d5 Merge branch 'stable' 2015-01-03 21:41:14 +01:00
Jeppe Pihl
29af67f438 merge 2014-10-06 20:31:30 +02:00
Takayuki Shimizukawa
6c0b4f1933 Merged in tk0miya/sphinx (pull request #304)
numfig feature improvement
2014-10-06 21:45:25 +09:00
Jeppe Pihl
a3745cfb5e merge 2014-10-06 10:35:33 +02:00
Takayuki Shimizukawa
b6b6f8ad79 Fix test for previous change.
Fix. <caption> node should not include <paragraph> block element as a result of nested_parse.
2014-10-06 07:10:52 +09:00
tk0miya
777218580a Surround fignum and caption with <span> tag 2014-10-05 20:55:46 +09:00
tk0miya
a875e8f377 Set permanent links to every captions and titles 2014-10-05 16:27:38 +09:00
Jeppe Pihl
22c8382880 added tests for linenos, lineno-start, lineno-match 2014-10-04 17:48:55 +02:00
tk0miya
7c7a563426 Fix by review comment 2014-09-26 20:15:17 +09:00
tk0miya
3ad1f1c164 Merge with default 2014-09-24 00:43:47 +09:00
tk0miya
5f96826ffc Merge with default 2014-09-23 17:58:02 +09:00
Georg Brandl
cdaf4b0a52 remove a few unused imports 2014-09-21 20:28:37 +02: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
tk0miya
d076452199 do nested_parse() :caption: of code-block directive 2014-09-19 12:04:25 +09:00
tk0miya
447c8c1d37 Wrap float environment on writing literal_block to latex 2014-09-19 11:08:07 +09:00
tk0miya
3c8bc8f5fd Merge upstream changes 2014-08-20 10:05:58 +09:00
tk0miya
3e1667290b Rename :filename: option of code-block directive to :caption: 2014-08-11 22:36:31 +09:00
Takayuki Shimizukawa
e5cb460d8b * update old XPath notation 2014-08-11 14:19:14 +09:00
Takayuki Shimizukawa
d39327d539 * for pull request #258: update CHANGES, add tests, add a document and refactoring. 2014-08-10 23:03:02 +09:00