8000 Merge branch 'main' into noindex · astropy/sphinx-automodapi@c029e0e · GitHub
[go: up one dir, main page]

Skip to content

Commit c029e0e

Browse files
authored
Merge branch 'main' into noindex
2 parents db86362 + c4aa837 commit c029e0e

File tree

8 files changed

+66
-2
lines changed

8 files changed

+66
-2
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Changes in sphinx-automodapi
44
0.15.0 (unreleased)
55
-------------------
66

7+
- Fixed issue with non-ascii characters in object members when the encoding is not ``utf8`` [#153]
8+
79
0.14.1 (2022-01-12)
810
-------------------
911

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#
3939
# This is also used if you do content translation via gettext catalogs.
4040
# Usually you set "language" from the command line for these cases.
41-
#language = None
41+
language = 'en'
4242

4343
# List of patterns, relative to source directory, that match files and
4444
# directories to ignore when looking for source files.

sphinx_automodapi/automodsumm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst',
488488

489489
new_files.append(fn)
490490

491-
f = open(fn, 'w')
491+
f = open(fn, 'w', encoding='utf8')
492492

493493
try:
494494

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Ceçi est un exemple qui inclus des charactères non-ASCII
22

33
.. automodapi:: sphinx_automodapi.tests.example_module.functions
4+
.. automodapi:: sphinx_automodapi.tests.example_module.nonascii
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
NonAscii
2+
========
3+
4+
.. currentmodule:: sphinx_automodapi.tests.example_module.nonascii
5+
6+
.. autoclass:: NonAscii
7+
:show-inheritance:
8+
9+
.. rubric:: Methods Summary
10+
11+
.. autosummary::
12+
13+
~NonAscii.get_ß
14+
~NonAscii.get_äöü
15+
16+
.. rubric:: Methods Documentation
17+
18+
.. automethod:: get_ß
19+
.. automethod:: get_äöü

sphinx_automodapi/tests/cases/non_ascii/output/index.rst.automodapi

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,23 @@ Functions
1212
.. automodsumm:: sphinx_automodapi.tests.example_module.functions
1313
:functions-only:
1414
:toctree: api
15+
16+
17+
sphinx_automodapi.tests.example_module.nonascii Module
18+
------------------------------------------------------
19+
20+
.. automodule:: sphinx_automodapi.tests.example_module.nonascii
21+
22+
Classes
23+
^^^^^^^
24+
25+
.. automodsumm:: sphinx_automodapi.tests.example_module.nonascii
26+
:classes-only:
27+
:toctree: api
28+
29+
Class Inheritance Diagram
30+
^^^^^^^^^^^^^^^^^^^^^^^^^
31+
32+
.. automod-diagram:: sphinx_automodapi.tests.example_module.nonascii
33+
:private-bases:
34+
:parts: 1

sphinx_automodapi/tests/cases/non_ascii/output/index.rst.automodsumm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@
66
add
77
subtract
88
multiply
9+
.. currentmodule:: sphinx_automodapi.tests.example_module.nonascii
10+
11+
.. autosummary::
12+
:toctree: api
13+
14+
NonAscii
15+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
__all__ = ['NonAscii']
2+
3+
4+
class NonAscii(object):
5+
def get_äöü(self):
6+
"""
7+
Return a string with common umlauts like äöüß
8+
"""
9+
return 'äöü'
10+
11+
def get_ß(self):
12+
"""
13+
Return a string with the eszett symbol
14+
"""
15+
return 'ß'

0 commit comments

Comments
 (0)
0