Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build documentation website

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.x"

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run lint check
run: bun flint:check

- name: Build website
env:
SITE_URL_OVERRIDE: ${{ format('https://{0}.github.io/{1}', github.repository_owner, github.event.repository.name) }}
run: bun build:all

- name: Upload artifact
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: build

deploy:
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
node_modules

# Output
.output
.vercel
.netlify
.wrangler
/.svelte-kit
/build
/generated

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
44 changes: 44 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": [
"**/*.js",
"**/*.cjs",
"**/*.mjs",
"**/*.ts",
"**/*.cts",
"**/*.mts",
"**/*.json",
"**/*.jsonc",
"!node_modules",
"!.claude",
"!.svelte-kit",
"!build",
"!repositories"
]
},
"formatter": {
"enabled": true,
"indentStyle": "tab",
"lineWidth": 100
},
"linter": {
"enabled": true
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "always"
}
},
"json": {
"formatter": {
"indentStyle": "tab"
}
}
}
895 changes: 895 additions & 0 deletions bun.lock
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding this file, once the PR is ready, it needs to be updated by maintainer prior merge

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Certain requirements are needed to be able to develop with ReVanced.
- Java Development Kit 17 (e.g. [OpenJDK](https://jdk.java.net/archive/))
- Knowledge of Git, Gradle and how to set up and use multi-module Gradle projects

![Prerequisites setup overview screenshot](./aa.png)

## ⏭️ Whats next

The next section explains, how to set up a suitable development environment for ReVanced with [IntelliJ IDEA](https://www.jetbrains.com/idea/)
Expand Down
File renamed without changes.
File renamed without changes.
Binary file added docs/Development/aa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Enable [Android Auto developer mode](https://developer.android.com/training/cars

## 32 YouTube or YouTube Music playback does not work

First ensure you are using the latest patches. You may be using outdated patches even if the app version has not changed. See [here](https://github.com/ReVanced/revanced-documentation/blob/main/docs/revanced-resources/questions.md#14-how-to-update-patched-apps) for additional information on updating.
First ensure you are using the latest patches. You may be using outdated patches even if the app version has not changed. See [here](questions.md#14-how-to-update-patched-apps) for additional information on updating.

Search for existing issues [here](https://github.com/ReVanced/revanced-patches/issues?q=is%3Aissue%20state%3Aopen) as all known issues will have an existing issue.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
pre-commit:
parallel: true
commands:
check:
files: git diff --name-only --cached --diff-filter=AM
glob: "*.{js,ts,json}"
run: bunx biome check {files}

commit-msg:
parallel: false
commands:
commitlint:
run: bunx commitlint --edit
53 changes: 53 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "revanced-documentation",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"generate:docs": "bun scripts/generate-docs-graph.ts",
"dev": "bunx --bun svelte-kit sync && bunx --bun vite dev",
"build:all": "bun run generate:docs && bun run build:llms && bun run build && bun run build:sitemap",
"build": "bunx --bun svelte-kit sync && bunx --bun vite build",
"build:llms": "bun scripts/build-llms.ts",
"build:sitemap": "bun scripts/build-sitemap.ts",
"preview": "bunx --bun vite preview",
"flint": "biome check --write .",
"flint:check": "biome check .",
"clint": "commitlint --edit"
},
"devDependencies": {
"@biomejs/biome": "^2.3.14",
"@commitlint/cli": "^20.4.1",
"@commitlint/config-conventional": "^20.4.1",
"@iconify-json/mdi": "^1.2.3",
"@sveltejs/kit": "^2.50.1",
"@sveltejs/vite-plugin-svelte": "^6.2.4",
"fast-glob": "^3.3.3",
"github-slugger": "^2.0.0",
"gray-matter": "^4.0.3",
"lefthook": "^2.1.0",
"mdast-util-to-string": "^4.0.0",
"remark-frontmatter": "^5.0.0",
"svelte": "^5.48.2",
"svelte-check": "^4.3.5",
"typescript": "^5.9.3",
"unist-util-visit": "^5.1.0",
"unplugin-icons": "^23.0.1",
"vite": "^7.3.1"
},
"dependencies": {
"@sveltejs/adapter-static": "^3.0.10",
"mdsvex": "^0.12.6",
"minisearch": "^7.2.0",
"rehype-autolink-headings": "^7.1.0",
"rehype-sanitize": "^6.0.0",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.1",
"remark-parse": "^11.0.0",
"sass": "^1.97.3",
"sharp": "^0.34.5",
"shiki": "^3.22.0",
"svelte-sitemap": "^2.7.1",
"unified": "^11.0.5"
}
}
73 changes: 73 additions & 0 deletions scripts/build-llms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import matter from 'gray-matter';
import { DOCS_DIR, SITE_DESCRIPTION, SITE_TITLE } from '../site.config.js';
import type { DocsGraph } from '../src/lib/core/types';

interface LlmsSourceDocument {
content: string;
includeInLlms: boolean;
}

function parseLlmsSource(rawMarkdown: string): LlmsSourceDocument {
const parsed = matter(rawMarkdown);
const includeInLlms = parsed.data?.llms !== false;
return {
content: parsed.content.trim(),
includeInLlms,
};
}

function buildLlmsDocument(
graph: DocsGraph,
options: { title: string; description: string },
readSourceMarkdown: (sourcePath: string) => string,
): string {
const docsByRoute = new Map(graph.docs.map((doc) => [doc.routePath, doc]));
const parts: string[] = [`# ${options.title}`, '', options.description, ''];

for (const section of graph.sections) {
const sectionParts: string[] = [];

for (const routePath of section.pages) {
const doc = docsByRoute.get(routePath);
if (!doc) {
throw new Error(`Missing docs graph node for route '${routePath}'`);
}

const source = parseLlmsSource(readSourceMarkdown(doc.sourcePath));
if (!source.includeInLlms || !source.content) {
continue;
}

sectionParts.push(`### ${doc.title}`, `Source: ${doc.routePath}`, '', source.content, '');
}

if (sectionParts.length === 0) {
continue;
}

parts.push('---', `## ${section.title}`, '', ...sectionParts);
}

return `${parts.join('\n').trimEnd()}\n`;
}

const graphPath = join(process.cwd(), '.svelte-kit/generated/docs-graph.json');
const graph = JSON.parse(readFileSync(graphPath, 'utf-8')) as DocsGraph;

const llmsDocument = buildLlmsDocument(
graph,
{
title: SITE_TITLE,
description: SITE_DESCRIPTION,
},
(sourcePath) => {
const sourceAbsolutePath = join(process.cwd(), DOCS_DIR, sourcePath);
return readFileSync(sourceAbsolutePath, 'utf-8');
},
);

const outDir = join(process.cwd(), 'build');
mkdirSync(outDir, { recursive: true });
writeFileSync(join(outDir, 'llms.txt'), llmsDocument);
3 changes: 3 additions & 0 deletions scripts/build-sitemap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { SITE_URL } from '../site.config.js';

await Bun.$`bunx svelte-sitemap --domain ${SITE_URL}`;
Loading