loganasherjones / yapconf

Yet Another Python Configuration
http://yapconf.readthedocs.io/en/stable/
MIT License
18 stars 4 forks source link

ASCII Doc Support #102

Open TheBurchLog opened 4 years ago

TheBurchLog commented 4 years ago

Description

The goal is to utilize Yapconf to generate documentation for our Github page.

What I Did

Here is what I did

from yapconf import YapconfSpec

my_spec = YapconfSpec(_SPECIFICATION)

my_spec.generate_documentation(app_name="My App", 
                               output_file_name='configuration_docs.md').

Here is what I would like to do:

from yapconf import YapconfSpec

my_spec = YapconfSpec(_SPECIFICATION')

my_spec.generate_documentation(app_name="My App", 
                               output_file_name='configuration_docs.adoc', 
                               output_format='ascii')

# or the default is MD
my_spec.generate_documentation(app_name="My App", 
                               output_file_name='configuration_docs.md')

There is two primary different in the two file generation and that I noticed. This is how the table is generated and linking

Tables

Markdown:

|Name of Column 1 |Name of Column 2 |Name of Column 3  |
| ------------- |:-------------:| -----:|
| Cell in column 1, row 1 | Cell in column 2, row 1 | Cell in column 3, row 1 |
| Cell in column 1, row 2 | Cell in column 2, row 2 | Cell in column 3, row 2 |
| Cell in column 1, row 3 | Cell in column 2, row 3 | Cell in column 3, row 3 |

Ascii Doc:

.Table Title
|===
|Name of Column 1 |Name of Column 2 |Name of Column 3 

|Cell in column 1, row 1
|Cell in column 2, row 1
|Cell in column 3, row 1

|Cell in column 1, row 2
|Cell in column 2, row 2
|Cell in column 3, row 2
|===

Linking

Markdown

[Link Text](#Header)    

[yapconf.](https://github.com/loganasherjones/yapconf)

AsciiDocs

<<Header,Link Text>>

https://github.com/loganasherjones/yapconf[yapconf.]