forked from open-webui/open-webui
		
	feat: stylised pdf
This commit is contained in:
		
							parent
							
								
									bfd066cc2f
								
							
						
					
					
						commit
						1f85354856
					
				
					 3 changed files with 78 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -5,6 +5,8 @@ from starlette.responses import StreamingResponse, FileResponse
 | 
			
		|||
 | 
			
		||||
from pydantic import BaseModel
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
import markdown
 | 
			
		||||
import requests
 | 
			
		||||
import os
 | 
			
		||||
import aiohttp
 | 
			
		||||
| 
						 | 
				
			
			@ -28,6 +30,17 @@ async def get_gravatar(
 | 
			
		|||
    return get_gravatar_url(email)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class MarkdownForm(BaseModel):
 | 
			
		||||
    md: str
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@router.post("/markdown")
 | 
			
		||||
async def get_html_from_markdown(
 | 
			
		||||
    form_data: MarkdownForm,
 | 
			
		||||
):
 | 
			
		||||
    return {"html": markdown.markdown(form_data.md)}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@router.get("/db/download")
 | 
			
		||||
async def download_db(user=Depends(get_admin_user)):
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue