Commit fe5c0118 authored by 李世星's avatar 李世星

初始化

parent 2446c9ee
# Dependencies
/node_modules
# Production
/build
# Generated files
.docusaurus
.cache-loader
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# 项目介绍 # 项目介绍
一个无聊的API文档项目 一个无聊的API文档项目原型
## 项目重要事项 ## 项目重要事项
......
module.exports = {
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
};
{
"label":"部署环境",
"position": 2
}
\ No newline at end of file
---
id: development
title: 测试环境部署
tags: [xxx]
---
| 服务ID | 类型 | Host | 域名解析 | 访问限制 |
| -------------------- | ------ | ------------------ | -------- | -------- |
| xxxx http server | 服务类型 | xxx.xxx.xxx.xxxx:xxx | 无 | |
\ No newline at end of file
---
id: production
title: 生产环境部署
tags: [xxx]
---
| 服务ID | 类型 | Host | 域名解析 | 访问限制 |
| -------------------- | ------ | ------------------ | -------- | -------- |
| xxxx http server | 服务类型 | xxx.xxx.xxx.xxxx:xxx | 无 | |
---
sidebar_position: 1
---
# 项目介绍 (xxxxxx)
一个API文档
## 项目配置文件
```php
error_reporting(E_ALL);
ini_set('display_errors', '1');
// 启用sql日志打印
$settings['query_log']['level'] = QUERY_LEVEL_ALL;
$settings['query_log']['console_handler'] = true;
$settings['error']['handler_query_error_details'] = false;
$settings['jwt']['api_key'] = "GatherAdminDeveloperApiKey";
// 是否开启路由缓存
$settings['router']['cache'] = false;
```
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "爱集微API文档",
tagline: "Dinosaurs are cool",
url: "https://your-docusaurus-test-site.com",
baseUrl: "/doc/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
favicon: "img/logo.ico",
organizationName: "facebook", // Usually your GitHub org/user name.
projectName: "docusaurus", // Usually your repo name.
presets: [
[
"docusaurus-preset-openapi",
/** @type {import('docusaurus-preset-openapi').Options} */
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Please change this to your repo.
// editUrl:
// "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
},
theme: {
customCss: require.resolve("./src/css/custom.css"),
},
}),
],
],
themeConfig:
/** @type {import('docusaurus-preset-openapi').ThemeConfig} */
({
navbar: {
title: "",
logo: {
alt: "爱集微API文档 Logo",
src: "img/logo.png",
},
items: [
{
type: "doc",
docId: "intro",
position: "left",
label: "项目描述",
},
{ to: "/api", label: "API", position: "left" },
{
href: "https://github.com/facebook/docusaurus",
label: "GitHub",
position: "right",
},
],
},
footer: {
style: "dark",
links: [
// {
// title: "Docs",
// items: [
// {
// label: "Tutorial",
// to: "/docs/intro",
// },
// ],
// },
// {
// title: "Community",
// items: [
// {
// label: "Stack Overflow",
// href: "https://stackoverflow.com/questions/tagged/docusaurus",
// },
// {
// label: "Discord",
// href: "https://discordapp.com/invite/docusaurus",
// },
// {
// label: "Twitter",
// href: "https://twitter.com/docusaurus",
// },
// ],
// },
// {
// title: "More",
// items: [
// {
// label: "Blog",
// to: "/blog",
// },
// {
// label: "GitHub",
// href: "https://github.com/facebook/docusaurus",
// },
// ],
// },
],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};
module.exports = config;
{
"openapi": "3.0.0",
"info": {
"title": "My First API",
"version": "0.1"
},
"servers": [
{
"url": ""
}
],
"paths": {
"/api/hello": {
"get": {
"summary": "HOME_HELLO_ACTION",
"operationId": "dc6e37a24b7e6eddf602202abdfefbff",
"parameters": [
{
"name": "hel_id",
"in": "query",
"description": "helId",
"required": true
}
],
"responses": {
"200": {
"description": "The data"
}
}
}
}
}
}
\ No newline at end of file
{
"name": "my-website",
"version": "0.0.0",
"private": true,
"dependencies": {
"@docusaurus/core": "^2.0.0",
"@mdx-js/react": "^1.6.21",
"clsx": "^1.1.1",
"docusaurus-preset-openapi": "0.6.1",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"url": "^0.11.0"
},
"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"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
// @ts-check
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{ type: "autogenerated", dirName: "." }],
// But you can create a sidebar manually
/*
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
items: ['hello'],
},
],
*/
};
module.exports = sidebars;
import React from "react";
import clsx from "clsx";
import styles from "./HomepageFeatures.module.css";
const FeatureList = [
{
title: "Easy to Use",
Svg: require("../../static/img/undraw_docusaurus_mountain.svg").default,
description: (
<>
Docusaurus was designed from the ground up to be easily installed and
used to get your website up and running quickly.
</>
),
},
{
title: "Focus on What Matters",
Svg: require("../../static/img/undraw_docusaurus_tree.svg").default,
description: (
<>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
ahead and move your docs into the <code>docs</code> directory.
</>
),
},
{
title: "Powered by React",
Svg: require("../../static/img/undraw_docusaurus_react.svg").default,
description: (
<>
Extend or customize your website layout by reusing React. Docusaurus can
be extended while reusing the same header and footer.
</>
),
},
];
function Feature({ Svg, title, description }) {
return (
<div className={clsx("col col--4")}>
<div className="text--center">
<Svg className={styles.featureSvg} alt={title} />
</div>
<div className="text--center padding-horiz--md">
<h3>{title}</h3>
<p>{description}</p>
</div>
</div>
);
}
export default function HomepageFeatures() {
return (
<section className={styles.features}>
<div className="container">
<div className="row">
{FeatureList.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</div>
</div>
</section>
);
}
.features {
display: flex;
align-items: center;
padding: 2rem 0;
width: 100%;
}
.featureSvg {
height: 200px;
width: 200px;
}
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/
/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: rgb(33, 175, 144);
--ifm-color-primary-darker: rgb(31, 165, 136);
--ifm-color-primary-darkest: rgb(26, 136, 112);
--ifm-color-primary-light: rgb(70, 203, 174);
--ifm-color-primary-lighter: rgb(102, 212, 189);
--ifm-color-primary-lightest: rgb(146, 224, 208);
--ifm-code-font-size: 95%;
}
.docusaurus-highlight-code-line {
background-color: rgba(0, 0, 0, 0.1);
display: block;
margin: 0 calc(-1 * var(--ifm-pre-padding));
padding: 0 var(--ifm-pre-padding);
}
html[data-theme="dark"] .docusaurus-highlight-code-line {
background-color: rgba(0, 0, 0, 0.3);
}
import React from "react";
import clsx from "clsx";
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import styles from "./index.module.css";
function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
return (
<header className={clsx("hero hero--primary", styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/docs/intro"
>
查看文档
</Link>
</div>
</div>
</header>
);
}
export default function Home() {
const { siteConfig } = useDocusaurusContext();
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />"
>
<HomepageHeader />
<main>
{/* <HomepageFeatures /> */}
</main>
</Layout>
);
}
/**
* CSS files with the .module.css suffix will be treated as CSS modules
* and scoped locally.
*/
.heroBanner {
padding: 4rem 0;
text-align: center;
position: relative;
overflow: hidden;
}
@media screen and (max-width: 966px) {
.heroBanner {
padding: 2rem;
}
}
.buttons {
display: flex;
align-items: center;
justify-content: center;
}
---
title: Markdown page example
---
# Markdown page example
You don't need React to write simple standalone pages.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment