mkgendocs icon indicating copy to clipboard operation
mkgendocs copied to clipboard

abstractmethod is not output

Open murata100 opened this issue 3 years ago • 4 comments

abstractmethod is not output. Correctly in some classes with implementation.

https://docs.python.org/3/library/abc.html#abc.abstractmethod

murata100 avatar Nov 25 '21 10:11 murata100

Can you give me a precise example of something to be documented and a description of the expected result just so I can reproduce the problem more easily?

davidenunes avatar Nov 25 '21 17:11 davidenunes

yes

preparation

  • sample.py
from abc import ABC, abstractmethod

class Sample1(ABC):
    '''
    Sample class 1
    '''
    @abstractmethod
    def sample_method_abstract(self):
        '''
        sample abstract
        '''
        pass
    def sample_method_implement(self):
        '''
        sample implement 1
        '''
        pass

class Sample2(Sample1):
    '''
    Sample class 2
    '''
    def sample_method_implement(self):
        '''
        sample implement 2
        '''
        pass
  • mkgendocs.yml
sources_dir: docs/sources
templates_dir: docs/templates
repo: https://github.com/davidenunes/tensorx  #link to sources on github
version: master                               #link to sources on github

pages:
  - page: "sample.md"
    source: "sample.py"
    classes:
      - Sample1
      - Sample2

run gendocs (example)

docker run --rm -it \
    -v $PWD:/work \
    python \
    bash -c \
    'pip install mkgendocs && cd /work && gendocs --config mkgendocs.yml'

I want sample_method_abstract to be output.

--- docs/sources/actual sample.md	2021-11-26 11:01:53.000000000 +0900
+++ docs/sources/expected sample.md	2021-11-26 11:05:16.000000000 +0900
@@ -14,6 +14,16 @@
 
 **Methods:**
 
+### .sample_method_abstract
+[source](https://github.com/davidenunes/tensorx/blob/master/sample.py/#L8)
+```python
+.sample_method_abstract()
+```
+
+---
+sample abstract
+
+----
 
 ### .sample_method_implement
 [source](https://github.com/davidenunes/tensorx/blob/master/sample.py/#L13)

murata100 avatar Nov 26 '21 01:11 murata100

I edited the above comment and wrote the actual and expected.

murata100 avatar Nov 26 '21 02:11 murata100

Thank you, this helps :+1:, I'm a bit swamped at the time but I'll give it a look as soon as I can

davidenunes avatar Nov 26 '21 16:11 davidenunes

Sorry for the delay, this was an easy fix but I've been a bit swamped with my thesis work It should be working in version 0.9.2

davidenunes avatar Aug 12 '22 00:08 davidenunes