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

[DISCREPANCY] Indentation in the generated markdown file #8

Open
revati-naik opened this issue Oct 6, 2023 · 5 comments
Open

[DISCREPANCY] Indentation in the generated markdown file #8

revati-naik opened this issue Oct 6, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@revati-naik
Copy link

revati-naik commented Oct 6, 2023

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):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

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
Copy link
Author

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
Copy link
Owner

@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
Copy link
Owner

@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?

@liran-funaro liran-funaro added the enhancement New feature or request label Dec 11, 2023
@ahjota
Copy link

ahjota commented Nov 15, 2024

This would be a much appreciated enhancement @liran-funaro -- I am running into a similar issue where I am using the output of sphinx-markdown-builder as the input for mkdocs, and my lists break entirely because of this.

@liran-funaro
Copy link
Owner

liran-funaro commented Jan 12, 2025

@ahjota @revati-naik I added a config parameter "markdown_bullet". You can set it to any value you want.

You can install the latest commit and see if it solves this issue for you.
If it solves it, I'll upload a new version soon.

pip uninstall sphinx-markdown-builder
pip install git+https://github.com/liran-funaro/sphinx-markdown-builder.git@main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants