Skip to content

Commit

Permalink
Merge pull request #159 from Telegram-Mini-Apps/feature/vitepress
Browse files Browse the repository at this point in the history
Improve documentation
  • Loading branch information
heyqbnk authored Nov 4, 2023
2 parents fca0b81 + 6469933 commit f87eb61
Show file tree
Hide file tree
Showing 198 changed files with 4,093 additions and 3,134 deletions.
15 changes: 15 additions & 0 deletions .changeset/young-cobras-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@tma.js/solid-router-integration": patch
"@tma.js/init-data-node": patch
"@tma.js/launch-params": patch
"@tma.js/navigation": patch
"@tma.js/init-data": patch
"@tma.js/sdk-react": patch
"@tma.js/sdk-solid": patch
"@tma.js/parsing": patch
"@tma.js/bridge": patch
"@tma.js/utils": patch
"@tma.js/sdk": patch
---

Actualize links and comments
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ yarn-error.log*
.docusaurus

# App for local development
apps/.local
apps/.local

apps/docs/.vitepress/cache
apps/docs/.vitepress/dist
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Telegram не ограничивает разработчика в способ
и позволяет ему обрабатывать событие клика на компонент как потребуется в
приложении.

import imgURL from '../../../../../static/img/ui/back-button.png';
import imgURL from '../../../../../../docs/public/components/back-button.png';

<img
src={imgURL}
Expand Down
47 changes: 47 additions & 0 deletions apps/docs-old/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "docs-2",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@docusaurus/types": "^2.4.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.1",
"@tsconfig/docusaurus": "^1.0.5",
"typescript": "^4.7.4"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"engines": {
"node": ">=16.14"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
247 changes: 247 additions & 0 deletions apps/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
import { defineConfig } from 'vitepress';

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Telegram Mini Apps',
description: 'Documentation covering all aspects of Telegram platform - Telegram Mini Apps.',

// Internationalization.
// https://vitepress.dev/guide/i18n
locales: {
root: {
label: 'English',
lang: 'en',
},
// ru: {
// label: 'Русский',
// lang: 'ru',
// description: 'Документация, покрывающая все аспекты платформы Telegram - Telegram Mini Apps.',
// themeConfig: {
// editLink: {
// text: 'Редактировать эту страницу на GitHub',
// pattern: 'https://github.com/telegram-mini-apps/tma.js/edit/master/apps/docs/src/:path',
// },
// },
// },
},

// Show when each page content was last updated.
// https://vitepress.dev/reference/default-theme-last-updated#last-updated
lastUpdated: true,

// We don't want .html to be in the end of each route.
// https://vitepress.dev/guide/routing#generating-clean-url
cleanUrls: true,

// Enable sitemap generation.
// https://vitepress.dev/guide/sitemap-generation#sitemap-generation
sitemap: {
hostname: 'https://docs.telegram-mini-apps.com',
},

// Configure <head/>.
// https://vitepress.dev/reference/site-config#head
head: [
// Add favicon.
// https://vitepress.dev/reference/site-config#example-adding-a-favicon
['link', { rel: 'icon', href: '/favicon.ico' }],
],

themeConfig: {
logo: '/logo.png',

// https://vitepress.dev/reference/default-theme-footer#footer
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2022-present Vladislav Kibenko and Contributors',
},

editLink: {
text: 'Edit this page on GitHub',
pattern: 'https://github.com/telegram-mini-apps/tma.js/edit/master/apps/docs/src/:path',
},

// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Documentation', link: '/about-platform' },
],

// https://vitepress.dev/reference/default-theme-sidebar
sidebar: [
{
text: 'Common information',
items: [
{ text: 'About platform', link: '/about-platform' },
{ text: 'Test environment', link: '/test-environment' },
],
},

{
text: 'Apps communication',
items: [
{ text: 'Flow definition', link: '/apps-communication/flow-definition' },
{ text: 'Methods', link: '/apps-communication/methods' },
{ text: 'Events', link: '/apps-communication/events' },
],
},

{
text: 'Launch parameters',
items: [
{ text: 'Common information', link: '/launch-parameters/common-information' },
{ text: 'Init data', link: '/launch-parameters/init-data' },
],
},

{
text: 'Functionality',
items: [
{ text: 'Closing behavior', link: '/functionality/closing-behavior' },
{ text: 'Haptic feedback', link: '/functionality/haptic-feedback' },
{ text: 'Theming', link: '/functionality/theming' },
{ text: 'Viewport', link: '/functionality/viewport' },
],
},

{
text: 'UI',
items: [
{ text: 'Back Button', link: '/ui/back-button' },
{ text: 'Main Button', link: '/ui/main-button' },
{ text: 'Popup', link: '/ui/popup' },
{ text: 'Settings Button', link: '/ui/settings-button' },
],
},

{
text: 'Packages',
items: [
{
text: 'TypeScript',
collapsed: true,
items: [
{ text: '@tma.js/bridge', link: '/packages/typescript/tma-js-bridge' },
{
text: '@tma.js/init-data',
collapsed: true,
items: [
{ text: 'About', link: '/packages/typescript/tma-js-init-data/about' },
{ text: 'InitData', link: '/packages/typescript/tma-js-init-data/init-data' },
{ text: 'Chat', link: '/packages/typescript/tma-js-init-data/chat' },
{ text: 'User', link: '/packages/typescript/tma-js-init-data/user' },
],
},
{
text: '@tma.js/init-data-node',
link: '/packages/typescript/tma-js-init-data-node',
},
{
text: '@tma.js/sdk',
collapsed: true,
items: [
{ text: 'About', link: '/packages/typescript/tma-js-sdk/about' },
{
text: 'Components',
collapsed: true,
items: [
{
text: 'BackButton',
link: '/packages/typescript/tma-js-sdk/components/back-button',
},
{
text: 'ClosingBehavior',
link: '/packages/typescript/tma-js-sdk/components/closing-behaviour',
},
{
text: 'HapticFeedback',
link: '/packages/typescript/tma-js-sdk/components/haptic-feedback',
},
{
text: 'InitData',
link: '/packages/typescript/tma-js-sdk/components/init-data',
},
{
text: 'MainButton',
link: '/packages/typescript/tma-js-sdk/components/main-button',
},
{
text: 'Popup',
link: '/packages/typescript/tma-js-sdk/components/popup',
},
{
text: 'QRScanner',
link: '/packages/typescript/tma-js-sdk/components/qr-scanner',
},
{
text: 'ThemeParams',
link: '/packages/typescript/tma-js-sdk/components/theme-params',
},
{
text: 'Viewport',
link: '/packages/typescript/tma-js-sdk/components/viewport',
},
// TODO: Rename?
{
text: 'WebApp',
link: '/packages/typescript/tma-js-sdk/components/web-app',
},
],
},
],
},
{ text: '@tma.js/sdk-react', link: '/packages/typescript/tma-js-sdk-react' },
{ text: '@tma.js/sdk-solid', link: '/packages/typescript/tma-js-sdk-solid' },
],
},
{
text: 'GoLang',
collapsed: true,
items: [
{ text: 'init-data-golang', link: '/packages/golang/init-data-golang' },
],
},
],
},

{
text: 'Guides',
items: [
{ text: 'Creating new app', link: '/guides/creating-new-app' },
],
},
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/telegram-mini-apps' },
],

search: {
// TODO: Probably replace with Algolia.
provider: 'local',
// options: {
// locales: {
// ru: {
// translations: {
// button: {
// buttonText: 'Поиск',
// buttonAriaLabel: 'Поиск',
// },
// modal: {
// noResultsText: 'Не удалось ничего найти по запросу',
// backButtonTitle: 'закрыть',
// displayDetails: 'Отобразить подробные данные',
// resetButtonTitle: 'Сбросить',
// footer: {
// selectText: 'выбрать',
// navigateText: 'для навигации',
// closeText: 'закрыть',
// },
// },
// },
// },
// },
// },
},
},
});
Loading

0 comments on commit f87eb61

Please sign in to comment.