Skip to content

annaesvensson/yellow-parsedown

Repository files navigation

Deutsch   English   Svenska

Parsedown 0.9.2

Text formatting for humans.

Screenshot

How to install an extension

Download ZIP file and copy it into your system/extensions folder. Learn more about extensions.

How to format text

Markdown is a practical way to edit web pages. Write text like you would in an email and it becomes a web page. After a short while, it happens naturally without you even thinking about it. The overriding design goal for the Markdown syntax is to make it as readable as possible. Here are the Markdown syntax, Markdown Extra features and GitHub Flavored Markdown.

The default content parser is defined in file system/extensions/yellow-system.ini. A different content parser can be defined in the page settings at the top of each page, for example Parser: parsedown.

How to format text with shortcuts

Markdown is a flexible way to edit web pages. Markdown-formatted text can be opened with any text editor. Or it can be edited in a web browser. Most applications support the basic Markdown syntax, some applications provide shortcuts with additional features for web pages. This allows you, for example, to add images and image galleries. The available shortcuts depend on extensions installed.

Examples

Content file with page title and text:

---
Title: Example page
---
This is an example page.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod 
tempor incididunt ut labore et dolore magna pizza. Ut enim ad minim veniam, 
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo. 

Formatting text:

Normal **bold** *italic* ~~strikethrough~~ `code`

Making a list:

* item one
* item two
* item three

Making an ordered list:

1. item one
2. item two
3. item three

Making a task list:

- [x] item one
- [ ] item two
- [ ] item three

Making a heading:

# Heading 1
## Heading 2
### Heading 3

Making quotes:

> Quote
>> Quote of a quote
>>> Quote of a quote of a quote

Making links:

[Link to page](/help/how-to-make-a-small-website)
[Link to file](/media/downloads/yellow-english.pdf)
[Link to website](https://datenstrom.se)

Adding images:

[image photo.jpg Example]
[image photo.jpg "This is an example image"]
[image photo.jpg "This is an especially long description"]

Making tables:

| Coffee     | Milk | Strength |
|------------|------|----------|
| Espresso   | no   | strong   |
| Macchiato  | yes  | medium   |
| Cappuccino | yes  | weak     |

Making footnotes:

Text with a footnote[^1] and some more footnotes.[^2] [^3]

[^1]: Here's the first footnote
[^2]: Here's the second footnote
[^3]: Here's the third footnote

Showing source code:

```
Source code will be shown unchanged.
function onLoad($yellow) {
    $this->yellow = $yellow;
}
```

Making paragraphs:

Here's the first paragraph. Text can span over several lines
and can be separated by a blank line from the next paragraph.

Here's the second paragraph.

Making line breaks:

Here's the first line⋅⋅
Here's the second line⋅⋅
Here's the third line⋅⋅

Spaces at the end of the line are shown with dots (⋅)

Making notices:

! Here's a notice with warning

!! Here's a notice with error

!!! Here's a notice with tip

Using CSS:

! {.class}
! Here's a notice with custom class.
! Text can span over several lines
! and contain Markdown text formatting.

Using HTML:

<strong>Text with HTML</strong> can be used optionally.
<img src="/media/images/photo.jpg" alt="This is an example image">
<a href="https://datenstrom.se" target="_blank">Open link in new tab</a>.

Using shortcuts with additional features:

[image photo.jpg]    = adding an image or image thumbnail
[gallery photo.*jpg] = adding an image gallery with popup
[slider photo.*jpg]  = adding an image gallery with slider

Extension for custom shortcut:

<?php
class YellowExample {
    const VERSION = "0.1.2";
    public $yellow;         // access to API
    
    // Handle initialisation
    public function onLoad($yellow) {
        $this->yellow = $yellow;
    }
    
    // Handle page content element
    public function onParseContentElement($page, $name, $text, $attributes, $type) {
        $output = null;
        if ($name=="example" && ($type=="block" || $type=="inline")) {
            $output = "<div class=\"".htmlspecialchars($name)."\">";
            $output .= "Add more HTML code here";
            $output .= "</div>";
        }
        return $output;
    }
}

Acknowledgements

This extension includes Parsedown Extra 1.8.0-beta-7 by Emanuil Rusev. Thank you for the good work.

Developer

Anna Svensson. Get help.