mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-24 05:35:51 +00:00
Markdown syntax migration script
Script replacing include_code with code-snippet
Migration script: partials, some variables
Add variables to conversion script
draft repo-link component
Complete repo-link component
Migration script: handle github links
Draft include_svg→inline-svg (non-functional)
Currently doesn't work due to image path issues.
Also, captions and custom classes (for inlining) not implemented yet.
Conversion script: refactor & add code-page-name
Custom code-page-name component works around Markdoc limitation where
vars can't be used in `inline code` sections.
Migrate script: Handle more code includes correctly
Migration script: tabs and tabbed code samples
Child pages macro & conversion script
Adapted from 70cffa67ed
Migration script: update with some partial fixes
Migration script: callouts→admonitions
Fix auto-generation of index pages
Migration script: fix SVG migration
Migration scripting: fix code block prefixes & indentation
- Use the Redocly 0.66 feature for code block prefixes
- Update the script for converting indented code blocks to fences with
Roman's latest fixes (now uses 4 spaces per level, for consistency)
This commit is contained in:
44
content/@theme/markdoc/components.tsx
Normal file
44
content/@theme/markdoc/components.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import * as React from 'react';
|
||||
// @ts-ignore
|
||||
import dynamicReact from '@markdoc/markdoc/dist/react';
|
||||
import { usePageSharedData } from '@portal/hooks';
|
||||
import { Link } from '@portal/Link';
|
||||
|
||||
export function IndexPageItems() {
|
||||
const data = usePageSharedData('index-page-items') as any[];
|
||||
return (
|
||||
<div className="children-display">
|
||||
<ul>
|
||||
{data.map((item: any) => (
|
||||
<li className="level-1">
|
||||
<Link to={item.slug}>{item.title}</Link>
|
||||
<p className='class="blurb child-blurb'>{item.blurb}</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function RepoLink(props: {
|
||||
children: React.ReactNode;
|
||||
path: string;
|
||||
github_fork: string;
|
||||
github_branch: string
|
||||
}) {
|
||||
const treeblob = props.path.indexOf(".") >= 0 ? "blob/" : "tree/"
|
||||
const sep = props.github_fork[-1] == "/" ? "" : "/"
|
||||
const href = props.github_fork+sep+treeblob+props.github_branch+"/"+props.path
|
||||
|
||||
return (
|
||||
<Link to={href}>{dynamicReact(props.children, React, {})}</Link>
|
||||
)
|
||||
}
|
||||
|
||||
export function CodePageName(props: {
|
||||
name: string;
|
||||
}) {
|
||||
return (
|
||||
<code>{props.name}</code>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user