-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from summerain0/main
init document
- Loading branch information
Showing
14 changed files
with
2,599 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,61 @@ | ||
name: Deploy document to Pages | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: pages | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build with VitePress | ||
run: | | ||
npm run build | ||
touch .vitepress/dist/.nojekyll | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: .vitepress/dist | ||
|
||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
runs-on: ubuntu-latest | ||
name: Deploy | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains 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,3 @@ | ||
.vitepress/cache | ||
.vitepress/dist | ||
node_modules |
This file contains 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,81 @@ | ||
import config from '../../package.json' | ||
import { defineConfig, type DefaultTheme } from 'vitepress' | ||
|
||
|
||
export const en = defineConfig({ | ||
lang: 'en-US', | ||
description: 'sora-editor is a cool and optimized code editor on Android platform', | ||
|
||
themeConfig: { | ||
nav: nav(), | ||
|
||
sidebar: { | ||
'/reference/': { base: '/reference/', items: sidebarReference() }, | ||
'/guide/': { base: '/guide/', items: guideReference() } | ||
}, | ||
|
||
editLink: { | ||
pattern: 'https://github.com/project-sora/sora-editor-docs/edit/main/docs/:path', | ||
text: 'Edit this page on GitHub' | ||
}, | ||
|
||
footer: { | ||
message: 'Released under the LGPL-2.1 License.', | ||
copyright: `Copyright © 2020-${new Date().getFullYear()} Rosemoe` | ||
} | ||
} | ||
}) | ||
|
||
function nav(): DefaultTheme.NavItem[] { | ||
return [ | ||
{ | ||
text: 'Guide', | ||
link: '/guide/getting-started', | ||
activeMatch: '/guide/' | ||
}, | ||
{ | ||
text: 'Reference', | ||
link: '/reference/no-implemention', | ||
activeMatch: '/reference/' | ||
}, | ||
{ | ||
text: config.version, | ||
items: [ | ||
{ | ||
text: 'Changelog', | ||
link: 'https://github.com/Rosemoe/sora-editor/releases' | ||
}, | ||
{ | ||
text: 'Contributing', | ||
link: 'https://github.com/Rosemoe/sora-editor/graphs/contributors' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
function guideReference(): DefaultTheme.SidebarItem[] { | ||
return [ | ||
{ | ||
items: [ | ||
{ | ||
text: 'Getting started', | ||
link: '/getting-started' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
function sidebarReference(): DefaultTheme.SidebarItem[] { | ||
return [ | ||
{ | ||
items: [ | ||
{ | ||
text: 'No implemention', | ||
link: '/no-implemention' | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains 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,12 @@ | ||
import { defineConfig } from 'vitepress' | ||
import { shared } from './shared' | ||
import { en } from './en' | ||
import { zh } from './zh' | ||
|
||
export default defineConfig({ | ||
...shared, | ||
locales: { | ||
root: { label: 'English', ...en }, | ||
zh: { label: '简体中文', ...zh } | ||
} | ||
}) |
This file contains 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,19 @@ | ||
import { defineConfig } from 'vitepress' | ||
|
||
export const shared = defineConfig({ | ||
title: 'Sora Editor', | ||
|
||
ignoreDeadLinks: true, | ||
lastUpdated: true, | ||
cleanUrls: true, | ||
|
||
themeConfig: { | ||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/Rosemoe/sora-editor' } | ||
], | ||
|
||
search: { | ||
provider: 'local' | ||
} | ||
} | ||
}) |
This file contains 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,104 @@ | ||
import config from '../../package.json' | ||
import { defineConfig, type DefaultTheme } from 'vitepress' | ||
|
||
export const zh = defineConfig({ | ||
lang: 'zh-Hans', | ||
description: 'sora-editor是一款高效的安卓代码编辑器', | ||
|
||
themeConfig: { | ||
nav: nav(), | ||
|
||
sidebar: { | ||
'/zh/reference/': { base: '/zh/reference/', items: sidebarReference() }, | ||
'/zh/guide/': { base: '/zh/guide/', items: guideReference() } | ||
}, | ||
|
||
editLink: { | ||
pattern: 'https://github.com/project-sora/sora-editor-docs/edit/main/docs/:path', | ||
text: '在 GitHub 上编辑此页面' | ||
}, | ||
|
||
footer: { | ||
message: '基于 LGPL-2.1 许可发布', | ||
copyright: `版权所有 © 2020-${new Date().getFullYear()} Rosemoe` | ||
}, | ||
|
||
docFooter: { | ||
prev: '上一页', | ||
next: '下一页' | ||
}, | ||
|
||
outline: { | ||
label: '页面导航' | ||
}, | ||
|
||
lastUpdated: { | ||
text: '最后更新于', | ||
formatOptions: { | ||
dateStyle: 'short', | ||
timeStyle: 'medium' | ||
} | ||
}, | ||
|
||
langMenuLabel: '多语言', | ||
returnToTopLabel: '回到顶部', | ||
sidebarMenuLabel: '菜单', | ||
darkModeSwitchLabel: '主题', | ||
lightModeSwitchTitle: '切换到浅色模式', | ||
darkModeSwitchTitle: '切换到深色模式' | ||
} | ||
}) | ||
|
||
function nav(): DefaultTheme.NavItem[] { | ||
return [ | ||
{ | ||
text: '指南', | ||
link: '/zh/guide/getting-started', | ||
activeMatch: '/zh/guide/' | ||
}, | ||
{ | ||
text: '参考', | ||
link: '/zh/reference/no-implemention', | ||
activeMatch: '/zh/reference/' | ||
}, | ||
{ | ||
text: config.version, | ||
items: [ | ||
{ | ||
text: '更新日志', | ||
link: 'https://github.com/Rosemoe/sora-editor/releases' | ||
}, | ||
{ | ||
text: '参与贡献', | ||
link: 'https://github.com/Rosemoe/sora-editor/graphs/contributors' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
function guideReference(): DefaultTheme.SidebarItem[] { | ||
return [ | ||
{ | ||
items: [ | ||
{ | ||
text: '快速开始', | ||
link: '/getting-started' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
function sidebarReference(): DefaultTheme.SidebarItem[] { | ||
return [ | ||
{ | ||
items: [ | ||
{ | ||
text: '未实现', | ||
link: '/no-implemention' | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains 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,33 @@ | ||
# Get started | ||
|
||
Add to your app's dependencies: | ||
|
||
[![Maven Central](https://img.shields.io/maven-central/v/io.github.Rosemoe.sora-editor/editor.svg?label=Maven%20Central)]((https://search.maven.org/search?q=io.github.Rosemoe.sora-editor%20editor)) | ||
|
||
```groovy | ||
dependencies { | ||
implementation(platform("io.github.Rosemoe.sora-editor:bom:<versionName>")) | ||
implementation("io.github.Rosemoe.sora-editor:<moduleName>") | ||
} | ||
``` | ||
|
||
## 🛠️Available modules: | ||
|
||
| Module | Summary | | ||
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| editor | Widget library containing all basic things of the framework | | ||
| editor-lsp | A convenient library for creating languages by using Language Server Protocol (aka LSP) | | ||
| language-java | A simple implementation for Java highlighting and identifier auto-completion | | ||
| language-textmate | An advanced highlighter for the editor. You can find textmate language bundles and themes and load them by using this module. The internal implementation of textmate is from[tm4e](https://github.com/eclipse/tm4e)。 | | ||
| language-treesitter | Offer [tree-sitter](https://tree-sitter.github.io/tree-sitter/) support for editor. This can be used to parse the code to an AST fast and incrementally, which is helpful for accurate highlighting and providing completions. Note that this module only provides incremental paring and highlighting. Thanks to Java bindings [android-tree-sitter](https://github.com/AndroidIDEOfficial/android-tree-sitter/) | | ||
|
||
Check the newest version from the badge above or [Releases](https://github.com/Rosemoe/CodeEditor/releases). | ||
|
||
## Init your project | ||
|
||
```xml | ||
<io.github.rosemoe.sora.widget.CodeEditor | ||
android:id="@+id/editor" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" /> | ||
``` |
This file contains 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,17 @@ | ||
--- | ||
layout: home | ||
|
||
title: Sora Editor | ||
titleTemplate: a cool and optimized code editor on Android platform | ||
|
||
hero: | ||
name: Sora Editor | ||
tagline: A cool and optimized code editor on Android platform | ||
actions: | ||
- theme: brand | ||
text: Get Started | ||
link: /guide/getting-started | ||
- theme: alt | ||
text: View on GitHub | ||
link: https://github.com/Rosemoe/sora-editor | ||
--- |
Oops, something went wrong.