Skip to content

Commit d86cef6

Browse files
committed
Merge pull request #253 from SAPlayer/changelog-markdown
Use marked.js to show changelog in Markdown mode
2 parents 6e8ac66 + 6825296 commit d86cef6

5 files changed

Lines changed: 1309 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
## 0.10.12
1616
* Added features to view authors of a file or current selection.
17-
1817
* Push dialog shows masked password.
1918
* Tabs are now properly displayed in the diffs respecting Brackets "tabSize" preference.
2019

htmlContent/git-changelog-dialog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h1 class="dialog-title">Brackets Git: {{TITLE}}</h1>
44
</div>
55
<div class="modal-body table-striped tab-content">
6-
<pre id="git-changelog"></pre>
6+
<div id="git-changelog"></div>
77
</div>
88
<div class="modal-footer">
99
<button data-button-id="ok" class="dialog-button btn btn-80">{{Strings.BUTTON_CLOSE}}</button>

less/brackets-git.less

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,41 @@
297297
}
298298
}
299299

300+
#git-changelog-dialog {
301+
#git-changelog {
302+
color: #333333;
303+
font-family: Helvetica, arial, sans-serif;
304+
font-size: 15px;
305+
line-height: 1.7px;
306+
padding: 1em;
307+
margin: auto;
308+
background: #f8f8f8;
309+
border-radius: 5px;
310+
p {
311+
margin: 1em 0;
312+
}
313+
h1, h2 {
314+
color: #111111;
315+
}
316+
h1 {
317+
font-size: 2.5em;
318+
font-weight: bold;
319+
border-bottom: 1px solid #dddddd;
320+
}
321+
h2 {
322+
font-size: 2em;
323+
border-bottom: 1px solid #eeeeee;
324+
}
325+
li {
326+
margin: 4px 0;
327+
}
328+
ul {
329+
margin-top: 18px;
330+
margin-bottom: 28px;
331+
}
332+
}
333+
}
334+
300335
#git-commit-dialog, #git-diff-dialog {
301336
.modal-body {
302337
.flex-box(column);

src/ChangelogDialog.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ define(function (require, exports) {
1212
Strings = require("../strings"),
1313
changelogDialogTemplate = require("text!htmlContent/git-changelog-dialog.html");
1414

15+
var marked = require("../thirdparty/marked");
16+
1517
var dialog;
1618

1719
exports.show = function () {
@@ -21,7 +23,11 @@ define(function (require, exports) {
2123
dialog = Dialogs.showModalDialogUsingTemplate(compiledTemplate);
2224

2325
FileUtils.readAsText(FileSystem.getFileForPath(Preferences.get("extensionDirectory") + "CHANGELOG.md")).done(function (content) {
24-
$("#git-changelog", dialog.getElement()).text(content);
26+
content = marked(content, {
27+
gfm: true,
28+
breaks: true
29+
});
30+
$("#git-changelog", dialog.getElement()).html(content);
2531
});
2632
};
2733

0 commit comments

Comments
 (0)