Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5e9f064
feat: added api page
nickfrosty Jan 18, 2023
5814b53
fix: api redirects
nickfrosty Jan 18, 2023
83cba29
feat: websocket page and partials
nickfrosty Jan 18, 2023
edba51e
feat: deprectated partials
nickfrosty Jan 18, 2023
4f1b1a2
feat: http method partials
nickfrosty Jan 18, 2023
51855f3
fix: more deprecated partials
nickfrosty Jan 18, 2023
1e4d613
feat: codeblock component and styles
nickfrosty Jan 18, 2023
6a796bf
feat: api http methods page
nickfrosty Jan 18, 2023
d79916e
feat: sidebar
nickfrosty Jan 18, 2023
54ba3dc
refactor: proposal api links
nickfrosty Jan 18, 2023
b122c22
refactor: internal linking
nickfrosty Jan 18, 2023
12fdc5e
refactor: more internal links
nickfrosty Jan 19, 2023
8c68391
refactor: internal link and note cards
nickfrosty Jan 19, 2023
010bd0e
refactor: local links
nickfrosty Jan 19, 2023
a2737e0
refactor: local links and auto save prettier
nickfrosty Jan 19, 2023
461cb58
feat: added numNonVoteTransaction data details
nickfrosty Jan 19, 2023
28d57b1
fix: updated getRecentPrioritizationFees
nickfrosty Jan 19, 2023
be42a34
fix: corrected wording
nickfrosty Jan 19, 2023
ee27822
fix: version typo
nickfrosty Jan 19, 2023
a980a4f
fix: commitment links
nickfrosty Jan 20, 2023
9cee329
fix: parsed response links
nickfrosty Jan 20, 2023
a48d69c
fix: dangling links
nickfrosty Jan 20, 2023
f0aa669
refactor: filter criteria
nickfrosty Jan 20, 2023
0694934
docs: removed jsonrpc-api.md file
nickfrosty Jan 20, 2023
4ea088e
fix: dangling links
nickfrosty Jan 20, 2023
8f2c048
style: removed whitespaces for CI
nickfrosty Jan 24, 2023
ae21cd1
style: removed whitespace
nickfrosty Jan 25, 2023
09e48e9
style: fixed whitespaces
nickfrosty Jan 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 161 additions & 0 deletions docs/components/CodeDocBlock.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
import React from "react";
import Link from "@docusaurus/Link";
// import clsx from "clsx";
import styles from "../src/pages/CodeDocBlock.module.css";

export function DocBlock({ children }) {
return <section className={styles.DocBlock}>{children}</section>;
}

export function DocSideBySide({ children }) {
return <section className={styles.DocSideBySide}>{children}</section>;
}

export function CodeParams({ children }) {
return <section className={styles.CodeParams}>{children}</section>;
}

export function CodeSnippets({ children }) {
return (
<section className={styles.CodeSnippets}>
{/* <p className={styles.Heading}>Code Sample:</p> */}

{children}
</section>
);
}

/*
Display a single Parameter
*/
export function Parameter(props) {
const {
name = null,
type = null,
required = null,
optional = null,
children,
} = computeHeader(props);

return (
<section className={styles.Parameter}>
<p className={styles.ParameterHeader}>
{name && name} {type && type} {required && required}{" "}
{optional && optional}
</p>

{children}
</section>
);
}

/*
Display a single Parameter's field data
*/
export function Field(props) {
const {
name = null,
type = null,
values = null,
required = null,
defaultValue = null,
optional = null,
children,
} = computeHeader(props);

return (
<section className={styles.Field}>
<p className={styles.ParameterHeader}>
{name && name} {type && type} {required && required}{" "}
{optional && optional}
{defaultValue && defaultValue}
</p>

<section>
{values && values}

{children}
</section>
</section>
);
}

/*
Parse an array of string values to display
*/
export function Values({ values = null }) {
// format the Parameter's values
if (values && Array.isArray(values) && values?.length) {
values = values.map((value) => (
<code style={{ marginRight: ".5em" }} key={value}>
{value}
</code>
));
}

return (
<p style={{}}>
<span className={styles.SubHeading}>Values:</span>&nbsp;{values}
</p>
);
}

/*
Compute the formatted Parameter and Field component's header meta data
*/
function computeHeader({
name = null,
type = null,
href = null,
values = null,
required = null,
defaultValue = null,
optional = null,
children,
}) {
// format the Parameter's name
if (name) {
name = <span className={styles.ParameterName}>{name}</span>;

if (href) name = <Link href={href}>{name}</Link>;
}

// format the Parameter's type
if (type) type = <code>{type}</code>;

// format the Parameter's values
if (values && Array.isArray(values)) {
values = values.map((value) => (
<code style={{ marginRight: ".5em" }}>{value}</code>
));
}

// format the `defaultValue` flag
if (defaultValue) {
defaultValue = (
<span className={styles.FlagItem}>
Default: <code>{defaultValue.toString()}</code>
</span>
);
}

// format the `required` flag
if (required) {
required = <span className={styles.FlagItem}>required</span>;
}
// format the `optional` flag
else if (optional) {
optional = <span className={styles.FlagItem}>optional</span>;
}

return {
name,
type,
href,
values,
required,
defaultValue,
optional,
children,
};
}
3 changes: 2 additions & 1 deletion docs/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ cat > "$CONFIG_FILE" <<EOF
{ "source": "/apps/drones", "destination": "/developing/on-chain-programs/examples" },
{ "source": "/apps/hello-world", "destination": "/developing/on-chain-programs/examples" },
{ "source": "/apps/javascript-api", "destination": "/developing/clients/javascript-api" },
{ "source": "/apps/jsonrpc-api", "destination": "/developing/clients/jsonrpc-api" },
{ "source": "/apps/jsonrpc-api", "destination": "/api" },
{ "source": "/developing/clients/jsonrpc-api", "destination": "/api" },
{ "source": "/apps/programming-faq", "destination": "/developing/on-chain-programs/faq" },
{ "source": "/apps/rent", "destination": "/developing/programming-model/accounts#rent" },
{ "source": "/apps/sysvars", "destination": "/developing/runtime-facilities/sysvars" },
Expand Down
6 changes: 4 additions & 2 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = {
// load the API specific sidebars file
...require("./sidebars/api.js"),
introductionSidebar: [
{
type: "category",
Expand Down Expand Up @@ -195,8 +197,8 @@ module.exports = {
label: "Clients",
items: [
{
type: "doc",
id: "developing/clients/jsonrpc-api",
type: "link",
href: "/api",
label: "JSON RPC API",
},
{
Expand Down
Loading