diff --git a/.prettierignore b/.prettierignore index a8eee583..ffa6089c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,7 @@ .DS_Store node_modules /build +/testing-docs /public /.svelte-kit /package diff --git a/README.md b/README.md index a220a699..2871e263 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ The official ReVanced Website. +## Documentation + +The documentation you see on the live website is generated from a collection of markup files found in [this git repository](https://github.com/revanced/revanced-documentation). The documentation "generator" currently supports asciidoc and markdown. + +It looks for markup files in the `testing-docs` folder by default, but you can specify a different path by changing the `REVANCED_DOCS_FOLDER` environment variable. + ## Developing Install dependencies with `npm install` (or `pnpm install`). diff --git a/ci-build.sh b/ci-build.sh new file mode 100755 index 00000000..9d7d6f42 --- /dev/null +++ b/ci-build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e + +# CD to the directory of this script. +cd "$(dirname "$0")" + +docs_git_repo="${REVANCED_DOCS_REPO:-https://github.com/revanced/revanced-documentation.git}" + +git clone "$docs_git_repo" "_docs_src" +# TODO: transform a tag links so this works properly... +#export REVANCED_DOCS_FOLDER="_docs_src/docs" + +#git clone --recurse-submodules "$docs_git_repo" "_docs_src" + +# Copy assets from docs repo to here. +# mkdir -p static/docs +# cp -r "$REVANCED_DOCS_FOLDER"/assets static/docs/assets || true + +npm run build diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f40d2811..a5ecda09 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,9 +61,6 @@ devDependencies: sass: specifier: ^1.55.0 version: 1.64.1 - semver: - specifier: ^7.5.4 - version: 7.5.4 sirv-cli: specifier: ^2.0.2 version: 2.0.2 diff --git a/src/layout/Footer/FooterHost.svelte b/src/layout/Footer/FooterHost.svelte index 066fbb13..fa737933 100644 --- a/src/layout/Footer/FooterHost.svelte +++ b/src/layout/Footer/FooterHost.svelte @@ -5,7 +5,7 @@ import { queries } from '$data/api'; import { friendlyName } from '$util/friendlyName'; import { createQuery } from '@tanstack/svelte-query'; - + import Query from '$lib/components/Query.svelte'; import FooterSection from './FooterSection.svelte'; @@ -50,6 +50,7 @@
  • Home
  • Download
  • +
  • Documentation
  • Patches
  • Contributors
  • @@ -68,11 +69,20 @@ diff --git a/src/layout/Navbar/NavHost.svelte b/src/layout/Navbar/NavHost.svelte index 9f4c2067..3cd525e5 100644 --- a/src/layout/Navbar/NavHost.svelte +++ b/src/layout/Navbar/NavHost.svelte @@ -71,6 +71,7 @@ Home Download Patches + Docs Contributors @@ -107,9 +108,7 @@ Settings - Configure the API for this website. + Configure the API for this website.
    diff --git a/src/routes/docs/+layout.server.ts b/src/routes/docs/+layout.server.ts new file mode 100644 index 00000000..9720f30a --- /dev/null +++ b/src/routes/docs/+layout.server.ts @@ -0,0 +1,10 @@ +import type { LayoutServerLoad } from './$types'; + +import { index_content } from './documentation.server'; + +// The load function here used to get data from a json file created by a (prerendered) server route. +// This was because we could not prerender the documentation route before. +// If you can no longer prerender the docs, then you are going to have to move the load functions here to a prerendered server route like before and fetch them here. +export const prerender = true; + +export const load: LayoutServerLoad = () => ({ tree: index_content() }); diff --git a/src/routes/docs/+layout.svelte b/src/routes/docs/+layout.svelte new file mode 100644 index 00000000..d3cf431c --- /dev/null +++ b/src/routes/docs/+layout.svelte @@ -0,0 +1,37 @@ + + +
    + + +
    +