Skip to content

Commit

Permalink
Merge pull request #35 from TatooiNoyo/format-docs
Browse files Browse the repository at this point in the history
Format all documents
  • Loading branch information
ryan4yin authored Jul 8, 2024
2 parents 834ddd6 + 43c18c8 commit cc4d972
Show file tree
Hide file tree
Showing 21 changed files with 1,278 additions and 678 deletions.
48 changes: 23 additions & 25 deletions src/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
import { defineUserConfig } from "vuepress";
import { defineUserConfig } from "vuepress"

import { removePwaPlugin } from "@vuepress/plugin-remove-pwa";
import { viteBundler } from '@vuepress/bundler-vite'
import cjk_breaks_plugin from '@searking/markdown-it-cjk-breaks';
import { removePwaPlugin } from "@vuepress/plugin-remove-pwa"
import { viteBundler } from "@vuepress/bundler-vite"
import cjk_breaks_plugin from "@searking/markdown-it-cjk-breaks"

import theme from "./theme";
import theme from "./theme"

export default defineUserConfig({
base: "/",
locales: {
"/": {
lang: "zh-CN",
title: "NixOS 中文",
description: "由 NixOS-CN 社区驱动",
},
base: "/",
locales: {
"/": {
lang: "zh-CN",
title: "NixOS 中文",
description: "由 NixOS-CN 社区驱动",
},
theme,
shouldPrefetch: true,
plugins: [
removePwaPlugin({}),
],
extendsMarkdown: (md) => {
md.use(cjk_breaks_plugin);
},
bundler: viteBundler({
viteOptions: {},
vuePluginOptions: {},
}),
});
},
theme,
shouldPrefetch: true,
plugins: [removePwaPlugin({})],
extendsMarkdown: (md) => {
md.use(cjk_breaks_plugin)
},
bundler: viteBundler({
viteOptions: {},
vuePluginOptions: {},
}),
})
58 changes: 29 additions & 29 deletions src/.vuepress/navbar.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import {navbar} from "vuepress-theme-hope";
import { navbar } from "vuepress-theme-hope"

export default navbar([
"/",
{
text: "检索工具",
icon: "toolkit",
children: [
{
text: "软件包",
icon: "pkg",
link: "https://search.nixos.org/packages",
},
{
text: "Options",
icon: "options",
link: "https://search.nixos.org/options",
},
{
text: "Channel 状态",
icon: "nix-channel",
link: "https://status.nixos.org",
},
{
text: "软件包 Pull Request 追踪",
icon: "pullrequest",
link: "https://nixpk.gs/pr-tracker.html",
},
],
},
]);
"/",
{
text: "检索工具",
icon: "toolkit",
children: [
{
text: "软件包",
icon: "pkg",
link: "https://search.nixos.org/packages",
},
{
text: "Options",
icon: "options",
link: "https://search.nixos.org/options",
},
{
text: "Channel 状态",
icon: "nix-channel",
link: "https://status.nixos.org",
},
{
text: "软件包 Pull Request 追踪",
icon: "pullrequest",
link: "https://nixpk.gs/pr-tracker.html",
},
],
},
])
100 changes: 43 additions & 57 deletions src/.vuepress/sidebar.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,45 @@
import {sidebar} from "vuepress-theme-hope";
import { sidebar } from "vuepress-theme-hope"

export default sidebar([
{
text: "安装教程",
icon: "bulb",
prefix: "/tutorials/installation/",
collapsible: false,
children: [
"VirtualMachine",
"WSL2",
"Subsystem",
"Networking"
],
},
{
text: "伊始之章",
icon: "book-fill",
prefix: "/tutorials/concept/",
collapsible: false,
children: [
"BinaryAndSourceDistribution",
"HowToMakePath-dependentProgramsWork",
"ConfigurationIsTheBlueprintOfTheSystem",
"HowFunctionalProgrammingShapesNixOS",
"PurityIsOurUltimatePursuit"
],
},
{
text: "Nix 语言",
icon: "nix",
prefix: "/tutorials/",
collapsible: false,
children: [
"lang/QuickOverview",
"lang/Manuals",
"module-system/intro"
],
},
{
text: "开发环境部署",
icon: "dev",
prefix: "/tutorials/env/dev/",
collapsible: false,
children: [
"haskell"
],
},
{
text: "NixOS 使用手册",
icon: "nix",
prefix: "/manual/",
collapsible: false,
children: [
"Intro",
"Configuration"
],
},
]);
{
text: "安装教程",
icon: "bulb",
prefix: "/tutorials/installation/",
collapsible: false,
children: ["VirtualMachine", "WSL2", "Subsystem", "Networking"],
},
{
text: "伊始之章",
icon: "book-fill",
prefix: "/tutorials/concept/",
collapsible: false,
children: [
"BinaryAndSourceDistribution",
"HowToMakePath-dependentProgramsWork",
"ConfigurationIsTheBlueprintOfTheSystem",
"HowFunctionalProgrammingShapesNixOS",
"PurityIsOurUltimatePursuit",
],
},
{
text: "Nix 语言",
icon: "nix",
prefix: "/tutorials/",
collapsible: false,
children: ["lang/QuickOverview", "lang/Manuals", "module-system/intro"],
},
{
text: "开发环境部署",
icon: "dev",
prefix: "/tutorials/env/dev/",
collapsible: false,
children: ["haskell"],
},
{
text: "NixOS 使用手册",
icon: "nix",
prefix: "/manual/",
collapsible: false,
children: ["Intro", "Configuration"],
},
])
2 changes: 1 addition & 1 deletion src/.vuepress/styles/config.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// you can change config here
$colors: #c0392b, #d35400, #f39c12, #27ae60, #16a085, #2980b9, #8e44ad, #2c3e50,
#7f8c8d !default;
#7f8c8d !default;
120 changes: 60 additions & 60 deletions src/.vuepress/theme.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { hopeTheme } from "vuepress-theme-hope";
import { searchProPlugin } from "vuepress-plugin-search-pro";
import navbar from "./navbar";
import sidebar from "./sidebar";
import { hopeTheme } from "vuepress-theme-hope"
import { searchProPlugin } from "vuepress-plugin-search-pro"
import navbar from "./navbar"
import sidebar from "./sidebar"

export default hopeTheme({
hostname: "https://nixos-cn.github.io",
author: {
name: "NixOS-CN",
url: "https://github.com/nixos-cn",
},
iconAssets: "https://at.alicdn.com/t/c/font_4043253_v7nldr3uv7.css",
iconPrefix: "iconfont icon-",
logo: "/nixos-cn.svg",
repo: "nixos-cn/nixos-cn.github.io",
docsDir: "src",
print: false,
locales: {
"/": {
navbar,
sidebar,
footer: `<a href="https://t.me/nixos_zhcn" target="_blank">
hostname: "https://nixos-cn.github.io",
author: {
name: "NixOS-CN",
url: "https://github.com/nixos-cn",
},
iconAssets: "https://at.alicdn.com/t/c/font_4043253_v7nldr3uv7.css",
iconPrefix: "iconfont icon-",
logo: "/nixos-cn.svg",
repo: "nixos-cn/nixos-cn.github.io",
docsDir: "src",
print: false,
locales: {
"/": {
navbar,
sidebar,
footer: `<a href="https://t.me/nixos_zhcn" target="_blank">
Telegram 群组
</a> |
<a href="https://matrix.to/#/#zh-cn:nixos.org" target="_blank">
Expand All @@ -28,47 +28,47 @@ export default hopeTheme({
<a href="https://nixos.org/" target="_blank">
NixOS 官网
</a>`,
displayFooter: true,
metaLocales: {
editLink: "前往 GitHub 编辑此页",
},
},
displayFooter: true,
metaLocales: {
editLink: "前往 GitHub 编辑此页",
},
},
},

plugins: {
searchPro: {},
mdEnhance: {
align: true,
attrs: true,
codetabs: true,
demo: true,
figure: true,
flowchart: true,
gfm: true,
breaks: false,
imgLazyload: true,
imgSize: true,
include: true,
katex: true,
mark: true,
mermaid: true,
stylize: [
{
matcher: "Recommended",
replacer: ({ tag }) => {
if (tag === "em")
return {
tag: "Badge",
attrs: { type: "tip" },
content: "Recommended",
};
},
},
],
sub: true,
sup: true,
tabs: true,
vPre: true,
plugins: {
searchPro: {},
mdEnhance: {
align: true,
attrs: true,
codetabs: true,
demo: true,
figure: true,
flowchart: true,
gfm: true,
breaks: false,
imgLazyload: true,
imgSize: true,
include: true,
katex: true,
mark: true,
mermaid: true,
stylize: [
{
matcher: "Recommended",
replacer: ({ tag }) => {
if (tag === "em")
return {
tag: "Badge",
attrs: { type: "tip" },
content: "Recommended",
}
},
},
],
sub: true,
sup: true,
tabs: true,
vPre: true,
},
});
},
})
Loading

0 comments on commit cc4d972

Please sign in to comment.