mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	cmdref.py: Support autoref for 'help <cmd>'
This commit is contained in:
		
							parent
							
								
									be5572ca0e
								
							
						
					
					
						commit
						6aceb6a297
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -430,9 +430,12 @@ class CellDomain(CommandDomain):
 | 
			
		|||
        TagIndex
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
def autoref(name, rawtext, text, lineno, inliner: Inliner,
 | 
			
		||||
def autoref(name, rawtext: str, text: str, lineno, inliner: Inliner,
 | 
			
		||||
            options=None, content=None):
 | 
			
		||||
    role = 'cell:ref' if text[0] == '$' else 'cmd:ref'
 | 
			
		||||
    if text.startswith("help ") and text.count(' ') == 1:
 | 
			
		||||
        _, cmd = text.split(' ', 1)
 | 
			
		||||
        text = f'{text} <{cmd}>'
 | 
			
		||||
    return inliner.interpreted(rawtext, text, role, lineno)
 | 
			
		||||
 | 
			
		||||
def setup(app: Sphinx):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue