Skip to content

Commit

Permalink
Adding rendering of markup.
Browse files Browse the repository at this point in the history
  • Loading branch information
niclash committed Feb 20, 2021
1 parent 8d34f7e commit 7f5fe22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link href="css/bootstrap-4.4.0.min.css" rel="stylesheet">
<link href="css/dashboard.css" rel="stylesheet">
<link rel="stylesheet" href="css/fontawesome-all.css"/>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<style>
html, body {
height: 100%;
Expand Down Expand Up @@ -84,6 +85,5 @@ <h4 class="card-title">Recent Updates</h4>
<script type="text/javascript" src="project/add.js"></script>
<script type="text/javascript" src="project/view.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion src/main/webapp/project/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h4 class="card-title">Overview</h4>
<div class="card-body">
<h4 class="card-title">README</h4>
<hr/>
<pre><code>{{marked(projectData._source.readMe)}}</code></pre>
<pre><code>{{renderReadme()}}</code></pre>
</div>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/main/webapp/project/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ angular.module('ponyhub.view_project', ['ngRoute'])
if (success) {
$scope.projectData = response;
$log.info("Fetched project.", $scope.projectData);
$scope.rendered = marked($scope.projectData._source.readMe);

}
});
$scope.renderReadme = function() {
console.log("Render:", $scope.rendered);
return $scope.rendered;
}
}]);

0 comments on commit 7f5fe22

Please sign in to comment.