liran-funaro / sphinx-markdown-builder

A Sphinx extension to add markdown generation support.
https://pypi.org/project/sphinx-markdown-builder
MIT License
32 stars 14 forks source link

[DISCREPANCY] Indentation in the generated markdown file #8

Open revati-naik opened 9 months ago

revati-naik commented 9 months ago

Describe the discrepancy A clear and concise description of the discrepancy.

The markdown file that is generated from a given .rst file does not work for me. For example, in the markdown file, I need the indentation to be 4 spaces and what I see in the markdown is two spaces. I see * at the start of the line but I need a -. These are with respect to creating an index file.

To Reproduce Steps to reproduce the behavior:

  1. Clone 'https://github.com/liran-funaro/sphinx-markdown-builder'

Sample '.rst' index file

.. toctree::
   :glob:
   :maxdepth: 2

   doc1
   doc2

doc1

###########
This is doc 1
###########

Section 1
-----------------
content in section 1

Section 2
----------------
content in section 2

contents
.. toctree::
  :maxdepth: 2

  child_doc1
  child_doc2

doc2

###########
This is doc 2
###########

Expected output A clear and concise description of the expected output.

- [This is doc 1](doc1)
    - [](child_doc1)
    - [](child_doc2)
- [This is doc 2)(doc2)

Current output A clear and concise description of the expected output.

* [This is doc 1](doc1)
  * [Section 1](path/to/section1)
  * [Section 2](path/to/section2)
* [This is doc 2)(doc2)

Environment (please complete the following information):

Additional context Add any other context about the discrepancy here.

The indentation is right now only 2 spaces, I need 4. Any way to change this? Also the child_doc1 and child_doc2 are not listed.

revati-naik commented 8 months ago

To add more info, instead of injecting an * can we have a -? Also, the indentation needed is 4 not 2. This is needed in the md file is used by the mkdocs tools to convert to HTML. And since the indentation and the character are not as needed by mkdocs, the mkdocs does not render the HTML correctly. I could make changes to my work and use it if you let me know where the changes need to go as I understand not everyone would need this.

liran-funaro commented 7 months ago

@revati-naik Thank you for the report. I'm sorry it took so much time to reply. I've been on vacation, followed by a war. I'll attend to this issue in the following weeks.

liran-funaro commented 6 months ago

@revati-naik I can add configuration options for the default list marker and indentation level. These will be applied to the entire workspace. Not to a specific document. Will that work for you?