-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds pages for ADRs with code styling and mermaid diagrams. About page has some minimal information about the project that can be expanded in the future. Signed-off-by: Rodrigo Pinto <rodrigo.pinto@calian.ca>
- Loading branch information
1 parent
54aa546
commit b1cc799
Showing
20 changed files
with
911 additions
and
19 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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
!examples/*/scripts/ | ||
*.log | ||
*.tsbuildinfo | ||
.DS_Store | ||
.browser_modules/ | ||
/.venv/ | ||
/packages/base/lib/ | ||
|
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,11 +1,11 @@ | ||
# LC_COLLATE=C sort .gitignore | ||
!.env.example | ||
.DS_Store | ||
.env | ||
.env.* | ||
/.svelte-kit | ||
/build | ||
/package | ||
doc-sources | ||
node_modules | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* |
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,4 +1,5 @@ | ||
.DS_Store | ||
doc-sources | ||
node_modules | ||
/build | ||
/.svelte-kit | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import remarkMermaid from '@ysuzuki19/remark-mermaid'; | ||
|
||
const config = { | ||
extensions: ['.svelte.md', '.md', '.svx'], | ||
|
||
smartypants: { | ||
dashes: 'oldschool' | ||
}, | ||
|
||
remarkPlugins: [remarkMermaid], | ||
rehypePlugins: [] | ||
}; | ||
|
||
export default config; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const allAdrFiles = import.meta.glob('/doc-sources/adr-source/*.md'); | ||
const iterableAdrFiles = Object.entries(allAdrFiles); | ||
|
||
export const getAdrsContent = async () => { | ||
const allAdrs = await Promise.all( | ||
iterableAdrFiles.map(async ([path, resolver]) => { | ||
const element = await resolver(); | ||
const metadata = element.metadata; | ||
const content = element.default.render(); | ||
const slug = path.slice(0, -3).split('/').pop(); | ||
|
||
return { | ||
metadata, | ||
slug, | ||
path, | ||
content | ||
}; | ||
}) | ||
); | ||
|
||
return allAdrs; | ||
}; | ||
|
||
export const getAdr = async (slug) => { | ||
const adr = iterableAdrFiles?.filter(([path]) => { | ||
const fileSlug = path.slice(0, -3).split('/').pop(); | ||
|
||
return fileSlug === slug; | ||
}); | ||
|
||
if (adr.length > 0) { | ||
const resolver = adr[0][1]; | ||
const element = await resolver(); | ||
console.log('resolver', element); | ||
// const content = element.default.render() | ||
|
||
// return content | ||
} | ||
|
||
return adr; | ||
}; | ||
|
||
export const getOneAdr = async (slug) => { | ||
const allAdrs = await Promise.all( | ||
iterableAdrFiles.map(async ([path, resolver]) => { | ||
const fileSlug = path.slice(0, -3).split('/').pop(); | ||
let content = 'empty'; | ||
if (fileSlug === slug) { | ||
console.log('equal', slug, path, resolver); | ||
const element = await resolver(); | ||
content = element.default.render(); | ||
} | ||
|
||
return { | ||
content | ||
}; | ||
}) | ||
); | ||
|
||
console.log('all adrs', allAdrs); | ||
return allAdrs; | ||
}; |
Oops, something went wrong.