-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: use Code component into Schema It uses Code component from astro-expressive-code to load the needed styles. Code component should be used with astro components or .mdx Fix #932 * Create weak-poems-walk.md --------- Co-authored-by: David Boyne <boyneyy123@gmail.com>
- Loading branch information
1 parent
8f8d9ec
commit b893559
Showing
4 changed files
with
40 additions
and
47 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,5 @@ | ||
--- | ||
"@eventcatalog/core": patch | ||
--- | ||
|
||
fix(core): fixed issue with styling of schema files |
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,32 @@ | ||
--- | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { Code } from 'astro-expressive-code/components'; | ||
interface Props { | ||
file?: string; | ||
catalog: { | ||
filePath: string; | ||
}; | ||
title?: string; | ||
} | ||
const { file = 'schema.json', catalog, title } = Astro.props; | ||
let code: string | null = null; | ||
const exists = fs.existsSync(path.join(catalog.filePath, file)); | ||
if (exists) { | ||
code = fs.readFileSync(path.join(catalog.filePath, file), 'utf-8'); | ||
} | ||
--- | ||
|
||
{ | ||
code ? ( | ||
<div class="not-prose max-w-4xl overflow-x-auto"> | ||
<Code code={code} title={title || file} lang="json" /> | ||
</div> | ||
) : ( | ||
<div class="italic">Tried to load schema from {path.join(catalog.filePath, file)}, but no schema can be found</div> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
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