Skip to content

Commit

Permalink
feat(docs) add some markdown examples to the NcRichText docs
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Sep 7, 2023
1 parent a72821f commit 9528791
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/components/NcRichText/NcRichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
-
-->
<docs>
### General description

This component displays rich text with optional autolink or [Markdown support](https://www.markdownguide.org/basic-syntax/).

```vue
<template>
<div>
Expand All @@ -29,6 +33,7 @@
<NcCheckboxRadioSwitch :checked.sync="useMarkdown" type="checkbox">Use Markdown</NcCheckboxRadioSwitch>

<NcRichText
:class="{'plain-text': !useMarkdown }"
:text="text" :autolink="autolink" :arguments="args"
:use-markdown="useMarkdown" />
</div>
Expand All @@ -37,11 +42,16 @@
export default {
data() {
return {
text: `Hello {username}. The file {file} was added by {username}. Go visit https://nextcloud.com
text: `## Hello everyone 🎉
The file {file} was added by {username}. Visit https://nextcloud.com to check it!
Local IP: http://127.0.0.1/status.php should be clickable
Some examples for markdown syntax:
1. **bold text**
2. _italic text_
3. example of \`inline code\`
Some examples for markdown syntax: **bold text** *italic text* \`inline code\``,
> blockquote example
`,
autolink: true,
useMarkdown: true,
args: {
Expand All @@ -60,7 +70,11 @@ Some examples for markdown syntax: **bold text** *italic text* \`inline code\``,
<style lang="scss">
textarea {
width: 100%;
height: 100px;
height: 200px;
}
.plain-text {
white-space: pre-line;
}
</style>
```
Expand Down

0 comments on commit 9528791

Please sign in to comment.