拥有 Ai_M6X_SDK 本地文档

[复制链接]
查看1336 | 回复12 | 2023-12-3 15:12:04 | 显示全部楼层 |阅读模式

想要拥有本地doc文档,就来看看吧。

在C:\aithinker_Ai-M6X_SDK\docs下有SDK相关的文档。但是由于是rst格式没办法查看。

可以通过python编译成html以后进行查看。

接下来就开始编译docs目录到html。

下载安装 Python

打开[https://www.python.org/]()进入python官网

然后鼠标指向Downloads选项卡

弹出菜单

点击下载Python 3.12.0

下载完成后,找到下载完成的 安装包。

双击启动,如下安装页面

勾选Add python.exe to PATH, 点击Install Now 按照提示安装即可。

安装完成验证 Win+R ,输入cmd,然后输入 python即可显示如下图。

Python rst文件打开

RST与Python类似Javadoc与Java.

如果下载了别人的Python源码,里面有rst文件夹,我们可以转为html后用浏览器打开

1.安装python的sphinx模块:


pip install sphinx

2.执行make


C:\aithinker_Ai-M6X_SDK\docs>make

Sphinx v7.2.6

Please use `make target' where target is one of

  html        to make standalone HTML files

  dirhtml     to make HTML files named index.html in directories

  singlehtml  to make a single large HTML file

  pickle      to make pickle files

  json        to make JSON files

  htmlhelp    to make HTML files and an HTML help project

  qthelp      to make HTML files and a qthelp project

  devhelp     to make HTML files and a Devhelp project

  epub        to make an epub

  latex       to make LaTeX files, you can set PAPER=a4 or PAPER=letter

  text        to make text files

  man         to make manual pages

  texinfo     to make Texinfo files

  gettext     to make PO message catalogs

  changes     to make an overview of all changed/added/deprecated items

  xml         to make Docutils-native XML files

  pseudoxml   to make pseudoxml-XML files for display purposes

  linkcheck   to check all external links for integrity

  doctest     to run all doctests embedded in the documentation (if enabled)

  coverage    to run coverage check of the documentation (if enabled)

  clean       to remove everything in the build directory

3.然后执行make html


C:\aithinker_Ai-M6X_SDK\docs>make html

Running Sphinx v7.2.6


Extension error:

Could not import extension recommonmark (exception: No module named 'recommonmark')

发现缺少module 执行 pip install recommonmark


C:\aithinker_Ai-M6X_SDK\docs>pip install recommonmark

Collecting recommonmark

  Downloading recommonmark-0.7.1-py2.py3-none-any.whl (10 kB)

Collecting commonmark>=0.8.1 (from recommonmark)

  Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)

     ---------------------------------------- 51.1/51.1 kB 113.4 kB/s eta 0:00:00

Requirement already satisfied: docutils>=0.11 in c:\python\python312\lib\site-packages (from recommonmark) (0.20.1)

Requirement already satisfied: sphinx>=1.3.1 in c:\python\python312\lib\site-packages (from recommonmark) (7.2.6)

Requirement already satisfied: sphinxcontrib-applehelp in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (1.0.7)

Requirement already satisfied: sphinxcontrib-devhelp in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (1.0.5)

Requirement already satisfied: sphinxcontrib-jsmath in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (1.0.1)

Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (2.0.4)

Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.9 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (1.1.9)

Requirement already satisfied: sphinxcontrib-qthelp in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (1.0.6)

Requirement already satisfied: Jinja2>=3.0 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (3.1.2)

Requirement already satisfied: Pygments>=2.14 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (2.17.2)

Requirement already satisfied: snowballstemmer>=2.0 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (2.2.0)

Requirement already satisfied: babel>=2.9 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (2.13.1)

Requirement already satisfied: alabaster<0.8,>=0.7 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (0.7.13)

Requirement already satisfied: imagesize>=1.3 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (1.4.1)

Requirement already satisfied: requests>=2.25.0 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (2.31.0)

Requirement already satisfied: packaging>=21.0 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (23.2)

Requirement already satisfied: colorama>=0.4.5 in c:\python\python312\lib\site-packages (from sphinx>=1.3.1->recommonmark) (0.4.6)

Requirement already satisfied: setuptools in c:\python\python312\lib\site-packages (from babel>=2.9->sphinx>=1.3.1->recommonmark) (69.0.2)

Requirement already satisfied: MarkupSafe>=2.0 in c:\python\python312\lib\site-packages (from Jinja2>=3.0->sphinx>=1.3.1->recommonmark) (2.1.3)

Requirement already satisfied: charset-normalizer<4,>=2 in c:\python\python312\lib\site-packages (from requests>=2.25.0->sphinx>=1.3.1->recommonmark) (3.3.2)

Requirement already satisfied: idna<4,>=2.5 in c:\python\python312\lib\site-packages (from requests>=2.25.0->sphinx>=1.3.1->recommonmark) (3.6)

Requirement already satisfied: urllib3<3,>=1.21.1 in c:\python\python312\lib\site-packages (from requests>=2.25.0->sphinx>=1.3.1->recommonmark) (2.1.0)

Requirement already satisfied: certifi>=2017.4.17 in c:\python\python312\lib\site-packages (from requests>=2.25.0->sphinx>=1.3.1->recommonmark) (2023.11.17)

Installing collected packages: commonmark, recommonmark

Successfully installed commonmark-0.9.1 recommonmark-0.7.1


[notice] A new release of pip is available: 23.2.1 -> 23.3.1

[notice] To update, run: python.exe -m pip install --upgrade pip

再次执行 make html



C:\aithinker_Ai-M6X_SDK\docs>make html

Running Sphinx v7.2.6


Extension error:

Could not import extension sphinx_markdown_tables (exception: No module named 'sphinx_markdown_tables')

缺少module sphinx_markdown_tables 执行 pip install sphinx_markdown_tables


C:\aithinker_Ai-M6X_SDK\docs>pip install sphinx_markdown_tables

Collecting sphinx_markdown_tables

  Downloading sphinx_markdown_tables-0.0.17-py3-none-any.whl (28 kB)

Collecting markdown>=3.4 (from sphinx_markdown_tables)

  Obtaining dependency information for markdown>=3.4 from https://files.pythonhosted.org/packages/70/58/2c5a654173937d9f540a4971c569b44dcd55e5424a484d954cdaeebcf79c/Markdown-3.5.1-py3-none-any.whl.metadata

  Downloading Markdown-3.5.1-py3-none-any.whl.metadata (7.1 kB)

Downloading Markdown-3.5.1-py3-none-any.whl (102 kB)

   ---------------------------------------- 102.2/102.2 kB 391.1 kB/s eta 0:00:00

Installing collected packages: markdown, sphinx_markdown_tables

Successfully installed markdown-3.5.1 sphinx_markdown_tables-0.0.17


[notice] A new release of pip is available: 23.2.1 -> 23.3.1

[notice] To update, run: python.exe -m pip install --upgrade pip

再次执行 make html


C:\aithinker_Ai-M6X_SDK\docs>make html

Running Sphinx v7.2.6

making output directory... done


Theme error:

no theme named 'sphinx_rtd_theme' found (missing theme.conf?)

缺少 sphinx_rtd_theme 再次执行 pip install sphinx_rtd_theme


C:\aithinker_Ai-M6X_SDK\docs>pip install sphinx_rtd_theme

Collecting sphinx_rtd_theme

  Obtaining dependency information for sphinx_rtd_theme from https://files.pythonhosted.org/packages/ea/46/00fda84467815c29951a9c91e3ae7503c409ddad04373e7cfc78daad4300/sphinx_rtd_theme-2.0.0-py2.py3-none-any.whl.metadata

  Downloading sphinx_rtd_theme-2.0.0-py2.py3-none-any.whl.metadata (4.4 kB)

Requirement already satisfied: sphinx<8,>=5 in c:\python\python312\lib\site-packages (from sphinx_rtd_theme) (7.2.6)

Requirement already satisfied: docutils<0.21 in c:\python\python312\lib\site-packages (from sphinx_rtd_theme) (0.20.1)

Collecting sphinxcontrib-jquery<5,>=4 (from sphinx_rtd_theme)

  Downloading sphinxcontrib_jquery-4.1-py2.py3-none-any.whl (121 kB)

     ---------------------------------------- 121.1/121.1 kB 33.2 kB/s eta 0:00:00

Requirement already satisfied: sphinxcontrib-applehelp in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (1.0.7)

Requirement already satisfied: sphinxcontrib-devhelp in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (1.0.5)

Requirement already satisfied: sphinxcontrib-jsmath in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (1.0.1)

Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (2.0.4)

Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.9 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (1.1.9)

Requirement already satisfied: sphinxcontrib-qthelp in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (1.0.6)

Requirement already satisfied: Jinja2>=3.0 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (3.1.2)

Requirement already satisfied: Pygments>=2.14 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (2.17.2)

Requirement already satisfied: snowballstemmer>=2.0 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (2.2.0)

Requirement already satisfied: babel>=2.9 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (2.13.1)

Requirement already satisfied: alabaster<0.8,>=0.7 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (0.7.13)

Requirement already satisfied: imagesize>=1.3 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (1.4.1)

Requirement already satisfied: requests>=2.25.0 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (2.31.0)

Requirement already satisfied: packaging>=21.0 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (23.2)

Requirement already satisfied: colorama>=0.4.5 in c:\python\python312\lib\site-packages (from sphinx<8,>=5->sphinx_rtd_theme) (0.4.6)

Requirement already satisfied: setuptools in c:\python\python312\lib\site-packages (from babel>=2.9->sphinx<8,>=5->sphinx_rtd_theme) (69.0.2)

Requirement already satisfied: MarkupSafe>=2.0 in c:\python\python312\lib\site-packages (from Jinja2>=3.0->sphinx<8,>=5->sphinx_rtd_theme) (2.1.3)

Requirement already satisfied: charset-normalizer<4,>=2 in c:\python\python312\lib\site-packages (from requests>=2.25.0->sphinx<8,>=5->sphinx_rtd_theme) (3.3.2)

Requirement already satisfied: idna<4,>=2.5 in c:\python\python312\lib\site-packages (from requests>=2.25.0->sphinx<8,>=5->sphinx_rtd_theme) (3.6)

Requirement already satisfied: urllib3<3,>=1.21.1 in c:\python\python312\lib\site-packages (from requests>=2.25.0->sphinx<8,>=5->sphinx_rtd_theme) (2.1.0)

Requirement already satisfied: certifi>=2017.4.17 in c:\python\python312\lib\site-packages (from requests>=2.25.0->sphinx<8,>=5->sphinx_rtd_theme) (2023.11.17)

Downloading sphinx_rtd_theme-2.0.0-py2.py3-none-any.whl (2.8 MB)

   ---------------------------------------- 2.8/2.8 MB 43.8 kB/s eta 0:00:00

Installing collected packages: sphinxcontrib-jquery, sphinx_rtd_theme

Successfully installed sphinx_rtd_theme-2.0.0 sphinxcontrib-jquery-4.1


[notice] A new release of pip is available: 23.2.1 -> 23.3.1

[notice] To update, run: python.exe -m pip install --upgrade pip

再次执行 make html 终于完成编译


C:\aithinker_Ai-M6X_SDK\docs>make html

Running Sphinx v7.2.6

[autosummary] generating autosummary for: advance_samples/index.rst, api_reference/components/bflog.rst, api_reference/components/ble.rst, api_reference/components/index.rst, api_reference/components/wifi.rst, api_reference/peripherals/adc.rst, api_reference/peripherals/cks.rst, api_reference/peripherals/clock.rst, api_reference/peripherals/dac.rst, api_reference/peripherals/dma.rst, ..., samples/peripherals/i2c/index.rst, samples/peripherals/index.rst, samples/peripherals/ir/index.rst, samples/peripherals/ir/ir_nec.rst, samples/peripherals/ir/ir_rc5.rst, samples/peripherals/ir/ir_swm.rst, samples/peripherals/ir/ir_tx_dma.rst, samples/peripherals/uart/index.rst, samples/peripherals/uart/uart_dma.rst, samples/peripherals/uart/uart_poll.rst

building [mo]: targets for 0 po files that are out of date

writing output...

building [html]: targets for 69 source files that are out of date

updating environment: [new config] 69 added, 0 changed, 0 removed

reading sources... [100%] samples/peripherals/uart/uart_poll

C:\aithinker_Ai-M6X_SDK\docs\source\api_reference/components/ble.rst:11: WARNING: Bullet list ends without a blank line; unexpected unindent.

C:\aithinker_Ai-M6X_SDK\docs\source\api_reference/components/ble.rst:16: WARNING: Bullet list ends without a blank line; unexpected unindent.

C:\aithinker_Ai-M6X_SDK\docs\source\api_reference/components/ble.rst:22: WARNING: Bullet list ends without a blank line; unexpected unindent.

C:\aithinker_Ai-M6X_SDK\docs\source\api_reference/components/ble.rst:23: WARNING: Bullet list ends without a blank line; unexpected unindent.

C:\aithinker_Ai-M6X_SDK\docs\source\api_reference/components/ble.rst:523: WARNING: Explicit markup ends without a blank line; unexpected unindent.

C:\aithinker_Ai-M6X_SDK\docs\source\api_reference/components/ble.rst:716: WARNING: Explicit markup ends without a blank line; unexpected unindent.

C:\aithinker_Ai-M6X_SDK\docs\source\samples/peripherals/gpio/index.rst:13: ERROR: "table" widths do not match the number of columns in table (2).


.. table:: GPIO 口

    :widths: 25, 25, 25, 25

    :width: 80%

    :align: center


    +----------------------+--------------------------------------------------------------------------------+

    |   开发板             | GPIO                                                                           |

    +======================+================================================================================+

    | BL61x_MB_V1          | GPIO 0-34(其中 GPIO 2 为 BOOT 引脚,GPIO16/17默认为晶振引脚)                   |

    +----------------------+--------------------------------------------------------------------------------+

C:\aithinker_Ai-M6X_SDK\docs\source\samples/peripherals/i2c/i2c_eeprom_interrupt.rst:2: WARNING: Title underline too short.


I2C - eeprom_interrupt

====================

looking for now-outdated files... none found

pickling environment... done

checking consistency... done

preparing documents... done

copying assets... copying static files... done

copying extra files... done

done

writing output... [100%] samples/peripherals/uart/uart_poll

C:\aithinker_Ai-M6X_SDK\docs\source\samples\components\freertos.rst:69: WARNING: undefined label: 'bl_dev_cube'

generating indices... genindex done

writing additional pages... search done

copying images... [100%] notes/img/uart_sig.png

dumping search index in English (code: en)... done

dumping object inventory... done


====================== slowest reading durations =======================

0.187 api_reference/peripherals/adc

0.156 api_reference/components/bflog

0.156 api_reference/peripherals/spi

0.125 api_reference/peripherals/flash

0.125 api_reference/peripherals/pwm_v2

build succeeded, 9 warnings.


The HTML pages are in build\html.

最终打开,C:\aithinker_Ai-M6X_SDK\docs\build\html 下的 index.html

效果如下:我们拥有了一个离线的SDK文档。

回复

使用道具 举报

WT_0213 | 2023-12-3 15:24:14 | 显示全部楼层
回复

使用道具 举报

lazy | 2023-12-3 15:42:11 | 显示全部楼层
真不错
回复

使用道具 举报

干簧管 | 2023-12-3 16:24:43 | 显示全部楼层
回复

使用道具 举报

lsrly | 2023-12-3 17:16:23 | 显示全部楼层
学习了
回复

使用道具 举报

iiv | 2023-12-3 23:41:26 | 显示全部楼层
这个好玩,有空学一下,66
回复 支持 反对

使用道具 举报

bzhou830 | 2023-12-4 08:54:28 | 显示全部楼层
选择去发光,而不是被照亮
回复

使用道具 举报

qwe2079282957 | 2023-12-4 09:59:33 | 显示全部楼层
回复

使用道具 举报

lazy | 2023-12-4 10:25:53 | 显示全部楼层
挺实用的
回复

使用道具 举报

吃一个鸡蛋 | 2023-12-4 11:41:47 | 显示全部楼层
不错不错
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则