\addons\docs\libraryService

文档Service

Summary

Methods
Properties
Constants
getDocsDir()
getDocsSourceDir()
getDocsPackageDir()
getDocsAssetsDir()
getDocsDistDir()
getRepositoryInfo()
download()
unzip()
github()
build()
getMarkdownData()
setMarkdownData()
getDocsData()
refreshDocsData()
html()
getPageByName()
getIndexPage()
No public properties found
No constants found
getArraySortIndex()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getDocsDir()

getDocsDir() 

getDocsSourceDir()

getDocsSourceDir() 

getDocsPackageDir()

getDocsPackageDir() 

getDocsAssetsDir()

getDocsAssetsDir() 

getDocsDistDir()

getDocsDistDir() 

getRepositoryInfo()

getRepositoryInfo(string  $url) : array

获取仓库信息

Parameters

string $url

Throws

\think\Exception

Returns

array

download()

download(string  $url, string  $file) : string

远程下载压缩包

Parameters

string $url

下载地址

string $file

存储本地文件

Throws

\think\Exception

Returns

string

unzip()

unzip(  $file) : string

解压插件

Parameters

$file

Throws

\think\Exception

Returns

string

github()

github() 

从Github远程下载压缩包

build()

build() 

生成HTML

getMarkdownData()

getMarkdownData(string  $md, boolean  $withsource = false, boolean  $withcontent = false) : array

获取单个Markdown文件信息

Parameters

string $md
boolean $withsource

包含渲染前的源内容

boolean $withcontent

包含渲染后的HTML内容

Returns

array

setMarkdownData()

setMarkdownData(string  $md, array  $data) : boolean

设置Markdata数据

Parameters

string $md
array $data

Returns

boolean

getDocsData()

getDocsData(boolean  $cache = true) : array

获取文档基础数据

Parameters

boolean $cache

是否缓存

Returns

array

refreshDocsData()

refreshDocsData() : array

刷新

Returns

array

html()

html(string  $md) : string

解析markdown

Parameters

string $md

Returns

string

getPageByName()

getPageByName(array  $docsdata, string  $md) : mixed|null

根据名称获取文档

Parameters

array $docsdata
string $md

Returns

mixed|null

getIndexPage()

getIndexPage(array  $docsdata, string  $type = '') : array|mixed|null

获取默认文档页

Parameters

array $docsdata
string $type

Returns

array|mixed|null

getArraySortIndex()

getArraySortIndex(array  $arr, string  $field = 'weigh', string  $sort = "SORT_ASC") : array

二维数组排序

Parameters

array $arr
string $field
string $sort

Returns

array