-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Title Component With a new focus on allowing users to use RepoSense as a portfolio tool, more functionality supporting this focus is needed. Let's allow users to add customizable content in Markdown/HTML format at the top of the report for a personalized introduction.
- Loading branch information
Showing
9 changed files
with
324 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<template lang="pug"> | ||
.title(v-html="markdownText", v-if="markdownText != ''") | ||
</template> | ||
|
||
<script lang="ts"> | ||
import MarkdownIt from 'markdown-it'; | ||
import { defineComponent } from 'vue'; | ||
export default defineComponent({ | ||
data() { | ||
return { | ||
markdownText: '', | ||
}; | ||
}, | ||
beforeMount() { | ||
fetch('title.md').then((response) => { | ||
if (!response.ok) { // file not found | ||
return ''; | ||
} | ||
return response.text(); | ||
}).then((text) => { | ||
const md = new MarkdownIt({ html: true }); | ||
this.markdownText = md.render(text); | ||
}).catch((error) => { | ||
this.markdownText = (error as Error).toString(); | ||
}); | ||
}, | ||
}); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.title { | ||
overflow-x: auto; | ||
padding: 0 1.5rem; | ||
// This is needed because the parent summary-wrapper center aligns everything | ||
text-align: initial; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters