mirror of
				https://github.com/LonamiWebs/Telethon.git
				synced 2025-10-30 23:47:33 +03:00 
			
		
		
		
	Sort namespaces and types when generating the docs (#87)
This commit is contained in:
		
							parent
							
								
									57d99eabbb
								
							
						
					
					
						commit
						4af5085f17
					
				|  | @ -154,6 +154,7 @@ def generate_index(folder, original_paths): | ||||||
|         if namespaces: |         if namespaces: | ||||||
|             docs.write_title('Namespaces', level=3) |             docs.write_title('Namespaces', level=3) | ||||||
|             docs.begin_table(4) |             docs.begin_table(4) | ||||||
|  |             namespaces.sort() | ||||||
|             for namespace in namespaces: |             for namespace in namespaces: | ||||||
|                 # For every namespace, also write the index of it |                 # For every namespace, also write the index of it | ||||||
|                 generate_index(os.path.join(folder, namespace), original_paths) |                 generate_index(os.path.join(folder, namespace), original_paths) | ||||||
|  | @ -164,9 +165,13 @@ def generate_index(folder, original_paths): | ||||||
| 
 | 
 | ||||||
|         docs.write_title('Available items') |         docs.write_title('Available items') | ||||||
|         docs.begin_table(2) |         docs.begin_table(2) | ||||||
|         for file in files: | 
 | ||||||
|             docs.add_row(find_title(os.path.join(folder, file)), |         files = [(f, find_title(os.path.join(folder, f))) for f in files] | ||||||
|                          link=file) |         files.sort(key=lambda t: t[1]) | ||||||
|  | 
 | ||||||
|  |         for file, title in files: | ||||||
|  |             docs.add_row(title, link=file) | ||||||
|  | 
 | ||||||
|         docs.end_table() |         docs.end_table() | ||||||
|         docs.end_body() |         docs.end_body() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user