pycco-docs / pycco

Literate-style documentation generator.

Home Page:https://pycco-docs.github.io/pycco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Formatting of HTML files seems to be wrong

sripirakas opened this issue · comments

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.

image

Hello, I'm obsering the same behavior.

I run pycco against it's own source file and it does not look like the way it should. It looks like the way in the picture above.

I guess I'm doing something fundamentaly wrong.
Anyone else has this issue?
Sorry for bothering.

Best regards, Alex


Okay this is my first debugging attempt ever, so please bear with me.
Removing the leading spaces (indents) seemed to be erroneous.

I changed

line: 164
from:
indent_level = re.match(r"\s*", line).group(0)
to:
indent_level = len(re.match(r"\s*", line).group(0)) - 1

line: 173-174
from:

if re.match(r' {{{:d}}}'.format(len(indent_level)), line):
    docs_text += line[len(indent_level):] + '\n'

to:

if re.match(r' {{{:d}}}'.format(indent_level), line):
    docs_text += line[indent_level:] + '\n'

I hope this does not break anything else.

Best, Alex