-
Notifications
You must be signed in to change notification settings - Fork 1.9k
docs: v2 docs & landing #4460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jktrn-osec
wants to merge
72
commits into
otter-sec:anchor-next
Choose a base branch
from
jktrn-osec:enscribe/v2-docs
base: anchor-next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
docs: v2 docs & landing #4460
Changes from 56 commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
2afb7e9
docs: new docs framework
fda1c7e
feat(docs): expressive-code custom plugins
jktrn-osec e813bf3
chore: sync
jktrn-osec b8b9cea
chore: sync
jktrn-osec 91e21d2
chore: sync
jktrn-osec 4f302e6
chore: sync
jktrn-osec 2447ac5
chore: sync
jktrn-osec 564afe5
chore: sync
jktrn-osec b7880ac
chore: sync
jktrn-osec 10ea626
feat: title and description markdown rendering for inline code
jktrn-osec 79192ed
chore: sync
jktrn-osec c4b5174
chore: sync
jktrn-osec 449448e
chore: sync
jktrn-osec 38fe3b3
chore(docs): changelog
jktrn-osec cb777b2
Merge remote-tracking branch 'upstream/anchor-next' into enscribe/v2-…
jktrn-osec 8c432ef
chore: sync
jktrn-osec e5823d0
feat(docs): complete references conversions
jktrn-osec 658f5e4
feat(docs): tokens conversion
jktrn-osec eb8ccba
fix(docs): base url as `/docs`
jktrn-osec a78b8e7
chore(docs): add trailing slashes
jktrn-osec 3df5eec
feat(docs): v2 docs
jktrn-osec 6a2a778
ci(docs-v2): add Vercel staging deployment
jktrn-osec d420696
ci(docs-v2): add Node 22 to deploy workflow
jktrn-osec 6a6e1b5
chore(docs-v2): replace template favicons with Anchor branding
jktrn-osec f1e63bd
fix(docs-v2): move prose to @layer utilities so prod build keeps the …
jktrn-osec cdb7d3a
chore(docs): soften language
jktrn-osec e226059
fix(docs-v2): make view transitions actually animate
jktrn-osec 16c3119
chore: adjust errors
jktrn-osec 1a8c53e
fix(docs-v2): use plus-lighter blend for view-transition cross-fade
jktrn-osec 5eae710
Revert "fix(docs-v2): use plus-lighter blend for view-transition cros…
jktrn-osec 0af92e4
Revert "fix(docs-v2): make view transitions actually animate"
jktrn-osec 3146f38
chore(docs): v2 nits
jktrn-osec 301192a
feat(docs): icons & favicons
jktrn-osec 814248b
feat(docs): local icons, reduce nested padding
jktrn-osec 3020d6d
fix(docs): fix wordiness
jktrn-osec 941b37d
feat(docs): use cooler callout components
jktrn-osec 7dc2b6e
fix(docs): actually serve fonts
jktrn-osec c8bed43
refactor(docs): clean typography css
jktrn-osec b059c31
refactor(docs): more readable small utility
jktrn-osec 53a7d32
fix(docs): clean up old splash
jktrn-osec 307352c
Merge remote-tracking branch 'upstream/anchor-next' into enscribe/v2-…
jktrn-osec ff6cff4
docs: restructure v1 docs
jktrn-osec 19e5a5d
feat(docs): v2 docs
jktrn-osec 4b79cdd
fix(docs): improve language
jktrn-osec 8fb3072
fix(docs): improve language
jktrn-osec cb4b536
feat(docs): landing wip, homer graphics
jktrn-osec 17edd4b
feat(docs): landing
jktrn-osec da52ceb
refactor(docs): cleanup
jktrn-osec ea486b9
feat(docs): rotating banner
jktrn-osec 48ea5f9
fix(docs): better copy
jktrn-osec bff6e7e
chore(docs): revert crossfade
jktrn-osec f4b293b
feat(docs): og image generation
jktrn-osec 4c28225
chore(docs): vercel site resolution
jktrn-osec 20bfdd9
fix(docs): increase padding in og image
jktrn-osec b99c255
perf(docs): serve as webp
jktrn-osec 2ca0984
refactor(docs): nits
jktrn-osec 26a4b69
Merge remote-tracking branch 'upstream/anchor-next' into enscribe/v2-…
jktrn-osec 663a875
feat(docs): rework
jktrn-osec cc57ffa
fix(docs): restore rotating banner
jktrn-osec 46501ad
fix(docs): disable scroll-mt behavior for root of scroll group
jktrn-osec 5394912
fix(docs): remove ansi, use tones, add file/dir markers
jktrn-osec 8eefb4a
feat(docs): v1.0.2 changelog, sync with master
jktrn-osec e8d2679
chore: sync
jktrn-osec 9712c1a
chore: cleanup
jktrn-osec 28c6f5f
chore(docs): address feedback
jktrn-osec 14bfd64
feat(docs): better readme
jktrn-osec 9c656e3
fix(docs): better form factor for v1.0.2 docs
jktrn-osec ec15568
chore(docs): address feedback
jktrn-osec bfbe21b
chore: lint
jktrn-osec 281c193
feat(docs): table scroll area
jktrn-osec cbf7a5c
fix(docs): humanize
jktrn-osec e8740be
fix(docs): digestability
jktrn-osec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,71 @@ | ||
| name: Deploy docs-v2 (staging) | ||
|
|
||
| on: | ||
| push: | ||
| branches: [enscribe/v2-docs] | ||
| paths: | ||
| - 'docs-v2/**' | ||
| - '.github/workflows/deploy-docs-v2.yaml' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: deploy-docs-v2 | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
|
|
||
| jobs: | ||
| deploy: | ||
| name: Build and deploy to Vercel | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: docs-v2 | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | ||
| with: | ||
| bun-version: latest | ||
|
|
||
| - name: Install Vercel CLI | ||
| run: bun install -g vercel@latest | ||
|
|
||
| - name: Pull Vercel environment | ||
| run: vercel pull --yes --environment=production --token="$VERCEL_TOKEN" | ||
| env: | ||
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | ||
|
|
||
| - name: Build with Vercel | ||
| run: vercel build --prod --token="$VERCEL_TOKEN" | ||
| env: | ||
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | ||
|
|
||
| - name: Deploy to Vercel (production) | ||
| id: deploy | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| url=$(vercel deploy --prebuilt --prod --token="$VERCEL_TOKEN") | ||
| echo "url=$url" >> "$GITHUB_OUTPUT" | ||
| env: | ||
| VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | ||
|
|
||
| - name: Write summary | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| { | ||
| echo "## Staging deployment" | ||
| echo "" | ||
| echo "- Commit deploy URL: ${{ steps.deploy.outputs.url }}" | ||
| echo "- Stable staging URL: https://anchor-docs-staging.vercel.app/docs/" | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -25,3 +25,5 @@ docker-target | |
| test-keypair.json | ||
| tsconfig.tsbuildinfo | ||
| .vscode | ||
| *.stackdump | ||
| CODEX_NOTES.md | ||
This file contains hidden or 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 @@ | ||
| *.mdx linguist-vendored |
This file contains hidden or 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 @@ | ||
| dist/ | ||
| .astro/ | ||
| node_modules/ | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| .env | ||
| .env.production | ||
| .DS_Store | ||
| .idea/ | ||
| teaser.pptx | ||
| ~$teaser.pptx | ||
| .vercel |
This file contains hidden or 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,13 @@ | ||
| <div align="center"> | ||
|
|
||
| ## astro-erudocs | ||
|
|
||
| </div> | ||
|
|
||
| astro-erudocs is an opinionated, unstyled documentation framework built with [Astro](https://astro.build/), [Tailwind](https://tailwindcss.com/), and [shadcn/ui](https://ui.shadcn.com/). It is a sister project to [astro-erudite](https://github.com/jktrn/astro-erudite), inheriting its design system and technical-content tooling (Expressive Code, KaTeX, callouts, OKLCh tokens, view transitions) and re-shaping them around docs-native primitives: hierarchical sidebar, static search, prev/next navigation, and MDX components for steps, tabs, file trees, and cards. | ||
|
|
||
| > [!WARNING] This repository is in active early development. The public API and file layout will change. | ||
|
|
||
| ## License | ||
|
|
||
| MIT. See [LICENSE](LICENSE). |
This file contains hidden or 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,152 @@ | ||
| import { defineConfig } from 'astro/config' | ||
|
|
||
| import mdx from '@astrojs/mdx' | ||
| import react from '@astrojs/react' | ||
| import sitemap from '@astrojs/sitemap' | ||
| import pagefind from 'astro-pagefind' | ||
|
|
||
| import { rehypeHeadingIds } from '@astrojs/markdown-remark' | ||
| import rehypeAutolinkHeadings from 'rehype-autolink-headings' | ||
| import rehypeExpressiveCode from 'rehype-expressive-code' | ||
| import rehypeExternalLinks from 'rehype-external-links' | ||
| import rehypeKatex from 'rehype-katex' | ||
| import rehypeShiki from '@shikijs/rehype' | ||
| import remarkEmoji from 'remark-emoji' | ||
| import remarkMath from 'remark-math' | ||
|
|
||
| import { rehypeInlineShellCmd } from './src/lib/rehype-inline-shell-cmd' | ||
| import { rehypeInlinePathIcon } from './src/lib/rehype-inline-path-icon' | ||
| import { rehypeWrapTables } from './src/lib/rehype-wrap-tables' | ||
| import { ecOptions } from './src/lib/ec-config' | ||
| import { latte, mocha } from './src/lib/shiki-themes' | ||
| import { resolveSiteUrl } from './src/lib/site-url' | ||
|
|
||
| import tailwindcss from '@tailwindcss/vite' | ||
| import { extname, isAbsolute, relative, resolve } from 'node:path' | ||
| import { readFile } from 'node:fs/promises' | ||
|
|
||
| type DevMiddleware = ( | ||
| req: { url?: string }, | ||
| res: { setHeader(name: string, value: string): void; end(data: Uint8Array): void }, | ||
| next: () => void, | ||
| ) => void | Promise<void> | ||
|
|
||
| type DevServer = { | ||
| middlewares: { | ||
| use(path: string, handler: DevMiddleware): void | ||
| } | ||
| } | ||
|
|
||
| const DOCS_BASE = '/docs' | ||
| const PAGEFIND_DIST_DIR = resolve(process.cwd(), 'dist', 'docs', 'pagefind') | ||
|
|
||
| function pagefindDevServer() { | ||
| const mime: Record<string, string> = { | ||
| js: 'application/javascript', | ||
| mjs: 'application/javascript', | ||
| css: 'text/css', | ||
| json: 'application/json', | ||
| wasm: 'application/wasm', | ||
| } | ||
|
|
||
| return { | ||
| name: 'pagefind-dev-server', | ||
| enforce: 'pre' as const, | ||
| apply: 'serve' as const, | ||
| configureServer(server: DevServer) { | ||
| server.middlewares.use('/pagefind', async (req, res, next) => { | ||
| const filePath = resolvePagefindAsset(req.url ?? '/') | ||
| if (!filePath) return next() | ||
|
|
||
| try { | ||
| const data = await readFile(filePath) | ||
| const ext = extname(filePath).slice(1) | ||
| if (mime[ext]) res.setHeader('Content-Type', mime[ext]) | ||
| res.end(data) | ||
| } catch { | ||
| next() | ||
| } | ||
| }) | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| function resolvePagefindAsset(url: string): string | null { | ||
| let pathname: string | ||
| try { | ||
| pathname = decodeURIComponent(url.split('?')[0] ?? '/') | ||
| } catch { | ||
| return null | ||
| } | ||
|
|
||
| if (!pathname || pathname === '/') return null | ||
|
|
||
| const filePath = resolve(PAGEFIND_DIST_DIR, `.${pathname}`) | ||
| const relativePath = relative(PAGEFIND_DIST_DIR, filePath) | ||
|
|
||
| if (relativePath.startsWith('..') || isAbsolute(relativePath)) return null | ||
|
|
||
| return filePath | ||
| } | ||
|
|
||
| export default defineConfig({ | ||
| site: resolveSiteUrl(), | ||
| base: DOCS_BASE, | ||
| trailingSlash: 'always', | ||
| outDir: './dist/docs', | ||
| integrations: [mdx(), react(), sitemap(), pagefind()], | ||
| vite: { | ||
| plugins: [tailwindcss(), pagefindDevServer()], | ||
| }, | ||
| server: { | ||
| port: 4321, | ||
| host: true, | ||
| }, | ||
| devToolbar: { | ||
| enabled: false, | ||
| }, | ||
| markdown: { | ||
| syntaxHighlight: false, | ||
| rehypePlugins: [ | ||
| [ | ||
| rehypeExternalLinks, | ||
| { | ||
| target: '_blank', | ||
| rel: ['nofollow', 'noreferrer', 'noopener'], | ||
| }, | ||
| ], | ||
| rehypeWrapTables, | ||
| rehypeKatex, | ||
| [rehypeExpressiveCode, { themes: [latte, mocha], ...ecOptions }], | ||
| [ | ||
| rehypeShiki, | ||
| { | ||
| themes: { light: latte, dark: mocha }, | ||
| inline: 'tailing-curly-colon', | ||
| }, | ||
| ], | ||
| rehypeInlineShellCmd, | ||
| rehypeInlinePathIcon, | ||
| rehypeHeadingIds, | ||
| [ | ||
| rehypeAutolinkHeadings, | ||
| { | ||
| behavior: 'append', | ||
| properties: { | ||
| className: ['heading-anchor'], | ||
| 'aria-label': 'Link to section', | ||
| tabindex: -1, | ||
| 'data-pagefind-ignore': '', | ||
| }, | ||
| content: { | ||
| type: 'text', | ||
| value: '#', | ||
| }, | ||
| test: (node: { tagName: string }) => | ||
| ['h2', 'h3', 'h4', 'h5', 'h6'].includes(node.tagName), | ||
| }, | ||
| ], | ||
| ], | ||
| remarkPlugins: [remarkMath, remarkEmoji], | ||
| }, | ||
| }) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.