Skip to content

Commit

Permalink
add markdown support to paas description
Browse files Browse the repository at this point in the history
  • Loading branch information
gpelouze committed Sep 22, 2023
1 parent 69532bb commit f38b159
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions vre-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"next-auth": "~4.5.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-markdown": "^8.0.7",
"react-scripts": "5.0.1",
"tailwindcss": "~3.3.3",
"use-subscription": "~1.8.0",
Expand All @@ -29,6 +30,7 @@
},
"devDependencies": {
"typescript": "^4.5",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "~20.4.5",
"@types/react": "~18.2.0",
"autoprefixer": "~10.4.15",
Expand Down
7 changes: 5 additions & 2 deletions vre-panel/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {useEffect, useState, useContext} from 'react';
import {useContext, useEffect, useState} from 'react';
import getConfig from 'next/config';
import Link from 'next/link';
import ReactMarkdown from 'react-markdown'

import {NewVREDialog} from '../components/NewVREDialog';
import {PaasConfigContext} from '../context/PaasConfig';
Expand Down Expand Up @@ -60,7 +61,9 @@ const VLabs = ({}) => {
className="inline-block min-h-[1em] w-full flex-auto cursor-wait bg-onSurface align-middle opacity-50"></span>
</span>
) : (
paasConfig.description
<div className="prose">
<ReactMarkdown>{paasConfig.description}</ReactMarkdown>
</div>
)}
</p>
{paasConfigLoading || (
Expand Down
6 changes: 5 additions & 1 deletion vre-panel/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @type {import('tailwindcss').Config} */

module.exports = {
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}', './templates/**/*.{js,ts,jsx,tsx}'],
content: [],
Expand Down Expand Up @@ -33,5 +35,7 @@ module.exports = {
variants: {
textColor: ['responsive', 'hover', 'focus', 'active']
},
plugins: [],
plugins: [
require('@tailwindcss/typography'),
],
}
5 changes: 4 additions & 1 deletion vreapis/paas_configuration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

class PaasConfiguration(models.Model):
title = models.CharField(max_length=100, null=True)
description = models.TextField(null=True)
description = models.TextField(
null=True,
help_text="Markdown-formatted description of the platform",
)
documentation_url = models.URLField(null=True, blank=True)
site_icon = models.TextField(
null=True,
Expand Down

0 comments on commit f38b159

Please sign in to comment.