mirror of
				https://github.com/searxng/searxng.git
				synced 2025-10-31 10:37:06 -04:00 
			
		
		
		
	This patch adds GitHub Code Search [1] engine to allow querying the codebases. Template code.html is changed to allow passthrough of strip and highlighting options. Engine Searchcode is adjusted to pass filename and not rely on hardcoded extensions. GitHub search code API does not return the exact code line indices, this implementation assigns the code arbitrary numbers starting from 1 (effectively relabeling the code). The API allows for unauth calls, and the default engine settings default to that, although the calls are heavily rate limited. The 'text' lexer is the default pygments lexer when parsing fails. [1] https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-code Co-authored-by: Markus Heiser <markus.heiser@darmarIT.de>
		
			
				
	
	
		
			9 lines
		
	
	
		
			117 B
		
	
	
	
		
			ReStructuredText
		
	
	
	
	
	
			
		
		
	
	
			9 lines
		
	
	
		
			117 B
		
	
	
	
		
			ReStructuredText
		
	
	
	
	
	
| .. _github code engine:
 | |
| 
 | |
| ===========
 | |
| Github Code
 | |
| ===========
 | |
| 
 | |
| .. automodule:: searx.engines.github_code
 | |
|    :members:
 |