pycco-docs / pycco Goto Github PK
View Code? Open in Web Editor NEWLiterate-style documentation generator.
Home Page: https://pycco-docs.github.io/pycco/
License: Other
Literate-style documentation generator.
Home Page: https://pycco-docs.github.io/pycco/
License: Other
I think that the line here: http://github.com/fitzgen/pycco/blob/master/pycco#L143
Means that to be "source": source, not sources?
If the HTML output were ordered differently (in seperate <div>
s, I suppose), it would be possible to select, copy and past source code which is otherwise seperated by comments.
Ever since I used pycco, I am in love with it. It is really awesome and handy. Though I faced one problem. While recursively generating docs, I end up having a lot of html files in nested dirs (as code). Is there any way to get all of them listed nicely just using the tool? I hate the manual work of linking the html to a index.html file
Hi,
I have noticed some formatting issues with pycco and then used the file at https://github.com/pycco-docs/pycco/blob/master/pycco/main.py to reproduce the output rendering as at https://pycco-docs.github.io/pycco/ (Please see the screenshot below). As you can see the comments within """ and """ are not properly formatted.
The parser (I think there is something wrong with your reg.exp, but I have not investigated it further) mess up when you use two [[file]]-statements in the same comment block. Like this:
# This file depends on [[file1.py]] and [[file2.py]].
The resulting HTML looks like:
This file depends on [file1.py]] and [file2.py.
You do this in one of the pycco-comments, but the bug does not trigger, since there are some other markup between.
The testcase at https://github.com/mdornseif/pycco/blob/master/testcases/python.py results i the function definition being parsed as documentation, not code.
Currently it's difficult to determine whether changes to Pycco will introduce backwards incompatibilities. Test cases would greatly alleviate this problem.
Hi! First of all, thanks for creating this project. :)
I've found a parsing bug related to triple quotes. This is how to reproduce:
If I create a file named test.py
with the following contents:
def test():
"""this is a test
this line will break parsing because triple quotes finish here, not the next line."""
pass
Then, run:
pycco test.py
And open docs/test.html
in the browser, I'll get:
If I change the file to:
def test():
"""this is a test
this line will break parsing because triple quotes finish here, not the next line.
"""
pass
Then the output will be:
I'd like to import the pycco module in my own python build script, but currently there are a few show stoppers:
File "/usr/local/lib/python2.6/dist-packages/Pycco-0.2.0-py2.6.egg/pycco/main.py", line 92, in parse
line = re.sub(language["multiend"],'',line)
File "/usr/lib/python2.6/re.py", line 151, in sub
return _compile(pattern, 0).sub(repl, string, count)
File "/usr/lib/python2.6/re.py", line 245, in _compile
raise error, v # invalid expression
They should probably be slash escaped but this breaks actual matching.
Languages like PHP have multiple comment styles (//
and #
for single line comments). Currently the code only supports one single-line comment style and one multi-line comment style (optionally).
Two possible solutions:
Turn "symbol"
definition into a List of symbol styles or allow a List to be specified optionally. PHP support could then be added like this:
".php": { "name": "php", "symbol": ["//", "#"]}
Use regular expressions for "symbol"
, "multistart"
, and "multiend"
. PHP support could then be added like this:
".php": { "name": "php", "symbol": r"//|#"}
Is it possible to add, say, -r
(--recursive
) option to allow building documentation for all folders and subfolders in given directoy?
$ pycco -r dir
# Should generate docs like this:
dir/__init__.py
dir/subdir/__init__.py
dir/subdir/package.py
dir/subdir/subdir2/__init__.py
dir/subdir/subdir/...
...
I just installed pycco using pip
and was wondering why the background was not staying behind the code when scrolling horizontally, which was fixed over a year ago. It turns out there hasn't been a new version for quite some time :) It'd be great if a new version could be released!
Given the following test.js
file:
/*
comment
*/
The command pycco test.js && grep err docs/test.html && echo "bad" || echo "ok"
prints ok for 22e157e but prints bad for a5c7c78 (used git bisect).
I think pycco should not print <div class="highlight"><pre><span class="o">*</span><span class="err">/</span></pre></div>
. but only <div class="highlight"><pre></pre></div>
. It's only the code section that appears to be affected by the bug, not the docs.
[$]> pycco ../lastfm-tail/bin/lastfm-tail
Traceback (most recent call last):
File "/Users/pearson/Documents/docdrop/env/bin/pycco", line 8, in <module>
load_entry_point('Pycco==0.3.0', 'console_scripts', 'pycco')()
File "/Users/pearson/Documents/docdrop/env/lib/python2.6/site-packages/pycco/main.py", line 480, in main
process(sources, outdir=opts.outdir, preserve_paths=opts.paths)
File "/Users/pearson/Documents/docdrop/env/lib/python2.6/site-packages/pycco/main.py", line 417, in process
next_file()
File "/Users/pearson/Documents/docdrop/env/lib/python2.6/site-packages/pycco/main.py", line 411, in next_file
f.write(generate_documentation(s, preserve_paths=preserve_paths, outdir=outdir))
File "/Users/pearson/Documents/docdrop/env/lib/python2.6/site-packages/pycco/main.py", line 46, in generate_documentation
sections = parse(source, fh.read())
File "/Users/pearson/Documents/docdrop/env/lib/python2.6/site-packages/pycco/main.py", line 66, in parse
language = get_language(source)
File "/Users/pearson/Documents/docdrop/env/lib/python2.6/site-packages/pycco/main.py", line 324, in get_language
return languages[ source[source.rindex("."):] ]
KeyError: './lastfm-tail/bin/lastfm-tail'
The problem is with source.rindex(".")
- when a file doesn't have an extension, this splits on the ..
part of the relative path.
docstring should be treated as comments and converted as well
For convenience I use string formatting to substitute recurring strings, especially descriptions of arguments, in docstrings. Pycco's output just has %s in these places.
font-size for pre and code elements needs to be moved from the .docs p tt, .docs p code
selector up to the .docs pre
selector.
Results in:
.docs pre {
margin: 15px 0 15px;
padding-left: 15px;
font-size: 12px;
}
.docs p tt, .docs p code {
background: #f8f8ff;
border: 1px solid #dedede;
padding: 0 0.2em;
}
Thanks! For the excellent port. It works fantastic with various sources. However, when I try to generate docs for .h files, I get the following error:
[jupiter@localhost app]$ $pycco core/*.h
Traceback (most recent call last):
File "/usr/bin/pycco", line 9, in
load_entry_point('Pycco==0.3.0', 'console_scripts', 'pycco')()
File "/usr/lib/python2.6/site-packages/pycco/main.py", line 480, in main
process(sources, outdir=opts.outdir, preserve_paths=opts.paths)
File "/usr/lib/python2.6/site-packages/pycco/main.py", line 417, in process
next_file()
File "/usr/lib/python2.6/site-packages/pycco/main.py", line 411, in next_file
f.write(generate_documentation(s, preserve_paths=preserve_paths, outdir=outdir))
File "/usr/lib/python2.6/site-packages/pycco/main.py", line 46, in generate_documentation
sections = parse(source, fh.read())
File "/usr/lib/python2.6/site-packages/pycco/main.py", line 66, in parse
language = get_language(source)
File "/usr/lib/python2.6/site-packages/pycco/main.py", line 324, in get_language
return languages[ source[source.rindex("."):] ]
KeyError: '.h'
pycco is rad but seems to fall down on docstrings.
If I have a function with a docstring like this:
def foo():
"""This is a docstring."""
The closing triplequotes seem to be missed by the parser. When I try putting them on a new line:
def foo():
"""This is a docstring.
Ok, I'll just use a multiline docstring...
"""
There is ugly whitespace and the docstring is treated like a comment on the code inside the function and not on the function itself. .
While in the same directory as main.py I ran this command to enable regeneration: pycco -w main.py
Note that in the same dir, pycco -w main.py works perfectly and watchdog is currently installed.
However this was returned:
pycco = main.py -> docs\main.html
Traceback (most recent call last):
File "C:\Python27\Scripts\pycco-script.py", line 9, in
load_entry_point('Pycco==0.3.0', 'console_scripts', 'pycco')()
File "C:\Python27\lib\site-packages\pycco\main.py", line 492, in main
monitor(sources, opts)
File "C:\Python27\lib\site-packages\pycco\main.py", line 456, in monitor
observer.start()
File "C:\Python27\lib\site-packages\watchdog\observers\api.py", line 255, in s
tart
emitter.start()
File "C:\Python27\lib\site-packages\watchdog\utils__init__.py", line 111, in
start
self.on_thread_start()
File "C:\Python27\lib\site-packages\watchdog\observers\read_directory_changes.
py", line 70, in on_thread_start
self._handle = get_directory_handle(self.watch.path)
File "C:\Python27\lib\site-packages\watchdog\observers\winapi.py", line 278, i
n get_directory_handle
None, OPEN_EXISTING, WATCHDOG_FILE_FLAGS, None)
File "C:\Python27\lib\site-packages\watchdog\observers\winapi.py", line 116, i
n _errcheck_handle
raise ctypes.WinError()
WindowsError: [Error 3] The system cannot find the path specified.
pip install pycco
cd /usr/local/lib/python2.6/dist-packages/pycco
(As one example).pycco main.py
(That is to say, run pycco against the pycco source)Page identical to http://fitzgen.github.com/pycco/ appears.
I believe this page is getting generated correctly, EXCEPT that all
the <> in the HTML are being escaped (presumably by pystache) into
< and >, so the page is more-or-less the raw HTML instead of the
rendered HTML. The pypi package of pystache was updated 3-25-12, so
I'm guessing this is what has caused pycco to fail. I haven't looked
into whether this is a bug on the pystache side as opposed to the
pycco side.
My guess is that pycco is just not using the un-escaping versions of mustache tags
{{&..}} and {{{..}}}, but what do I know? My extremely quick attempt at resolving the issue
didn't fix it.
http://stackoverflow.com/questions/27788586/have-pycco-recognize-doctests-as-code
Is there any way to have Pycco recognize doctests as code and render them appropriately?
E.g. the docstring of the following function
def fib(i):
""" Fibonacci number
>>> fib(10)
55
"""
if i < 2:
return i
else:
return fib(i-1) + fib(i-2)
Renders In Pycco like the following
Fibonacci number
fib(10) 5
Clearly the >>> was interpretted as indentation and code highlighting did not take effect. This seems like a common use case. is there a plugin somewhere that I'm missing?
How do I get an h3
header (f.e. the "Main Documentation Generation Functions" in http://fitzgen.github.com/pycco/)?
I'm writing Javascript and whenever I do:
// === Yadda ===
I get an em
instead of an h3
.
fitzgen@mendel :: ~/src/ot/erl-ot/src
$ pycco ot.erl
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7/bin/pycco", line 9, in
load_entry_point('Pycco==0.1.2', 'console_scripts', 'pycco')()
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Pycco-0.1.2-py2.7.egg/pycco/main.py", line 398, in main
process(sources, outdir=opts.outdir, preserve_paths=opts.paths)
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Pycco-0.1.2-py2.7.egg/pycco/main.py", line 383, in process
next_file()
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Pycco-0.1.2-py2.7.egg/pycco/main.py", line 377, in next_file
f.write(generate_documentation(s, outdir=outdir))
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Pycco-0.1.2-py2.7.egg/pycco/main.py", line 37, in generate_documentation
sections = parse(source, fh.read())
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Pycco-0.1.2-py2.7.egg/pycco/main.py", line 77, in parse
multi_line_delimeters = [language["multistart"], language["multiend"]]
KeyError: 'multistart'
I'll get to this soon...
there's a website http://fitzgen.github.com/pocco - I guess it relates to this pycco project? Which is the correct name? Either change one or the other.
Lots of code in some langs (JS, Java) have existing comments of the form:
/** * Yadda, yadda, yadda, ... * * etc. */
Those stars per line in the comment body end up turning into bullets when markdown sees them. A way to optionally filter out those stars as junk would be useful.
Looking for the correct approach to make the generated index page searchable. Without adding a bunch of search code and weight, was thinking of adding the docstring to each link, or perhaps a tag option if docstrings muck up the index page too much. Then search could be a simple Find operation in the browser.
Is there a convention for this being considered, especially tags in docstrings? If the docstrings are long, can a collapse be added to the css yet still make the full text browser searchable?
Personally, looking to use this for both Python and SQL - largely the latter.
There is a small typo in pycco/main.py.
Should read occurrences
rather than occurences
.
I get a 'file not found' error on a local html resource when i run pocco.
I installed it w/ sudo python setup.py install
.
Tried:
pycco apps/*.py
pycco apps\*.py
The result is always:
Traceback (most recent call last):
File "C:\...\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\...\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "E:\workspace\venv\Scripts\pycco.exe\__main__.py", line 9, in <module>
File "e:\workspace\venv\lib\site-packages\pycco\main.py", line 631, in main
skip=args.skip_bad_files)
File "e:\workspace\venv\lib\site-packages\pycco\main.py", line 533, in process
next_file()
File "e:\workspace\venv\lib\site-packages\pycco\main.py", line 517, in next_file
with open(dest, "wb") as f:
OSError: [Errno 22] Invalid argument: 'docs\\*.html'
My project structure is something like:
- apps
- common
- core
- more_modules
- docs
I just caught Pocco on Reddit and gave it a whirl on my side-projects. The output looks great, but I include UTF-8 characters that make the file.write() call choke because Python tries to encode the Unicode as ASCII.
I wrote a two-liner to fix this here.
Also, in order to embed non-ASCII characters like that, you have to have a special comment at the top of the Python file, which isn't necessary to display.
I wrote another patch for this here.
Both of them might not fit with the rest of the codebase, I just whipped them up for my own purposes and thought I'd share. =)
Currently, you try to determine the "preferred" encoding and write out the generated doc files in that encoding. This doesn't make sense since UTF-8 is the de-facto default encoding for the web. Under Windows 7 i get something like 'cp1252' (Codepage 1252) as preferred encoding --> the doc export crashed (probably because of some umlauts in the comments).
When I changed fh.write(html.encode(getpreferredencoding()))
to fh.write(html.encode('utf-8'))
everything went ok
If a module has a docstring, e.g.
"""
This is the docstring
"""
print "module code starts here"
the docstring isn't converted properly.
Hi,
whatever.jsonschema.js filename will generate an html file named whateveronschema.html. It looks like languages extensions are replaced everywhere in the filename. I had the version from pip.
Regards.
The ensure_directory function crashes on my system:
http://github.com/fitzgen/pycco/blob/master/pycco#L238
Why are you using the fragile Popen/mkdir command to create your directory and not the much more solid os.makedirs()?
C:\TEMP\fitzgen-pycco-7f5e254\build\scripts-2.6>python pycco src/*.py
Traceback (most recent call last):
File "pycco", line 264, in
ensure_directory()
File "pycco", line 238, in ensure_directory
Popen(["mkdir", "-p", "docs"]).wait()
File "c:\python26\lib\subprocess.py", line 623, in init
errread, errwrite)
File "c:\python26\lib\subprocess.py", line 833, in _execute_child
startupinfo)
WindowsError: [Error 2] The System can't find the given file
I'm working on a fluid width layout using the CSS table model right now and would like to be able to tell pycco to source my own CSS file instead of the default. A command line switch to specify the CSS file or similar would be very useful for this and other scenarios.
The regex used by preprocess
requires a character other than a backtick prior to the first cross-reference in a comment, so if the comment starts with a cross-reference it is not handled correctly. To recreate, save the following sample as testing.py
and process with pycco testing.py
.
# ==Link Target==
def test_link():
"""[[testing.py#link-target]]"""
pass
Instead of [^
], a negative lookbehind
(?<!)
can be used to remove this requirement. This also means that the opening whitespace in the replacement strings in replace_crossref
is no longer required.
I feel like this should be valid
Hi,
Try to use pycco, but caught error:
Traceback (most recent call last):
C:\TEMP>pycco -d doc2 -p test
pycco: test\Base.py -> doc2\test\Base.html
Traceback (most recent call last):
File "C:\Python27\Scripts\pycco-script.py", line 11, in
load_entry_point('Pycco==0.5.1', 'console_scripts', 'pycco')()
File "c:\python27\lib\site-packages\pycco\main.py", line 618, in main
skip=opts.skip_bad_files)
File "c:\python27\lib\site-packages\pycco\main.py", line 531, in process
next_file()
File "c:\python27\lib\site-packages\pycco\main.py", line 530, in next_file
next_file()
File "c:\python27\lib\site-packages\pycco\main.py", line 519, in next_file
encoding=encoding))
File "c:\python27\lib\site-packages\pycco\main.py", line 51, in generate_documentation
code = open(source, "rb").read().decode(encoding)
File "c:\python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 1: invalid continuation byte
When I parse this docstring
"""
This is the first code sample
alpha
This is the second code sample
gamma
"""
... I get the following format:
This is the first code sample
alpha
This is the second code sample
gamma
But if I indent the second code block further, like this:
"""
This is the first code sample
alpha
This is the second code sample
gamma
"""
... I get the desired output:
This is the first code sample
alpha
This is the second code sample
gamma
The problem vanishes if https://github.com/fitzgen/pycco/blob/master/pycco/main.py#L128 is changed from
last_scope = current_scope if current_scope > last_scope else last_scope
... to ...
last_scope = current_scope
Is this a valid change? Or would it break something?
Regards
Anand
Consider this Python source snippet:
# Top-level comment
if True:
class MyClass:
def mymethod(self):
if True:
# Innermost comment
print "Success"
When run through Pycco, this produces approximately:
nesting.py
Top-level comment | if True:
|
Innermost comment | print "Success"
If I want the source code to be displayed correctly, I need to add either a comment or a docstring to every indentation level:
# Top-level comment
if True:
class MyClass:
"""Docstring for MyClass"""
def mymethod(self):
"""Docstring for mymethod"""
# dummy comment for the if clause
if True:
# Innermost comment
print "Success"
Maybe this is by design and is meant to encourage generous use of comments, but for me it feels cumbersome and is a blocker for using Pycco for larger existing codebases.
Hello maintainer! Any plan to make a new release soonish? I'd like to use --skip-bad-files
in the project I'm working on 😃. If not, I can publish my own release of pycco on Pypi and use that one. Thanks!
I embed pycco documentation in Sphinx directories, and there's no easy way to add the css file to that. I now use sed to insert the css into each html file, but it would be better if there were an option to do that.
A special case needs to be added for python multi-line comments. It's a special situation since, A) the start and end delimiters are identical, and B) multi-line comments can be used in string assignment.
So, given the python file:
s = """
hello world. my name is bob.
"""
print s
Pycco will search for """
at the beginning of each line of code and mark the third line as the beginning of a multi-line comment block, placing print s
in the left column of the rendered html as a part of a comment, while hello world. my name is bob.
appears on the right as code.
A quick fix might be to simply detect any """
that is preceded by non-whitespace and set a flag that will allow pycco to ignore the next """
that appears in the code.
Hi!
I tried to use pycco today to document some tutorial code. That code lives in rpy
files -- long story short, they're Python, except they allow me to do some webby stuff with Twisted with less boilerplate.
Obviously, in order to teach pycco how to deal with that, I had to edit the source. It's kind of shitty that people need my specific modified version of pycco to get anything done. Ideally pycco would be able to figure out it's Python, despite the funky extension.
I have two potential solultions to this problem:
pycco --force-type=.py ...
python-magic
(Python bindings for libmagic) when available to figure out what kind of file something is, instead of relying on the extension. This does not mean an extra dependency: you can try to use magic, if it doesn't work, fall back to the extension mechanism.Which one do you like best? Perhaps both can live side by side? If my pycco + sphinx prototypal documentation is received well, I might implement it.
cheers,
lvh
I have a project with many *.py
files, when I run pycco command to generate docs for all py files, it will raise RecursionError: maximum recursion depth exceeded while calling a Python object
pycco app/**/*py --directory=tech-docs -p -i -s
Python version: 3.6.2
Pycco version: 0.6.0
Traceback (most recent call last):
File "/Users/emadmokhtar/.virtualenvs/project/bin/pycco", line 11, in <module>
sys.exit(main())
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco/main.py", line 631, in main
skip=args.skip_bad_files)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco/main.py", line 533, in process
next_file()
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco/main.py", line 532, in next_file
next_file()
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco/main.py", line 532, in next_file
next_file()
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco/main.py", line 532, in next_file
next_file()
[Previous line repeated 960 more times]
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco/main.py", line 521, in next_file
encoding=encoding))
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco/main.py", line 80, in generate_documentation
return _generate_documentation(source, code, outdir, preserve_paths, language)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco/main.py", line 90, in _generate_documentation
return generate_html(file_path, sections, preserve_paths=preserve_paths, outdir=outdir)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco/main.py", line 340, in generate_html
"source": source,
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pycco_resources/__init__.py", line 243, in <lambda>
return lambda context: pystache.render(source, context)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/init.py", line 19, in render
return renderer.render(template, context, **kwargs)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/renderer.py", line 454, in render
return self._render_string(template, *context, **kwargs)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/renderer.py", line 402, in _render_string
return self._render_final(render_func, *context, **kwargs)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/renderer.py", line 419, in _render_final
return render_func(engine, stack)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/renderer.py", line 400, in <lambda>
render_func = lambda engine, stack: engine.render(template, stack)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/renderengine.py", line 181, in render
return parsed_template.render(self, context_stack)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/parsed.py", line 47, in render
parts = list(map(get_unicode, self._parse_tree))
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/parsed.py", line 46, in get_unicode
return node.render(engine, context)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/parser.py", line 218, in render
parts.append(self.parsed.render(engine, context))
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/parsed.py", line 47, in render
parts = list(map(get_unicode, self._parse_tree))
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/parsed.py", line 46, in get_unicode
return node.render(engine, context)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/parser.py", line 121, in render
s = engine.fetch_string(context, self.key)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/renderengine.py", line 105, in fetch_string
val = self.resolve_context(context, name)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/renderer.py", line 317, in resolve_context
return context_get(stack, name)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/renderengine.py", line 19, in context_get
return stack.get(name)
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/context.py", line 281, in get
result = self._get_simple(parts[0])
File "/Users/emadmokhtar/.virtualenvs/project/lib/python3.6/site-packages/pystache/context.py", line 309, in _get_simple
for item in reversed(self._stack):
RecursionError: maximum recursion depth exceeded while calling a Python object
Fresh pycco installation raises an exception:
virtualenv venv
./venv/bin/pip install pycco
./venv/bin/pycco a.py
Traceback (most recent call last):
File "./venv/bin/pycco", line 9, in <module>
load_entry_point('Pycco==0.2.0', 'console_scripts', 'pycco')()
File "/tmp/a/venv/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/pkg_resources.py", line 299, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/tmp/a/venv/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/pkg_resources.py", line 2229, in load_entry_point
return ep.load()
File "/tmp/a/venv/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/pkg_resources.py", line 1948, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/tmp/a/venv/lib/python2.6/site-packages/pycco/__init__.py", line 1, in <module>
from .main import *
File "/tmp/a/venv/lib/python2.6/site-packages/pycco/main.py", line 308, in <module>
l["lexer"] = lexers.get_lexer_by_name(l["name"])
File "/usr/lib/pymodules/python2.6/pygments/lexers/__init__.py", line 84, in get_lexer_by_name
raise ClassNotFound('no lexer for alias %r found' % _alias)
pygments.util.ClassNotFound: no lexer for alias 'coffee-script' found
Currently the code assumes that all languages have single line comments. Some languages, such as HTML, only have multiline comments. There is a lot of code which is dependent on l["symbol"]
.
Hi,
I suggest to you to append HTML support language to document HTML/template… structure.
The comment will be in HTML comment syntax.
Regards,
Stephane
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.