整理 docs 代码
This commit is contained in:
parent
af5a0e0cc9
commit
0b09de219e
@ -1,3 +1,6 @@
|
|||||||
|
::: anchor
|
||||||
|
:::
|
||||||
|
|
||||||
::: title 基础使用
|
::: title 基础使用
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<style>
|
<style>
|
||||||
.lay-table-box table {
|
.lay-table-box table {
|
||||||
width: 100%; /*表格宽度*/
|
width: 100%;
|
||||||
border-collapse: collapse; /*使用单一线条的边框*/
|
border-collapse: collapse;
|
||||||
empty-cells: show; /*单元格无内容依旧绘制边框*/
|
empty-cells: show;
|
||||||
border-right: 1px solid whitesmoke;
|
border-right: 1px solid whitesmoke;
|
||||||
border-left: 1px solid whitesmoke;
|
border-left: 1px solid whitesmoke;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
@ -2,12 +2,9 @@ import container from "markdown-it-container";
|
|||||||
import type Token from "markdown-it/lib/token";
|
import type Token from "markdown-it/lib/token";
|
||||||
|
|
||||||
type ContainerArgs = [
|
type ContainerArgs = [
|
||||||
typeof container,
|
typeof container, string,
|
||||||
string,
|
{ render(tokens: Token[], idx: number): string }
|
||||||
{
|
]
|
||||||
render(tokens: Token[], idx: number): string;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function createContainer(
|
export default function createContainer(
|
||||||
klass: string,
|
klass: string,
|
||||||
|
@ -2,11 +2,8 @@ import container from 'markdown-it-container'
|
|||||||
import type Token from 'markdown-it/lib/token'
|
import type Token from 'markdown-it/lib/token'
|
||||||
|
|
||||||
type ContainerArgs = [
|
type ContainerArgs = [
|
||||||
typeof container,
|
typeof container, string,
|
||||||
string,
|
{ render(tokens: Token[], idx: number): string }
|
||||||
{
|
|
||||||
render(tokens: Token[], idx: number): string
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export default function createContainer(
|
export default function createContainer(
|
||||||
|
@ -2,11 +2,8 @@ import container from 'markdown-it-container'
|
|||||||
import type Token from 'markdown-it/lib/token'
|
import type Token from 'markdown-it/lib/token'
|
||||||
|
|
||||||
type ContainerArgs = [
|
type ContainerArgs = [
|
||||||
typeof container,
|
typeof container, string,
|
||||||
string,
|
{ render(tokens: Token[], idx: number): string }
|
||||||
{
|
|
||||||
render(tokens: Token[], idx: number): string
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export default function createContainer(
|
export default function createContainer(
|
||||||
|
@ -2,11 +2,8 @@ import container from 'markdown-it-container'
|
|||||||
import type Token from 'markdown-it/lib/token'
|
import type Token from 'markdown-it/lib/token'
|
||||||
|
|
||||||
type ContainerArgs = [
|
type ContainerArgs = [
|
||||||
typeof container,
|
typeof container, string,
|
||||||
string,
|
{ render(tokens: Token[], idx: number): string }
|
||||||
{
|
|
||||||
render(tokens: Token[], idx: number): string
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export default function createContainer(
|
export default function createContainer(
|
||||||
|
@ -2,11 +2,8 @@ import container from 'markdown-it-container'
|
|||||||
import type Token from 'markdown-it/lib/token'
|
import type Token from 'markdown-it/lib/token'
|
||||||
|
|
||||||
type ContainerArgs = [
|
type ContainerArgs = [
|
||||||
typeof container,
|
typeof container, string,
|
||||||
string,
|
{ render(tokens: Token[], idx: number): string }
|
||||||
{
|
|
||||||
render(tokens: Token[], idx: number): string
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export default function createContainer(
|
export default function createContainer(
|
||||||
|
@ -2,11 +2,8 @@ import container from 'markdown-it-container'
|
|||||||
import type Token from 'markdown-it/lib/token'
|
import type Token from 'markdown-it/lib/token'
|
||||||
|
|
||||||
type ContainerArgs = [
|
type ContainerArgs = [
|
||||||
typeof container,
|
typeof container, string,
|
||||||
string,
|
{ render(tokens: Token[], idx: number): string }
|
||||||
{
|
|
||||||
render(tokens: Token[], idx: number): string
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export default function createContainer(
|
export default function createContainer(
|
||||||
@ -23,7 +20,7 @@ export default function createContainer(
|
|||||||
if (token.nesting === 1) {
|
if (token.nesting === 1) {
|
||||||
return `<lay-field id="${info || defaultTitle}" title="${
|
return `<lay-field id="${info || defaultTitle}" title="${
|
||||||
info || defaultTitle
|
info || defaultTitle
|
||||||
}" style="margin-top:20px;margin-bottom: 20px;">`
|
}" style="margin-top:21px;margin-bottom: 20px;">`
|
||||||
} else {
|
} else {
|
||||||
return '</lay-field>\n'
|
return '</lay-field>\n'
|
||||||
}
|
}
|
||||||
|
@ -19,13 +19,8 @@ export default (md: MarkdownIt): void => {
|
|||||||
}
|
}
|
||||||
const start = pos + 3
|
const start = pos + 3
|
||||||
const end = state.skipSpacesBack(max, pos)
|
const end = state.skipSpacesBack(max, pos)
|
||||||
const rawPath = state.src
|
const rawPath = state.src.slice(start, end).trim().replace(/^@/, process.cwd())
|
||||||
.slice(start, end)
|
const content = fs.existsSync(rawPath) ? fs.readFileSync(rawPath).toString() : 'Not found: ' + rawPath
|
||||||
.trim()
|
|
||||||
.replace(/^@/, process.cwd())
|
|
||||||
const content = fs.existsSync(rawPath)
|
|
||||||
? fs.readFileSync(rawPath).toString()
|
|
||||||
: 'Not found: ' + rawPath
|
|
||||||
const meta = rawPath.replace(rawPath, '')
|
const meta = rawPath.replace(rawPath, '')
|
||||||
state.line = startLine + 1
|
state.line = startLine + 1
|
||||||
const token = state.push('fence', 'code', 0)
|
const token = state.push('fence', 'code', 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user