Skip to content

Commit

Permalink
Add mock eigen deploy to dev script
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejearley committed Oct 21, 2023
1 parent 7ad2134 commit eb6955c
Show file tree
Hide file tree
Showing 10 changed files with 8,051 additions and 0 deletions.
1 change: 1 addition & 0 deletions common/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @casimir/docs
9 changes: 9 additions & 0 deletions common/docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[output.html]
mathjax-support = true
additional-js = ['mermaid.min.js', 'mermaid-init.js']

[preprocessor.katex]
after = ['links']

[preprocessor.mermaid]
command = 'mdbook-mermaid'
12 changes: 12 additions & 0 deletions common/docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@casimir/docs",
"private": "true",
"scripts": {
"build": "npx esno -r dotenv/config src/doc.ts",
"dev": "DEV=true npx esno -r dotenv/config src/doc.ts",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"@types/node": "^17.0.38"
}
}
1 change: 1 addition & 0 deletions common/docs/public/mermaid-init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mermaid.initialize({startOnLoad:true});
1,282 changes: 1,282 additions & 0 deletions common/docs/public/mermaid.min.js

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions common/docs/scripts/doc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import fs from 'fs'
import { run } from '@casimir/shell'

void async function () {
const cargo = await run('which cargo') as string
if (!cargo || cargo.includes('not found')) {
throw new Error('🚩 Please install rust (see https://www.rust-lang.org/tools/install)')
}

const mdbookKatex = await run('cargo install --list | grep mdbook-katex') as string
if (!mdbookKatex) {
await run('cargo install mdbook-katex')
}

const mdbookMermaid = await run('cargo install --list | grep mdbook-mermaid') as string
if (!mdbookMermaid) {
await run('cargo install mdbook-mermaid')
}

// const config = await run('forge config') as string

// const outDir = config.match(/\[doc\]\nout = "(.*)"/)?.[1] as string
// if (!fs.existsSync(outDir)) {
// fs.mkdirSync(outDir, { recursive: true })
// }

// const publicDir = fs.readdirSync('public')
// for (const file of publicDir) {
// fs.copyFileSync(`public/${file}`, `${outDir}/${file}`)
// }

// await run('forge doc')
}()
4 changes: 4 additions & 0 deletions common/docs/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<img width="50px" alt="Casimir logo" src="casimir.png">

# Casimir Docs
3 changes: 3 additions & 0 deletions common/docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Summary

[Introduction](README.md)
Loading

0 comments on commit eb6955c

Please sign in to comment.