Skip to content

zpy-programming/zpy-docs-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zpy Docs Generator

Zpy Docs Generator - auto translate Python Library API to Zpy API, and generate Zpy Lib Docs

Zpy Lib API is a Chinese mapping of the Python API

example

{
    "name":"test",
    "zpy":"测试",
    "functions":[
        {
            "name":"threading_cleanup",
            "zpy":"线程清理"
        },
        {
            "name":"run_with_locale",
            "zpy":"运行与语言环境"
        },
    ],
    "args":[
        {
            "name":"cpython",
            "zpy":"cpython"
        },
        {
            "name":"captured_stdout",
            "zpy":"捕捉到stdout"
        },
    ]
}

Quick Start

clone this repo

git clone https://github.com/louisyoungx/zpy-docs-generator.git
cd zpy-docs-generator

install dependences

pip install requests, scrapy, jieba, wordninja

download dictionary

wget https://resource.rocke.top/zpy/dictionary_lite.csv
mv dictionary_lite.csv dics

Python Lib

generate python builtin lib docs

python3 main.py

the lib docs is in libs/ directory

ls libs

Third-party Lib

edit config.py

  • change URL
  • change LIB_NAME, exp:requests-libs

edit lib.py

  • let libs in 19 line return list of url, exp: ['string.html', 'time.html']

edit module.py

  • change xpath expression of name, methods, params in 16, 17, 18 line

generate third-party lib docs

python3 main.py

the lib docs is in YOUR-LIB-NAME directory

ls requests-libs

requests demo

git checkout requests

generate requests lib docs

python3 main.py

the lib docs is in requests-libs directory

ls requests-libs

About

Zpy Docs Generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages