Attempt for project to document itself, and moving to live version of nextreg.txt

This commit is contained in:
2025-10-08 12:28:46 +01:00
parent fb2ea0a29a
commit a85d323487
5 changed files with 162 additions and 1355 deletions

View File

@@ -9,6 +9,11 @@ interface RegisterBrowserProps {
registers: Register[];
}
/**
* Renders the access details for a register, including its description, operations, and notes.
* @param access The register access data to render.
* @returns A React component that displays the register access details.
*/
export function renderAccess(access: RegisterAccess) {
const renderTooltip = (notes: Note[]) => (
<Tooltip id="tooltip">
@@ -56,6 +61,11 @@ export function renderAccess(access: RegisterAccess) {
);
}
/**
* A component for browsing and searching through a list of registers.
* @param registers An array of Register objects to display.
* @returns A React component that allows users to browse and search registers.
*/
export default function RegisterBrowser({ registers }: RegisterBrowserProps) {
const [searchTerm, setSearchTerm] = useState('');

View File

@@ -4,6 +4,12 @@ import { Container, Row, Col, Card, Tabs, Tab } from 'react-bootstrap';
import { Register } from './types';
import { renderAccess } from './RegisterBrowser';
/**
* A client-side component that displays the details of a single register.
* @param register The register object to display.
* @param defaultActiveKey The default active tab to display.
* @returns A React component that displays the register details.
*/
export default function RegisterDetailClient({
register,
defaultActiveKey,

View File

@@ -3,6 +3,11 @@ import path from 'path';
import RegisterBrowser from './RegisterBrowser';
import { Register, RegisterAccess } from './types';
/**
* Parses the content of the nextreg.txt file and returns an array of register objects.
* @param fileContent The content of the nextreg.txt file.
* @returns A promise that resolves to an array of Register objects.
*/
async function parseNextReg(fileContent: string): Promise<Register[]> {
const registers: Register[] = [];
const paragraphs = fileContent.split(/\n\s*\n/);