-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create page and document Blade-supported Markdown
- Loading branch information
1 parent
16c1540
commit 0d7ae0f
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
label: "Advanced Markdown" | ||
priority: 26 | ||
category: "Digging Deeper" | ||
--- | ||
|
||
# Advanced Markdown | ||
|
||
## Introduction | ||
|
||
Since HydePHP makes heavy use of Markdown there are some extra features and helpers | ||
created just for Hyde to make using Markdown even easier! | ||
|
||
## Blade Support | ||
|
||
Since Hyde v0.30.x you can use Laravel Blade in Markdown files! | ||
|
||
### Using Blade in Markdown | ||
|
||
To use Blade in your Markdown files, simply use the Blade shortcode directive, | ||
followed by your desired Blade string. | ||
|
||
#### Standard syntax | ||
|
||
```markdown | ||
[Blade]: {{ "Hello World!" }} // Will render: 'Hello World!' | ||
``` | ||
|
||
#### Blade includes | ||
|
||
Only single-line shortcode directives are supported. If you need to use multi-line Blade code, | ||
use an `@include` directive to render a more complex Blade template. | ||
You can pass data to includes by specifying an array to the second argument. | ||
|
||
```markdown | ||
[Blade]: @include("hello-world") | ||
[Blade]: @include("hello", ["name" => "World"]) | ||
``` | ||
|
||
#### Limitations | ||
|
||
All shortcodes must be the first word on a new line. | ||
For example, using a space before the `[Blade]:` will intentionally cause it to not render. | ||
|
||
### Enabling Blade-supported Markdown | ||
It's disabled by default since it allows arbitrary PHP to run, which could be a security risk, | ||
depending on your setup. However, if your Markdown is trusted, and you know it's safe, | ||
you can enable it in the `config/markdown.php` file. | ||
|
||
```php | ||
// torchlight! {"lineNumbers": false} | ||
'enable_blade' => true, | ||
``` |