gistfile1.txt
· 1.1 KiB · Text
原始檔案
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Marked in the browser</title>
</head>
<body>
<div id="content">
로딩 중...
</div>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
// GitHub API에서 최신 릴리스 정보 가져오기
fetch('https://api.github.com/repos/baron-consultant/eg-bim-release/releases/latest')
.then(response => {
if (!response.ok) {
throw new Error('네트워크 응답이 올바르지 않습니다');
}
return response.json();
})
.then(data => {
// API 응답에서 body 내용 추출
const input = data.body || '# 릴리스 노트를 불러올 수 없습니다.';
// Markdown을 HTML로 변환하여 표시
document.getElementById('content').innerHTML = marked.parse(input);
})
.catch(error => {
console.error('데이터를 가져오는 중 오류가 발생했습니다:', error);
document.getElementById('content').innerHTML = '<p>릴리스 노트를 불러오는 중 오류가 발생했습니다.</p>';
});
</script>
</body>
</html>
1 | <!doctype html> |
2 | <html> |
3 | <head> |
4 | <meta charset="utf-8"/> |
5 | <title>Marked in the browser</title> |
6 | </head> |
7 | <body> |
8 | <div id="content"> |
9 | 로딩 중... |
10 | </div> |
11 | |
12 | <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> |
13 | <script> |
14 | // GitHub API에서 최신 릴리스 정보 가져오기 |
15 | fetch('https://api.github.com/repos/baron-consultant/eg-bim-release/releases/latest') |
16 | .then(response => { |
17 | if (!response.ok) { |
18 | throw new Error('네트워크 응답이 올바르지 않습니다'); |
19 | } |
20 | return response.json(); |
21 | }) |
22 | .then(data => { |
23 | // API 응답에서 body 내용 추출 |
24 | const input = data.body || '# 릴리스 노트를 불러올 수 없습니다.'; |
25 | |
26 | // Markdown을 HTML로 변환하여 표시 |
27 | document.getElementById('content').innerHTML = marked.parse(input); |
28 | }) |
29 | .catch(error => { |
30 | console.error('데이터를 가져오는 중 오류가 발생했습니다:', error); |
31 | document.getElementById('content').innerHTML = '<p>릴리스 노트를 불러오는 중 오류가 발생했습니다.</p>'; |
32 | }); |
33 | </script> |
34 | </body> |
35 | </html> |