|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<title>Convertisseur Markdown</title> |
|
<style> |
|
body { |
|
font-family: 'Arial', sans-serif; |
|
display: flex; |
|
flex-direction: column; |
|
align-items: center; |
|
min-height: 100vh; |
|
background-color: #f0f2f5; |
|
margin: 0; |
|
} |
|
|
|
.container { |
|
background-color: white; |
|
border-radius: 8px; |
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); |
|
padding: 20px; |
|
width: 80%; |
|
max-width: 800px; |
|
} |
|
|
|
h1 { |
|
text-align: center; |
|
color: #333; |
|
} |
|
|
|
textarea, #preview { |
|
overflow-y: auto; |
|
width: 100%; |
|
height: auto; |
|
padding: 10px; |
|
border: 1px solid #ddd; |
|
border-radius: 4px; |
|
resize: vertical; |
|
font-family: monospace; |
|
} |
|
|
|
button { |
|
background-color: #007bff; |
|
color: white; |
|
padding: 10px 20px; |
|
border: none; |
|
border-radius: 4px; |
|
cursor: pointer; |
|
margin-top: 10px; |
|
transition: background-color 0.3s ease; |
|
} |
|
|
|
button:hover { |
|
background-color: #0069d9; |
|
} |
|
|
|
table { |
|
border-collapse: collapse; |
|
width: 100%; |
|
margin-top: 10px; |
|
} |
|
|
|
th, td { |
|
border: 1px solid #ddd; |
|
padding: 8px; |
|
text-align: left; |
|
} |
|
</style> |
|
</head> |
|
<body> |
|
<div class="container"> |
|
<h1>Convertisseur Markdown</h1> |
|
|
|
<textarea id="markdown"></textarea> |
|
|
|
<button onclick="convertir()">Convertir en HTML</button> |
|
|
|
<div id="preview"></div> |
|
</div> |
|
|
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> |
|
<script> |
|
function convertir() { |
|
var markdownText = document.getElementById("markdown").value; |
|
var html = marked.parse(markdownText); |
|
document.getElementById("preview").innerHTML = html; |
|
} |
|
</script> |
|
</body> |
|
</html> |