<!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>