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

Bug: It seems the `Args` section does not support code blocks very well #11

Closed
wq2012 opened this issue Jan 24, 2019 · 3 comments

Comments

2 participants
@wq2012
Copy link
Contributor

commented Jan 24, 2019

Expected Behavior

I was expecting to be able to use code blocks for Args section.

For example, this is my docstring:

  def predict(self, test_sequence, args):
    """Predict test sequence labels using UISRNN model.

    Args:
      test_sequence: 2-dim numpy array of real numbers, size: N * D
        - the test observation sequence.
        N - length of one test utterance
        D - observation dimension
        For example:
        ```
        test_sequence =
        [[2.2 -1.0 3.0 5.6]   --> 1st entry of utterance 'iccc'
        [0.5 1.8 -3.2 0.4]    --> 2nd entry of utterance 'iccc'
        [-2.2 5.0 1.8 3.7]    --> 3rd entry of utterance 'iccc'
        [-3.8 0.1 1.4 3.3]    --> 4th entry of utterance 'iccc'
        [0.1 2.7 3.5 -1.7]]   --> 5th entry of utterance 'iccc'
        ```
        Here N=5, D=4.
      args: Inference configurations. See arguments.py for details.

Actual Behavior

Here is what has been rendered:
screenshot from 2019-01-24 11-53-00

It did not insert new lines for the multiline code block.

Steps to Reproduce

N/A

Additional info

  • pdoc version:
    0.5.1
@kernc

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2019

Python Markdown only supports (```) fenced code blocks on a document (docstring) root (0th indent) level. Issue: Python-Markdown/markdown#53

Can you try indenting the code one (markdown, i.e. 4-space) extra level? If it doesn't work, it's probably a duplicate of #10, likely introduced with the fix to #5. 😳

@wq2012

This comment has been minimized.

Copy link
Contributor Author

commented Jan 25, 2019

I tried to un-indent the code blocks, and it worked, but it went out of the scope of that argument.

Indenting with extra spaces does not work.

@kernc

This comment has been minimized.

Copy link
Contributor

commented Jan 27, 2019

Fenced code blocks remain an issue Python-Markdown/markdown#53.

With indented code block (per Markdown syntax, indented extra 4 spaces), your above example should now that #10 is fixed render as expected.

@kernc kernc closed this Jan 27, 2019

@kernc kernc added the bug label Jan 27, 2019

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.