diff --git a/frontend/src/routes/create-question.tsx b/frontend/src/routes/create-question.tsx index 40126ef6..63acc598 100644 --- a/frontend/src/routes/create-question.tsx +++ b/frontend/src/routes/create-question.tsx @@ -13,6 +13,7 @@ import { useCreateQuestion, useSearchTags, } from "@/services/api/programmingForumComponents"; +import { Info } from "lucide-react"; import { queryKeyFn } from "@/services/api/programmingForumContext"; import { TagDetails } from "@/services/api/programmingForumSchemas"; import { zodResolver } from "@hookform/resolvers/zod"; @@ -21,6 +22,9 @@ import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { useNavigate, useSearchParams } from "react-router-dom"; import { z } from "zod"; +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; +import SyntaxHighlighter from "react-syntax-highlighter"; +import { ContentWithSnippets } from "@/components/ContentWithSnippets"; // Schema validation for the form const newQuestionSchema = z.object({ @@ -57,6 +61,8 @@ export default function QuestionCreationPage() { console.log("tagIds", tagIds); console.log("form.getValues(tags)", form.getValues("tags")); + const [isPreviewMode, setIsPreviewMode] = useState(false); + const { handleSubmit, control } = form; const queryClient = useQueryClient(); @@ -112,7 +118,54 @@ export default function QuestionCreationPage() { return (
+ We use Markdown for formatting questions. You can use standard + Markdown syntax for headers, lists, links, etc. For a basic + reference, you can check{" "} + + CommonMark + + . +
+ ++ To create executable code blocks, use triple backticks with + language-exec: +
+
+ Link to tags using: [tag name](#tag-123)
+
+ Link to questions using: [question title](#q-456)
+