| | |
| | |
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | import com.gitblit.wicket.RepositoryPage;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | |
|
| | | public class MarkdownPage extends RepositoryPage {
|
| | |
| | | RevCommit commit = JGitUtils.getCommit(r, objectId);
|
| | |
|
| | | // markdown page links
|
| | | add(new Label("blameLink", getString("gb.blame")));
|
| | | add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class,
|
| | | WicketUtils.newPathParameter(repositoryName, objectId, markdownPath)));
|
| | | add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,
|
| | | WicketUtils.newPathParameter(repositoryName, objectId, markdownPath)));
|
| | | add(new BookmarkablePageLink<Void>("rawLink", RawPage.class, WicketUtils.newPathParameter(
|
| | |
| | | WicketUtils.newPathParameter(repositoryName, Constants.HEAD, markdownPath)));
|
| | |
|
| | | // Read raw markdown content and transform it to html
|
| | | String markdownText = JGitUtils.getRawContentAsString(r, commit, markdownPath);
|
| | | String markdownText = JGitUtils.getStringContent(r, commit.getTree(), markdownPath);
|
| | | String htmlText;
|
| | | try {
|
| | | htmlText = MarkdownUtils.transformMarkdown(markdownText);
|