mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	help-beta: Indent the content inside Asides or KeyboardTip.
MDX files were getting harder to read without proper indentation.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							66c123dd43
						
					
				
				
					commit
					a23d928662
				
			@@ -4,6 +4,7 @@ import os
 | 
				
			|||||||
import re
 | 
					import re
 | 
				
			||||||
import shutil
 | 
					import shutil
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
 | 
					from textwrap import indent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import django
 | 
					import django
 | 
				
			||||||
from django.template import engines
 | 
					from django.template import engines
 | 
				
			||||||
@@ -20,6 +21,8 @@ setup_path()
 | 
				
			|||||||
os.environ["DJANGO_SETTINGS_MODULE"] = "zproject.settings"
 | 
					os.environ["DJANGO_SETTINGS_MODULE"] = "zproject.settings"
 | 
				
			||||||
django.setup()
 | 
					django.setup()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INDENT_SPACES = "    "
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def replace_emoticon_translation_table(markdown_string: str, import_statement_set: set[str]) -> str:
 | 
					def replace_emoticon_translation_table(markdown_string: str, import_statement_set: set[str]) -> str:
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
@@ -195,6 +198,7 @@ def convert_admonitions_to_asides(
 | 
				
			|||||||
            admonition_content, post_admonition_content_text = detab(
 | 
					            admonition_content, post_admonition_content_text = detab(
 | 
				
			||||||
                post_admonition_declaration_text
 | 
					                post_admonition_declaration_text
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
 | 
					            admonition_content = indent(admonition_content, INDENT_SPACES)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            klass, title = get_admonition_class_and_title(match)
 | 
					            klass, title = get_admonition_class_and_title(match)
 | 
				
			||||||
            # We ignore the title obtained above in each of the if
 | 
					            # We ignore the title obtained above in each of the if
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user