Autodoc: Ignorování modulů
This commit is contained in:
		
							parent
							
								
									e10a8e0b6d
								
							
						
					
					
						commit
						3c3047b548
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								docs/conf.py
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								docs/conf.py
									
									
									
									
									
								
							|  | @ -85,3 +85,17 @@ source_suffix = { | ||||||
|     '.rst': 'restructuredtext', |     '.rst': 'restructuredtext', | ||||||
|     '.md': 'markdown', |     '.md': 'markdown', | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | # Autodoc má ignorovat některé moduly | ||||||
|  | # Ref: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#event-autodoc-skip-member | ||||||
|  | # Kudos: https://stackoverflow.com/a/21449475/ | ||||||
|  | def ignorovat(app, what, name. obj, skip, options): | ||||||
|  | 	blacklist = ( | ||||||
|  | 		# typ (what), name | ||||||
|  | 		('module', 'settings.mamweb_prod'), | ||||||
|  | 		) | ||||||
|  | 	ignore = (what, name) in blacklist | ||||||
|  | 	return True if ignore else None | ||||||
|  | 
 | ||||||
|  | def setup(app): | ||||||
|  | 	app.connect('autodoc-skip-member', ignorovat) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Pavel "LEdoian" Turinsky
						Pavel "LEdoian" Turinsky