Skip to content

Commit

Permalink
Use shiki for syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
aguingand committed Jul 21, 2023
1 parent 129f3f0 commit b0cedae
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 10 deletions.
4 changes: 4 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as path from 'path';
import { defineUserConfig } from 'vuepress';
import { docsearchPlugin } from '@vuepress/plugin-docsearch';
import { viteBundler } from '@vuepress/bundler-vite';
import { shikiPlugin } from '@vuepress/plugin-shiki';
import * as dotenv from 'dotenv';
import svgLoader from 'vite-svg-loader';
import sidebar from './sidebar';
Expand Down Expand Up @@ -76,6 +77,9 @@ export default defineUserConfig({
facetFilters: [`tags:${DOCS_ALGOLIA_TAG}`],
},
}),
shikiPlugin({
theme: 'material-theme-palenight',
}),
fathomPlugin({
siteId: 'EELMENOG',
domains: 'sharp.code16.fr',
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/theme/styles/_root.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

:root {
--c-text: #233140;
--code-bg-color: #282c34;
--code-bg-color: #292D3E; // material-palenight
}

:root, html.dark {
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ You can entirely override the authentication workflow (view and controller) prov
'auth' => [
'login_page_url' => '/my_login',
]
```
```
2 changes: 1 addition & 1 deletion docs/guide/form-editor-embeds.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function buildShowFields(FieldsContainer $showFields): void

The embed should be treated like any regular Laravel blade component. Here's an example:

```php
```blade
@props([
'post',
])
Expand Down
12 changes: 6 additions & 6 deletions docs/guide/form-fields/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Allow the user to crop or rotate a visual, after the upload.
With `$transformKeepOriginal` set to true, the original file will remain unchanged, meaning the transformations will be
stored directly in the `<x-sharp-image/>` tag. For instance:

```html
```blade
<x-sharp-image
name="filename.jpg"
filter-crop="0.1495,0,0.5625,1"
Expand Down Expand Up @@ -144,7 +144,7 @@ configuration.

When inserting a file, the following tag is added in field text value:

```html
```blade
<x-sharp-file
name="filename.pdf"
path="data/Spaceship/10/markdown/filename.pdf"
Expand All @@ -153,7 +153,7 @@ When inserting a file, the following tag is added in field text value:
```
In case of an image the inserted tag is:

```html
```blade
<x-sharp-image
name="filename.jpg"
path="data/Spaceship/10/markdown/filename.jpg"
Expand All @@ -166,15 +166,15 @@ In case of an image the inserted tag is:
You may need to display those embedded files in the public website. The idea here is to display embedded images as
thumbnails, and other files as you need. Sharp provides a component for that:

```html
```blade
<x-sharp-content>
{!! $html !!}
</x-sharp-content>
```

To handle image thumbnails, you can pass the following props:

```html
```blade
<x-sharp-content
:image-thumbnail-width="600"
:image-thumbnail-height="400"
Expand All @@ -196,7 +196,7 @@ To handle image thumbnails, you can pass the following props:
#### Advanced usages

To add custom attributes to `<x-sharp-image>` component you can use the following syntax:
```html
```blade
<x-sharp-content>
<x-sharp-content::attributes
component="sharp-image"
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/style-visual-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can display a custom content under the form on login page:

You'll need to create a new template file:

```html
```blade
<!-- resources/views/sharp/_login-page-message.blade.php -->
<div class="alert alert-info">
Expand Down
93 changes: 93 additions & 0 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"license": "ISC",
"devDependencies": {
"@vuepress/plugin-docsearch": "^2.0.0-beta.66",
"@vuepress/plugin-shiki": "^2.0.0-beta.66",
"dotenv": "^10.0.0",
"sass": "^1.20.1",
"sass-loader": "^13.0.2",
Expand Down

0 comments on commit b0cedae

Please sign in to comment.