pdocs icon indicating copy to clipboard operation
pdocs copied to clipboard

Extraneous newlines in View Source for as_markdown

Open jayqi opened this issue 4 years ago • 3 comments

When I use pdocs as_markdown, it looks like there is a blank line added between every line of my source code inside the View Source sections, looking something like this:

??? example "View Source"
        from abc import ABC, abstractmethod

        from datetime import datetime

        from enum import Enum

        from pathlib import Path

        from typing import Callable, Dict, Optional

This also affected a site that I built via portray, and also seems to be affecting pdocs' own docs website, for example here: https://timothycrosley.github.io/pdocs/reference/pdocs/render/

The HTML version generated with pdocs as_html does not appear to have this problem.

  • pdocs 1.1.1
  • portray 1.5.2

jayqi avatar Feb 17 '21 02:02 jayqi

@jayqi - I'm using Portray and experience this as well. Were you able to find a workaround? Also, do you know how I can just hide source code in poetry until this is fixed? Thanks

JesseWebDotCom avatar Mar 13 '21 20:03 JesseWebDotCom

This issue still occurs in Potray when the as_html flag, ex.: portray as_html --overwrite

JesseWebDotCom avatar Mar 13 '21 21:03 JesseWebDotCom

BTW - If you want to exclude source code in Portray until this issue is fixed, add this to your pyproject.toml: [tool.portray.pdocs] exclude_source = "true"

JesseWebDotCom avatar Mar 13 '21 21:03 JesseWebDotCom