diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index 82c8146..adf7fd3 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -18,6 +18,9 @@ class DefaultController extends AbstractController #[Route('/', name: 'app_index')] public function index(): Response { + if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { + return $this->redirect('/index.php/home'); + } return $this->render('default/index.html.twig'); } @@ -35,6 +38,12 @@ class DefaultController extends AbstractController ]); } + #[Route('/cheat-sheet', name: 'app_cheat_sheet')] + public function cheatSheet(): Response + { + return $this->render('default/cheat-sheet.html.twig'); + } + #[Route('/reference-editor', name: 'app_reference_editor')] public function referenceEditor(EntityManagerInterface $emi): Response { diff --git a/templates/default/cheat-sheet.html.twig b/templates/default/cheat-sheet.html.twig new file mode 100644 index 0000000..2e360dc --- /dev/null +++ b/templates/default/cheat-sheet.html.twig @@ -0,0 +1,163 @@ +{% extends 'base.html.twig' %} + +{% block title %}Markdown Cheat Sheet{% endblock %} + +{% block stylesheets %} + + + + + +{% endblock %} + +{% block javascripts %} + + + + + + + + + + +{% endblock %} + +{% block body %} +
+

Markdown Cheat Sheet

+ +

The following was provided by The Markdown Guid

+ +

This Markdown cheat sheet provides a quick overview of all the Markdown syntax elements. It can't cover every edge case, so if you need more information about any of these elements, refere to the reference guides for basic syntax and extended syntax.

+ +

Basic Syntax

+ +

These are the elements outlined in John Gruberal's original design document. All Markdown applications support these elements. The quoted text is what is needed to render what is displayed right below

+ +

Headings

+ +"# H1"
+

# H1

+ +"## H2"
+

## H2

+ +"### H3"
+

### H3

+ +

Bold

+ +"**bold text**"
+bold text + +

Italic

+ +"*italicized text*"
+italicized text + +

Blockquote

+ +"> blockquote"
+
blockquote
+ +

Ordered List

+ +"1. First item"
+"2. Second item"
+"3. Third item"
+
+ +
    +
  1. First item
  2. +
  3. Second item
  4. +
  5. Third item
  6. +
+ +

Unordered List

+ +"- First item"
+"- Second item"
+"- Third item"
+
+ + + +

Code

+ +"`code`"
+ +code
+ +

Horizontal Rule

+ +"---"
+ +
+ +

Link

+ +"[Markdown Guide](https://www.markdownguide.org)"
+ +Markdown Guide
+ +

Image

+ +"![alt text](https://www.markdownguide.org/assets/images/tux.png)"
+ +alt text
+ +

Extended Syntax

+ +

These elements extend the basic syntax by adding additional features. Not all Markdown applications support these elements.

+ +

Table

+ +| Syntax | Description |
+| ----------- | ----------- |
+| Header | Title |
+| Paragraph | Text |
+
+ + + + + + + + + + + + + + + + +
SyntaxDescription
HeaderTitle
ParagraphText
+ +

Fenced Code Block

+ +

Specifying the language after the first 3 backticks may help with text formatting and highlighting based on the language entered, may or may not be supported in a given Markdown tools implementation

+ +```json
+{
+  "firstName": "John",
+  "lastName": "Smith",
+  "age": 25,
+}
+```
+ +
+{
+  "firstName": "John",
+  "lastName": "Smith",
+  "age": 25
+}
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/default/sidebar.html.twig b/templates/default/sidebar.html.twig index ebdf0de..e5b08b0 100644 --- a/templates/default/sidebar.html.twig +++ b/templates/default/sidebar.html.twig @@ -29,7 +29,7 @@ {% endif %}
  • Open Reference
  • Template Editor
  • -
  • Markdown Cheat Sheet
  • +
  • Markdown Cheat Sheet
  • {% else %}
  • Home
  • Register