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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated documents doesn't support Chinese chractors #134

Closed
koala2012 opened this issue Jul 7, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@koala2012
Copy link

commented Jul 7, 2017

how to generated documents within Chinese chractors

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2017

I don't understand the question. If something isn't working, them please provide a bug report that others can reproduce.

@koala2012

This comment has been minimized.

Copy link
Author

commented Jul 7, 2017

I mean code within some of comments. these comments in Chinese, when I using pdoc --html xx.py command, I got the ascii error, How can fixed it?

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2017

Please provide a minimal reproducible example.

@koala2012

This comment has been minimized.

Copy link
Author

commented Jul 7, 2017

#coding=utf-8


import pandas as pd


class Test():
	def __init__():
		'''这是一个测试'''
		pass

	def TestName(testName, id):
		'''Test name '''
		pass

cod as above. I have comments in Chinese

but once I am trying to 'pdoc --html xx.py' generate the document. got the below error:

Traceback (most recent call last):
  File "/Users/Larry/anaconda2/bin/pdoc", line 505, in <module>
    html_out(module, args.html)
  File "/Users/Larry/anaconda2/bin/pdoc", line 342, in html_out
    source=not args.html_no_source)
  File "/Users/Larry/anaconda2/lib/python2.7/site-packages/pdoc/__init__.py", line 678, in html
    **kwargs)
  File "/Users/Larry/anaconda2/lib/python2.7/site-packages/mako/template.py", line 462, in render
    return runtime._render(self, self.callable_, args, data)
  File "/Users/Larry/anaconda2/lib/python2.7/site-packages/mako/runtime.py", line 838, in _render
    **_kwargs_for_callable(callable_, data))
  File "/Users/Larry/anaconda2/lib/python2.7/site-packages/mako/runtime.py", line 873, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/Users/Larry/anaconda2/lib/python2.7/site-packages/mako/runtime.py", line 899, in _exec_template
    callable_(context, *args, **kwargs)
  File "_html_mako", line 242, in render_body
  File "_html_mako", line 38, in show_module
  File "_html_mako", line 566, in render_show_module
  File "_html_mako", line 439, in show_func
  File "_html_mako", line 447, in show_desc
  File "_html_mako", line 381, in render_show_desc
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 0: ordinal not in range(128)
@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2017

Thanks, I can reproduce that. Looks like there's an encoding bug somewhere.

@koala2012

This comment has been minimized.

Copy link
Author

commented Jul 7, 2017

one more question.

I have a class inherent lib unittest.TestCase , once I run command, the third party lib's methods have been generated in document, I don't to like this. I only want to generate my defined class methods in documents. How to do that?

`import unittest

class Test(unittest.TestCase):

def  setUp(self):
	pass

def test_code(testName, id):
	'''Test name '''
	pass

`

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2017

Please see the documentation for pdoc: http://pdoc.burntsushi.net/pdoc --- In particular, pdoc respects Python's __all__ idiom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.