Skip to content

Commit

Permalink
Docs Edit
Browse files Browse the repository at this point in the history
  • Loading branch information
rerdavies committed Jan 26, 2025
1 parent 8505657 commit 5ba47b4
Show file tree
Hide file tree
Showing 38 changed files with 1,797 additions and 1,472 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ set(NWINDOWS_BUILD_DOCUMENTATION ON CACHE BOOL "Build the Vite Documentation web
add_subdirectory("src")


add_subdirectory("examples/hello_world")
add_subdirectory("examples/hello_world2")
add_subdirectory("examples/context_edit")
add_subdirectory("examples")

# Docs are built by seperate CI step on github. The main CI build doesn't have NPM/Node JS installed.
if(NOT DEFINED ENV{GITHUB_ACTIONS})
Expand Down
2 changes: 1 addition & 1 deletion docs/make_route_pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ strings=(\
"/using/events"\
"/using/events/keyboard"\
"/using/events/mouse"\
"/using/events/misc"\
"/using/events/other"\
"/using/custom"\
"/using/custom/unicode"\
"/using/custom/inherit"\
Expand Down
4 changes: 4 additions & 0 deletions docs/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ h1 {
margin-left: 32px;
}

.link_target {
scroll-margin-top: 32px;
scroll-margin-bottom: 32px;
}
.method_description {
scroll-margin-top: 32px;
scroll-margin-bottom: 32px;
Expand Down
38 changes: 35 additions & 3 deletions docs/src/ClassDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
import React from "react";
import { RegisterIndexEntry } from "./IndexBuilder";
import { Link } from "react-router-dom";
import {IL} from "./M";
import {IL,ML} from "./M";


export default function
ClassDescription(props: {
Expand Down Expand Up @@ -55,6 +56,37 @@ export default function
</div>
);
}

export function
SummaryClassDescription(props: {
children?: React.ReactNode,
name: string,
prefix?: string,
id_tag?: string,
text? : string,
baseClass?: string
}) {

let id_tag = props.id_tag ?? "class";
let prefix = props.prefix || "class";
let id = id_tag + "__" + props.name;
let indexText = (props.prefix ?? "class") + " " + props.name;

RegisterIndexEntry(props.name, id, indexText);
return (
<div id={id} className="nav_target" >
<h2 className="class-desc-header" >
<div className="preformatted">{props.text ? props.text : (prefix + " " + props.name) }</div>
<ML name="" target={props.name}/>
</h2>

<div className="indent">
{props.children}
</div>
</div>
);
}

export function
EnumDescription(props: { children: React.ReactNode, enumName: string, prefix?: string }) {
return (
Expand Down Expand Up @@ -107,8 +139,8 @@ export function FieldEntry(props: { name: string, type: string, children?: React
}
return (
<React.Fragment>
<div className="property_grid_cell_pre"><IL name={props.type}/></div>
<div className="property_grid_cell_pre" id={id}>{propertyOnly}</div>
<div className="property_grid_cell_pre preformatted"><IL name={props.type}/></div>
<div className="property_grid_cell pre preformatted link_target" id={id}>{propertyOnly}</div>
<div className="property_grid_cell">{props.children}</div>
</React.Fragment>
);
Expand Down
8 changes: 4 additions & 4 deletions docs/src/DocsNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const NWindowsWindows = React.lazy(() => import("./pages/NWindowsWindows"));
const NWindowsEvents = React.lazy(() => import("./pages/NWindowsEvents"));
const KeyboardEvents = React.lazy(() => import("./pages/KeyboardEvents"));
const MouseEvents = React.lazy(() => import("./pages/MouseEvents"));
const MiscEvents = React.lazy(() => import("./pages/MiscEvents"));
const OtherEvents = React.lazy(() => import("./pages/OtherEvents"));
const CustomControls = React.lazy(() => import("./pages/CustomControls"));
const CustomUnicode = React.lazy(() => import("./pages/CustomUnicode"));

Expand Down Expand Up @@ -119,7 +119,7 @@ const indexedComponents: IndexedComponent[] = [
{ route: "/using/events", component: () => NWindowsEvents },
{ route: "/using/events/keyboard", component: () => KeyboardEvents },
{ route: "/using/events/mouse", component: () => MouseEvents },
{ route: "/using/events/misc", component: () => MiscEvents },
{ route: "/using/events/other", component: () => OtherEvents },
{ route: "/using/custom", component: () => CustomControls },
{ route: "/using/custom/unicode", component: () => CustomUnicode },
{ route: "/using/custom/inherit", component: () => InheritingCustomControl },
Expand Down Expand Up @@ -175,9 +175,9 @@ let docsIndex: DocsPage[] = [
{ route: "/using/events", title: "4.5 - NWindows Events", up: "/using" },
{ route: "/using/events/keyboard", title: "4.5.1 - Keyboard Events", up: "/using/events", },
{ route: "/using/events/mouse", title: "4.5.2 - Mouse Events", up: "/using/events", },
{ route: "/using/events/misc", title: "4.5.3 - Miscellaneous Events", up: "/using/events", },
{ route: "/using/events/other", title: "4.5.3 - Other Events", up: "/using/events", },
{ route: "/using/custom", title: "4.6 - Implementing Custom Controls", up: "/using", },
{ route: "/using/custom/unicode", title: "4.6.1 - Unicode Support", up: "/using/custom", },
{ route: "/using/custom/unicode", title: "4.6.1 - Supporting Unicode", up: "/using/custom", },
{ route: "/using/custom/inherit", title: "4.6.2 - Inheriting from Existing Elements", up: "/using/custom", },
{ route: "/using/custom/compose", title: "4.6.3 - Compound Elements", up: "/using/custom", },
{ route: "/using/custom/full", title: "4.6.4 - Fully-Custom Elements", up: "/using/custom", },
Expand Down
Loading

0 comments on commit 5ba47b4

Please sign in to comment.