-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31288bf
commit c27c1e7
Showing
48 changed files
with
588 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,10 @@ | ||
.. _sphinx-extension: | ||
|
||
================================== | ||
Sphinx扩展 | ||
================================== | ||
|
||
GitHub上的 ``sphinx-extension`` | ||
================================== | ||
|
||
在 `GitHub上通过topics搜索sphinx-extension <https://github.com/topics/sphinx-extension>`_ 可以看到200+个开源项目,通常能够找到你所需的扩展 |
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,45 @@ | ||
.. _sphinx_embed_audio: | ||
|
||
=========================== | ||
Sphinx文档嵌入音频 | ||
=========================== | ||
|
||
我在听歌的时候,突然想到,既然 :ref:`sphinx_embed_youtube` 和 :ref:`sphinx_embed_video` 能够嵌入视频,那么怎样能够嵌入音频呢? | ||
|
||
答案是使用 ``raw`` 直接嵌入 ``HTML`` : | ||
|
||
.. literalinclude:: sphinx_embed_audio/sphinx_doc_raw_html | ||
:language: html | ||
:caption: 通过 ``raw`` 指令可以在Sphinx文档中嵌入任意html代码,也包括音频文件 | ||
|
||
这里嵌入一首我非常喜欢的 **陈一发儿** 演唱 「Landing Guy」 | ||
|
||
.. raw:: html | ||
|
||
<audio controls="controls"> | ||
<source src="../../../_static/devops/docs/sphinx_doc/landing_guy_chenyifaer.m4a" type="audio/mpeg"> | ||
Your browser does not support the <code>audio</code> element. | ||
</audio> | ||
|
||
( 发姐自信点评 ``相信各位格莱美都听出来了,这首歌里我唱了三个音轨,主音,低音,气声。(可以说是very专业了)`` ) | ||
|
||
.. note:: | ||
|
||
音频文件采用 :ref:`yt-dlp` 从YouTube视频 `Landing Guy—刘昊霖 (Cover by 陈一发儿 ) <https://www.youtube.com/watch?v=tSHb6acXMj8>`_ 下载 | ||
|
||
.. youtube:: tSHb6acXMj8 | ||
|
||
由于 **社会主义铁拳** 封杀了 ``陈一发儿`` ,直到今天墙内依然无法在直播和娱乐平台看到这个名字。 | ||
|
||
但是总有粉丝会上传一些漏网视频(居然只能冠以 ``辣个女人`` ,尼玛,又不是伏地魔,连名字都不能提么?) | ||
|
||
如果你翻不了墙,或许可以在百度百科上欣赏到搬运的这首 | ||
|
||
`Landing Guy—刘昊霖 (Cover by辣个女人 ) <https://baike.baidu.com/video?secondId=73547327>`_ | ||
|
||
**应该是全网演绎最好的版本了** | ||
|
||
参考 | ||
====== | ||
|
||
- `Is it possible to embed an audio file in the html output of the Sphinx documentation tool? <https://stackoverflow.com/questions/54822826/is-it-possible-to-embed-an-audio-file-in-the-html-output-of-the-sphinx-documenta>`_ |
6 changes: 6 additions & 0 deletions
6
source/devops/docs/sphinx_doc/sphinx_embed_audio/sphinx_doc_raw_html
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,6 @@ | ||
.. raw:: html | ||
|
||
<audio controls="controls"> | ||
<source src="../../../_static/devops/docs/sphinx_doc/landing_guy_chenyifaer.m4a" type="audio/mpeg"> | ||
Your browser does not support the <code>audio</code> element. | ||
</audio> |
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
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
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ Next.js | |
:maxdepth: 1 | ||
|
||
intro_nextjs.rst | ||
install_nextjs.rst | ||
|
||
.. only:: subproject and html | ||
|
||
|
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,79 @@ | ||
.. _install_nextjs: | ||
|
||
=================== | ||
安装Next.js | ||
=================== | ||
|
||
系统要求 | ||
================ | ||
|
||
运行Next.js的要求是: | ||
|
||
- :ref:`nodejs` 16.14 或更高版本 | ||
- macOS, Windows (宝库 WSL)和Linux | ||
|
||
安装步骤 | ||
========= | ||
|
||
安装Node.js可以采用 :ref:`nodejs_dev_env` 方法 | ||
|
||
- 安装 ``nvm`` : | ||
|
||
.. literalinclude:: ../../../nodejs/startup/nodejs_dev_env/install_nvm | ||
:caption: 安装 ``nvm`` 管理Node.js版本 | ||
|
||
- 安装 :ref:`nodejs` : | ||
|
||
.. literalinclude:: ../../../nodejs/startup/nodejs_dev_env/nvm_install_nodejs | ||
:caption: 使用 ``nvm`` 安装Node.js | ||
|
||
自动安装 | ||
----------- | ||
|
||
- Next.js 提供了一种自动安装方式: 直接运行 ``create-next-app`` 就会既安装软件框架包,同时又交互式创建项目(目录): | ||
|
||
.. literalinclude:: install_nextjs/auto_install_nextjs | ||
:caption: 通过 ``create-next-app`` 就会既安装软件框架包,同时又交互式创建项目(目录) | ||
|
||
此时会交互提示(这里我用了默认配置,仅输入 ``site`` 作为自己的项目名): | ||
|
||
.. literalinclude:: install_nextjs/auto_install_nextjs_output | ||
:caption: 通过 ``create-next-app`` 创建了项目 ``site`` ,默认参数 | ||
:emphasize-lines: 5-10 | ||
|
||
手工安装 | ||
----------- | ||
|
||
- 手工安装是先安装 next.js 和 react 等: | ||
|
||
.. literalinclude:: install_nextjs/manual_install_nextjs | ||
:caption: 手工安装 Next.js | ||
|
||
然后手工创建目录结构(见官方原文,比较繁琐,我这里忽略记录) | ||
|
||
目录 | ||
------- | ||
|
||
通过 ``自动安装`` 之后,会形成一个项目目录,并且提供几种运行模式: | ||
|
||
- ``dev`` : 以开发模式启动 Next.js | ||
- ``build`` : 构建生产环境的应用 | ||
- ``start`` : 启动一个 Next.js 生产服务器 | ||
- ``lint`` : 设置 Next.js 内建的 ESLint 配置 | ||
|
||
运行 | ||
======= | ||
|
||
- 运行 ``Next.js`` 程序的 ``dev`` 模式: | ||
|
||
.. literalinclude:: install_nextjs/run_dev | ||
:caption: 运行 Next.js dev模式 | ||
|
||
此时可以使用浏览器访问 http://localhost:3000/ 可以看到一个简单页面(其中提供了一些导航到官网的文档、模版等) | ||
|
||
.. figure:: ../../../_static/javascript/react/nextjs/nextjs_start_dev.png | ||
|
||
参考 | ||
======= | ||
|
||
- `Jamstack - Next.js <https://jamstack.org/generators/next/>`_ Jamstack提供了很多 `Jamstack web网站案例 <https://github.com/vercel/next.js/tree/canary/examples>`_ |
1 change: 1 addition & 0 deletions
1
source/javascript/react/nextjs/install_nextjs/auto_install_nextjs
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 @@ | ||
npx create-next-app@latest |
41 changes: 41 additions & 0 deletions
41
source/javascript/react/nextjs/install_nextjs/auto_install_nextjs_output
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,41 @@ | ||
Need to install the following packages: | ||
create-next-app@13.4.19 | ||
Ok to proceed? (y) | ||
✔ What is your project named? … site | ||
✔ Would you like to use TypeScript? … No / Yes <= Yes | ||
✔ Would you like to use ESLint? … No / Yes <= Yes | ||
✔ Would you like to use Tailwind CSS? … No / Yes <= Yes | ||
✔ Would you like to use `src/` directory? … No / Yes <= No | ||
✔ Would you like to use App Router? (recommended) … No / Yes <= Yes | ||
✔ Would you like to customize the default import alias? … No / Yes <= No | ||
Creating a new Next.js app in /Users/huataihuang/docs/github.com/cloud-atlas-io/site. | ||
|
||
Using npm. | ||
|
||
Initializing project with template: app-tw | ||
|
||
|
||
Installing dependencies: | ||
- react | ||
- react-dom | ||
- next | ||
- typescript | ||
- @types/react | ||
- @types/node | ||
- @types/react-dom | ||
- tailwindcss | ||
- postcss | ||
- autoprefixer | ||
- eslint | ||
- eslint-config-next | ||
|
||
|
||
added 329 packages, and audited 330 packages in 2m | ||
|
||
117 packages are looking for funding | ||
run `npm fund` for details | ||
|
||
found 0 vulnerabilities | ||
Initialized a git repository. | ||
|
||
Success! Created site at /Users/huataihuang/docs/github.com/cloud-atlas-io/site |
1 change: 1 addition & 0 deletions
1
source/javascript/react/nextjs/install_nextjs/manual_install_nextjs
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 @@ | ||
npm install next@latest react@latest react-dom@latest |
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 @@ | ||
npm run dev |
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,13 @@ | ||
.. _k8s_cli: | ||
|
||
========================= | ||
Kubernetes CLI | ||
========================= | ||
|
||
`Kubernetes SIG CLI社区 <https://github.com/kubernetes/community/tree/master/sig-cli>`_ 围绕 :ref:`kubectl` 以及相关工具进行开发和讨论 | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
kubectl-plugins.rst | ||
krew/index |
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,10 @@ | ||
.. _krew: | ||
|
||
========================= | ||
krew (kubectl插件管理器) | ||
========================= | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
intro_krew.rst |
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 @@ | ||
.. _intro_krew: | ||
|
||
================= | ||
Krew简介 | ||
================= | ||
|
||
`krew (GitHub) <https://github.com/kubernetes-sigs/krew/tree/master>`_ 是 :ref:`kubectl` 的插件包管理器,用于管理 :ref:`kubectl-plugins` | ||
|
||
参考 | ||
======== | ||
|
||
- `krew (GitHub) <https://github.com/kubernetes-sigs/krew/tree/master>`_ |
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 @@ | ||
.. _kubectl-plugins: | ||
|
||
===================== | ||
Kubectl插件 | ||
===================== | ||
|
||
:ref:`kubectl` 插件使用kubectl命令扩展,来构建复杂行为方法,创建新的和自定义特性来扩展 ``kubectl`` 。插件本质上就是一个独立可执行文件,名称以 ``kubetl-`` 开头,只要这个执行文件在 ``PATH`` 的任何位置,就可以通过 ``kubectl`` 运行。 | ||
|
||
:ref:`krew` 提供了发现和安装开源 ``kubectl`` 插件的能力,这是 `Kubernetes SIG CLI社区 <https://github.com/kubernetes/community/tree/master/sig-cli>`_ 维护的插件管理器 | ||
|
||
安装kubectl插件 | ||
================= | ||
|
||
参考 | ||
======= | ||
|
||
- `用插件扩展 kubectl <https://kubernetes.io/zh-cn/docs/tasks/extend-kubectl/kubectl-plugins/>`_ |
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
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
Oops, something went wrong.