mirror of
https://github.com/Xahau/xahau-web.git
synced 2025-11-05 04:35:48 +00:00
format
This commit is contained in:
@@ -5,54 +5,54 @@ const parseRules: {
|
|||||||
path: string
|
path: string
|
||||||
parse: (content: string) => { label: string; url: string }[]
|
parse: (content: string) => { label: string; url: string }[]
|
||||||
}[] = [
|
}[] = [
|
||||||
{
|
{
|
||||||
path: 'src/content/references/global.md',
|
path: 'src/content/references/global.md',
|
||||||
parse: (content: string) => {
|
parse: (content: string) => {
|
||||||
const lines = content.split('\n')
|
const lines = content.split('\n')
|
||||||
const result: { label: string; url: string }[] = []
|
const result: { label: string; url: string }[] = []
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
const match = line.match(/^\[([^\]]+)\]:\s*(.+)$/)
|
const match = line.match(/^\[([^\]]+)\]:\s*(.+)$/)
|
||||||
if (match) {
|
if (match) {
|
||||||
const [, label, url] = match
|
const [, label, url] = match
|
||||||
result.push({ label, url: url.trim() })
|
result.push({ label, url: url.trim() })
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result
|
}
|
||||||
},
|
return result
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
path: 'src/content/references/transactions.md',
|
{
|
||||||
parse: (content: string) => {
|
path: 'src/content/references/transactions.md',
|
||||||
const lines = content.split('\n')
|
parse: (content: string) => {
|
||||||
const result: { label: string; url: string }[] = []
|
const lines = content.split('\n')
|
||||||
for (const line of lines) {
|
const result: { label: string; url: string }[] = []
|
||||||
if (line.length > 0) {
|
for (const line of lines) {
|
||||||
const url = `/docs/protocol-reference/transactions/transaction-types/${line.toLowerCase()}`
|
if (line.length > 0) {
|
||||||
result.push({ label: `${line}`, url })
|
const url = `/docs/protocol-reference/transactions/transaction-types/${line.toLowerCase()}`
|
||||||
result.push({ label: `${line} transaction`, url })
|
result.push({ label: `${line}`, url })
|
||||||
result.push({ label: `${line} transactions`, url })
|
result.push({ label: `${line} transaction`, url })
|
||||||
}
|
result.push({ label: `${line} transactions`, url })
|
||||||
}
|
}
|
||||||
return result
|
}
|
||||||
},
|
return result
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
path: 'src/content/references/pseudo-transactions.md',
|
{
|
||||||
parse: (content: string) => {
|
path: 'src/content/references/pseudo-transactions.md',
|
||||||
const lines = content.split('\n')
|
parse: (content: string) => {
|
||||||
const result: { label: string; url: string }[] = []
|
const lines = content.split('\n')
|
||||||
for (const line of lines) {
|
const result: { label: string; url: string }[] = []
|
||||||
if (line.length > 0) {
|
for (const line of lines) {
|
||||||
const url = `/docs/protocol-reference/transactions/pseudo-transaction-types/${line.toLowerCase()}`
|
if (line.length > 0) {
|
||||||
result.push({ label: `${line}`, url })
|
const url = `/docs/protocol-reference/transactions/pseudo-transaction-types/${line.toLowerCase()}`
|
||||||
result.push({ label: `${line} transaction`, url })
|
result.push({ label: `${line}`, url })
|
||||||
result.push({ label: `${line} transactions`, url })
|
result.push({ label: `${line} transaction`, url })
|
||||||
}
|
result.push({ label: `${line} transactions`, url })
|
||||||
}
|
}
|
||||||
return result
|
}
|
||||||
},
|
return result
|
||||||
},
|
},
|
||||||
]
|
},
|
||||||
|
]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remark plugin to resolve reference-style links from global.md
|
* Remark plugin to resolve reference-style links from global.md
|
||||||
|
|||||||
Reference in New Issue
Block a user