-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Doesn't change any behavior just makes the docs a bit cleaner with syntax highlighting and made some of the examples/wording clearer. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
108f144
commit 1c2e456
Showing
6 changed files
with
36 additions
and
71 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,20 @@ | ||
--- | ||
import Code from "astro/components/Code.astro"; | ||
import { Code } from '@astrojs/starlight/components'; | ||
//import Code from "astro/components/Code.astro"; Don't use this, use the starlight component specifically | ||
const { data } = Astro.props; // Receive the data as a prop | ||
const response = await fetch(data); | ||
const fetchedData = await response.text(); | ||
// // Function to extract the basename from a URL | ||
// const getBasename = (url: string | URL) => { | ||
// const urlObj = new URL(url); | ||
// return urlObj.pathname.split('/').filter(Boolean).pop() || 'Index'; | ||
// }; | ||
// Function to extract the basename from a URL | ||
const getBasename = (url: string | URL) => { | ||
const urlObj = new URL(url); | ||
return urlObj.pathname.split('/').filter(Boolean).pop() || 'Index'; | ||
}; | ||
// const basename = getBasename(data); | ||
const basename = getBasename(data); | ||
--- | ||
|
||
<style> | ||
.data-container pre { | ||
white-space: pre-wrap; /* Allows wrapping of long lines */ | ||
word-wrap: break-word; /* Ensures long words break and wrap */ | ||
overflow-x: auto; /* Adds horizontal scrollbar if necessary */ | ||
} | ||
|
||
.data-container a { | ||
text-decoration: none; /* Removes underline from link */ | ||
color: #007bff; /* Link color */ | ||
} | ||
</style> | ||
|
||
|
||
<Code code={fetchedData} lang="yml" /> | ||
<Code code={fetchedData} lang="yml" title={basename}/> |
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
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
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