Skip to content

Commit

Permalink
minor fixes for vitepress
Browse files Browse the repository at this point in the history
  • Loading branch information
jrappen committed Oct 31, 2023
1 parent f0c2715 commit 5c554be
Show file tree
Hide file tree
Showing 10 changed files with 172 additions and 114 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* text=auto eol=lf
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.md linguist-detectable linguist-language=Markdown
22 changes: 19 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ on:
branches:
- master

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

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
lfs: true

Expand All @@ -27,10 +31,22 @@ jobs:
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install
run: |
pnpm install
- name: Check Dependencies
run: |
pnpm list --recursive
pnpm licenses list
pnpm outdated --recursive
- name: Check pnpm
run: |
pnpm doctor
- name: Build Docs
run: pnpm run build
run: |
pnpm run build
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
Expand Down
20 changes: 16 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# macOS

.DS_Store

# node

node_modules/
docs/.vitepress/cache

# yarn

yarn-error.log

# vitepress

docs/.vitepress/.cache
docs/.vitepress/.temp
docs/.vitepress/dist
yarn-error.log

*.sublime-workspace
.DS_Store
# Sublime Text

*.sublime-workspace
4 changes: 1 addition & 3 deletions docs/.vitepress/components/Contributors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@
}
</style>


<script>
<script lang="ts">
import { VPTeamMembers } from 'vitepress/theme'
import { data } from '../data/contributors.data.ts'
Expand All @@ -107,4 +106,3 @@ export default {
},
}
</script>

134 changes: 75 additions & 59 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
import { defineConfig, defineConfig, type HeadConfig } from 'vitepress';
import { defineConfig, type HeadConfig } from 'vitepress';

const head: HeadConfig[] = [
const customHead: HeadConfig[] = [
['meta', { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no' }],

['meta', { name: 'author', content: 'sublime text community' }],
['meta', { name: 'keywords', content: 'sublime text,sublime,documentation' }],
['meta', { name: 'theme-color', content: '#E79823' }],

['meta', { name: 'theme-color', content: '#e79823' }],
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
['meta', { name: 'msapplication-TileColor', content: '#000000' }],
['meta', { name: 'msapplication-TileColor', content: '#e79823' }],

['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg', sizes: 'any' }],
['link', { rel: 'mask-icon', type: 'image/svg+xml', href: '/logo.svg', color: '#e79823' }],
];

export default defineConfig({
title: "Sublime Text Community Documentation",
description: "Community-driven Documentation for Sublime Text",
head,
title: 'Sublime Text Community Documentation',
description: 'Community-driven Documentation for Sublime Text',
head: customHead,
themeConfig: {
logo: "/logo.svg",
siteTitle: "ST Community Docs",
logo: '/logo.svg',
siteTitle: 'ST Community Docs',
appearance: 'dark',
lastUpdated: {
text: 'Updated at',
Expand All @@ -25,6 +30,14 @@ export default defineConfig({
timeStyle: 'short'
}
},
editLink: {
text: 'Edit this page on GitHub',
pattern: 'https:/github.com/sublimetext-io/docs.sublimetext.io/blob/master/docs/:path'
},
outline: {
label: 'On this page',
level: [2, 3]
},
// search: {
// provider: 'local',
// options: {
Expand All @@ -40,84 +53,84 @@ export default defineConfig({
},
// Navbar Link
nav: [
{ text: "Guide", link: "/guide/", activeMatch: "^/guide/" },
{ text: "Reference", link: "/reference/", activeMatch: "^/reference/" },
{ text: "Glossary", link: "/glossary.md" },
{ text: 'Guide', link: '/guide/', activeMatch: '^/guide/' },
{ text: 'Reference', link: '/reference/', activeMatch: '^/reference/' },
{ text: 'Glossary', link: '/glossary.md' },
{
text: "More", items: [
{ text: "Contributing", link: "/contributing.md" },
{ text: "Backers", link: "/backers.md" },
text: 'More', items: [
{ text: 'Contributing', link: '/contributing.md' },
{ text: 'Backers', link: '/backers.md' },
]
}
],
// Social Icons
socialLinks: [
{ icon: "github", link: "https://github.com/sublimetext-io/docs.sublimetext.io" },
{ icon: "discord", link: "https://discord.sublimetext.io/" },
{ icon: 'github', link: 'https://github.com/sublimetext-io/docs.sublimetext.io' },
{ icon: 'discord', link: 'https://discord.sublimetext.io/' },
],
// Sidebar
sidebar: {
'/guide/': [
{
text: "Guide",
text: 'Guide',
collapsed: false,
items: [
{ text: "Introduction", link: "/guide/" },
{ text: 'Introduction', link: '/guide/' },
],
},
{
text: 'Getting Started',
collapsed: false,
items: [
{ text: "Installation", link: '/guide/getting-started/installation.md' },
{ text: "Basic Concepts", link: '/guide/getting-started/basic-concepts.md' },
{ text: 'Installation', link: '/guide/getting-started/installation.md' },
{ text: 'Basic Concepts', link: '/guide/getting-started/basic-concepts.md' },
],
},
{
text: 'Basic Usage',
collapsed: false,
items: [
{ text: "Editing", link: '/guide/usage/editing.md' },
{ text: 'Editing', link: '/guide/usage/editing.md' },
{
text: 'File Management & Navigation',
link: '/guide/usage/file-management/',
items: [
{ text: "Projects", link: '/guide/usage/file-management/projects.md' },
{ text: "Navigation", link: '/guide/usage/file-management/navigation.md' },
{ text: 'Projects', link: '/guide/usage/file-management/projects.md' },
{ text: 'Navigation', link: '/guide/usage/file-management/navigation.md' },
],
},
{ text: "Search and Replace", link: '/guide/usage/search-and-replace.md' },
{ text: "Build Systems", link: '/guide/usage/build-systems.md' },
{ text: 'Search and Replace', link: '/guide/usage/search-and-replace.md' },
{ text: 'Build Systems', link: '/guide/usage/build-systems.md' },
],
},
{
text: 'Customization',
collapsed: false,
items: [
{ text: "Settings", link: '/guide/customization/settings.md' },
{ text: "Key Bindings", link: '/guide/customization/key_bindings.md' },
{ text: "Menus", link: '/guide/customization/menus.md' },
{ text: "Color Schemes", link: '/guide/customization/color_schemes.md' },
{ text: 'Settings', link: '/guide/customization/settings.md' },
{ text: 'Key Bindings', link: '/guide/customization/key_bindings.md' },
{ text: 'Menus', link: '/guide/customization/menus.md' },
{ text: 'Color Schemes', link: '/guide/customization/color_schemes.md' },
],
},
{
text: 'Extensibility & Automation',
collapsed: false,
items: [
{ text: "Command Palette", link: '/guide/extensibility/command_palette.md' },
{ text: "Commands", link: '/guide/extensibility/commands.md' },
{ text: "Completions", link: '/guide/extensibility/completions.md' },
{ text: "Macros", link: '/guide/extensibility/macros.md' },
{ text: "Packages", link: '/guide/extensibility/packages.md' },
{ text: 'Command Palette', link: '/guide/extensibility/command_palette.md' },
{ text: 'Commands', link: '/guide/extensibility/commands.md' },
{ text: 'Completions', link: '/guide/extensibility/completions.md' },
{ text: 'Macros', link: '/guide/extensibility/macros.md' },
{ text: 'Packages', link: '/guide/extensibility/packages.md' },
{
text: 'Plugins',
link: '/guide/extensibility/plugins/',
items: [
{ text: "Input Handlers", link: '/guide/extensibility/plugins/input_handlers.md' },
{ text: 'Input Handlers', link: '/guide/extensibility/plugins/input_handlers.md' },
],
},
{ text: "Snippets", link: '/guide/extensibility/snippets.md' },
{ text: "Syntax Definitions", link: '/guide/extensibility/syntaxdefs.md' },
{ text: 'Snippets', link: '/guide/extensibility/snippets.md' },
{ text: 'Syntax Definitions', link: '/guide/extensibility/syntaxdefs.md' },
],
},
],
Expand All @@ -126,29 +139,29 @@ export default defineConfig({
text: 'Reference',
link: '/reference/',
items: [
{ text: "Build Systems", link: 'https://www.sublimetext.com/docs/build_systems.html' },
{ text: "Color Schemes", link: 'https://www.sublimetext.com/docs/color_schemes.html' },
{ text: "Color Schemes Legacy", link: '/reference/color_schemes_legacy.md' },
{ text: "Command Palette", link: '/reference/command_palette.md' },
{ text: "Commands", link: '/reference/commands.md' },
{ text: "Comments", link: '/reference/comments.md' },
{ text: "Completions", link: '/reference/completions.md' },
{ text: "Key Bindings", link: '/reference/key_bindings.md' },
{ text: "Mouse Bindings", link: '/reference/mouse_bindings.md' },
{ text: "Menus", link: '/reference/menus.md' },
{ text: "Metadata", link: '/reference/metadata.md' },
{ text: "Plugins", link: '/reference/plugins.md' },
{ text: "Projects", link: '/reference/projects.md' },
{ text: "Python API", link: '/reference/python_api.md' },
{ text: "Settings", link: '/reference/settings.md' },
{ text: "Symbols", link: '/reference/symbols.md' },
{ text: "Syntax", link: 'https://www.sublimetext.com/docs/syntax.html' },
{ text: "Syntax Definitions Legacy", link: '/reference/syntaxdefs_legacy.md' },
{ text: 'Build Systems', link: 'https://www.sublimetext.com/docs/build_systems.html' },
{ text: 'Color Schemes', link: 'https://www.sublimetext.com/docs/color_schemes.html' },
{ text: 'Color Schemes Legacy', link: '/reference/color_schemes_legacy.md' },
{ text: 'Command Palette', link: '/reference/command_palette.md' },
{ text: 'Commands', link: '/reference/commands.md' },
{ text: 'Comments', link: '/reference/comments.md' },
{ text: 'Completions', link: '/reference/completions.md' },
{ text: 'Key Bindings', link: '/reference/key_bindings.md' },
{ text: 'Mouse Bindings', link: '/reference/mouse_bindings.md' },
{ text: 'Menus', link: '/reference/menus.md' },
{ text: 'Metadata', link: '/reference/metadata.md' },
{ text: 'Plugins', link: '/reference/plugins.md' },
{ text: 'Projects', link: '/reference/projects.md' },
{ text: 'Python API', link: '/reference/python_api.md' },
{ text: 'Settings', link: '/reference/settings.md' },
{ text: 'Symbols', link: '/reference/symbols.md' },
{ text: 'Syntax', link: 'https://www.sublimetext.com/docs/syntax.html' },
{ text: 'Syntax Definitions Legacy', link: '/reference/syntaxdefs_legacy.md' },
{
text: 'Keyboard Shortcuts',
items: [
{ text: "Windows/Linux", link: '/reference/keyboard_shortcuts_win.md' },
{ text: "MacOS/OSX", link: '/reference/keyboard_shortcuts_osx.md' },
{ text: 'Windows/Linux', link: '/reference/keyboard_shortcuts_win.md' },
{ text: 'MacOS/OSX', link: '/reference/keyboard_shortcuts_osx.md' },
],
},
],
Expand All @@ -160,11 +173,14 @@ export default defineConfig({
copyright: `Copyright © 2013 - ${new Date().getFullYear()}`
},
markdown: {
theme: "material-palenight",
theme: 'material-palenight',
lineNumbers: true,
config: md => {
require('vuepress-plugin-glossary').extendMarkdown(md);
},
toc: {
level: [2]
}
},
},
});
39 changes: 24 additions & 15 deletions docs/.vitepress/data/contributors.data.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
type Link = {
icon: string;
link: string;
import { defineLoader } from 'vitepress'

export interface Link {
readonly icon: string;
readonly link: string;
};

type Contributor = {
avatar: string;
name: string;
title: string;
links: Link[];
export interface Contributor {
readonly avatar: string;
readonly name: string;
readonly title: string;
readonly links: Link[];
};

type GithubContributor = {
avatar_url: string;
login: string;
url: string;
export interface GithubContributor{
readonly avatar_url: string;
readonly login: string;
readonly html_url: string;
};

export default {
async load() {
export interface Data {
readonly contributors: Contributor[];
}

declare const data: Data;
export { data }

export default defineLoader({
async load(): Promise<Data> {
let page = 1;
let hasNextPage = true;
const allContributors: Contributor[] = [];
Expand Down Expand Up @@ -55,4 +64,4 @@ export default {
contributors: allContributors
};
}
}
})
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
background-color: var(--vp-c-bg-elv);
}

/* Custom Stlye */
/* Custom Style */
dt.defined-term {
color: var(--vp-c-brand) !important;
text-transform: uppercase;
Expand Down
12 changes: 0 additions & 12 deletions docs/.vitepress/theme/index.js

This file was deleted.

Loading

0 comments on commit 5c554be

Please sign in to comment.