Skip to content

Commit fd1c4aa

Browse files
authored
Merge pull request #105 from USACE-RMC/docs/direct-pdf-reports
Add direct PDF download reports for TotalRisk, BestFit, and LifeSim
2 parents 3f92934 + f2cd7d3 commit fd1c4aa

12 files changed

Lines changed: 104 additions & 32 deletions

File tree

docs/dev/python-quickstart-guide/02-installing-git.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Both tools are essential for RMC development — even if you are working on a so
6868
<a href="https://git-scm.com/downloads/win">Portable Git</a> (the "Portable" or
6969
"thumbdrive" edition), extract it to a permanent folder, and add the folder to your
7070
user PATH (same process as described in{' '}
71-
<a href="./01-installing-python">Installing Python</a>).
71+
<a href="./installing-python">Installing Python</a>).
7272
</p>
7373
<h4>GitHub Desktop</h4>
7474
<ol>

src/components/ContentBox.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ const ContentBox = ({ contentData }) => {
1616
doc_name={data.doc_name}
1717
active={data.active}
1818
preserveIconColor={data.preserveIconColor}
19+
downloadUrl={data.downloadUrl}
20+
draft={data.draft}
1921
/>
2022
))}
2123
</div>

src/components/ContentBubble.js

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
import ThemedImage from '@theme/ThemedImage';
22
import '../css/custom.css';
33

4-
const ContentBubble = ({ icon, iconLight, iconDark, IconComponent, doc_location, doc_name, active, preserveIconColor = false }) => {
4+
const ContentBubble = ({
5+
icon,
6+
iconLight,
7+
iconDark,
8+
IconComponent,
9+
doc_location,
10+
doc_name,
11+
active,
12+
preserveIconColor = false,
13+
downloadUrl,
14+
draft = false,
15+
}) => {
516
const iconFilter = preserveIconColor ? '' : 'brightness-0 invert';
617
const baseClasses = `
718
flex min-h-[90px] xl:min-h-[130px] items-center overflow-hidden rounded-xl
@@ -27,10 +38,9 @@ const ContentBubble = ({ icon, iconLight, iconDark, IconComponent, doc_location,
2738
`;
2839

2940
// Build <ThemedImage /> sources, with fallback to legacy `icon`
30-
const sources =
31-
iconLight || icon ? { light: iconLight ?? icon, dark: iconDark ?? iconLight ?? icon } : null;
41+
const sources = iconLight || icon ? { light: iconLight ?? icon, dark: iconDark ?? iconLight ?? icon } : null;
3242

33-
const Inner = ({ comingSoon = false }) => (
43+
const Inner = ({ comingSoon = false, pdfDownload = false, isDraft = false }) => (
3444
<div className="flex items-center gap-[16px] px-[16px] py-[10px] xl:gap-[20px] xl:px-[20px] xl:py-[14px]">
3545
{IconComponent ? (
3646
<div className="frosted-glass-circle flex h-[44px] w-[44px] shrink-0 items-center justify-center rounded-full xl:h-[60px] xl:w-[60px]">
@@ -42,21 +52,31 @@ const ContentBubble = ({ icon, iconLight, iconDark, IconComponent, doc_location,
4252
</div>
4353
) : null}
4454
<div>
45-
<p className="mb-0 font-usace text-[1rem] leading-[1.2] no-underline text-white xl:text-[1.15rem]">
46-
{doc_name}
47-
</p>
55+
<p className="mb-0 font-usace text-[1rem] leading-[1.2] text-white no-underline xl:text-[1.15rem]">{doc_name}</p>
4856
{comingSoon && (
49-
<span className="mt-2 inline-block rounded-full bg-white/20 px-3 py-0.5 font-usace text-[0.7rem] leading-none text-white/70">
50-
Coming Soon
51-
</span>
57+
<span className="mt-2 inline-block rounded-full bg-white/20 px-3 py-0.5 font-usace text-[0.7rem] text-white/70">Coming Soon</span>
58+
)}
59+
{pdfDownload && (
60+
<span className="mt-2 inline-block rounded-full bg-white/20 px-3 py-0.5 font-usace text-[0.7rem] text-white/70">PDF Download</span>
61+
)}
62+
{isDraft && (
63+
<span className="ml-2 mt-2 inline-block rounded-full bg-amber-400/30 px-3 py-0.5 font-usace text-[0.7rem] text-amber-100">Draft</span>
5264
)}
5365
</div>
5466
</div>
5567
);
5668

69+
if (active && downloadUrl) {
70+
return (
71+
<a href={downloadUrl} download className={`${baseClasses} ${activeClasses}`}>
72+
<Inner pdfDownload isDraft={draft} />
73+
</a>
74+
);
75+
}
76+
5777
return active ? (
5878
<a href={doc_location} className={`${baseClasses} ${activeClasses}`}>
59-
<Inner />
79+
<Inner isDraft={draft} />
6080
</a>
6181
) : (
6282
<div className={`${baseClasses} ${inactiveClasses}`}>

src/pages/changelog.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,23 @@ export default function Changelog() {
1515
</div>
1616
<div className="mx-auto max-w-[1600px] px-6 pb-16 pt-8 lg:px-12">
1717
<TableChangelog
18-
dates={['March 2026']}
19-
categories={['Website Update']}
20-
documents={['-']}
21-
versions={['-']}
22-
descriptions={['Initial launch of the RMC Software Documentation website.']}
18+
dates={['March 25, 2026', 'March 25, 2026', 'March 25, 2026', 'March 25, 2026', 'March 12, 2026']}
19+
categories={['PDF Download', 'PDF Download', 'PDF Download', 'PDF Download', 'Website Update']}
20+
documents={[
21+
'RMC TotalRisk Verification Report (Draft)',
22+
'RMC TotalRisk Technical Reference Manual (Draft)',
23+
'RMC-BestFit Verification Report',
24+
'LifeSim Technical Reference Manual',
25+
'-',
26+
]}
27+
versions={['-', '-', '-', '-', '-']}
28+
descriptions={[
29+
'Added as direct PDF download.',
30+
'Added as direct PDF download.',
31+
'Added as direct PDF download.',
32+
'Added as direct PDF download.',
33+
'Initial launch of the RMC Software Documentation website.',
34+
]}
2335
/>
2436
</div>
2537
</main>

src/pages/desktop-applications/lifesim.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ const lifeSimData = [
2323
active: true,
2424
draft: false,
2525
},
26+
{
27+
icon: 'img/LifeSim.png',
28+
preserveIconColor: true,
29+
doc_name: 'LifeSim Technical Reference Manual',
30+
active: true,
31+
draft: false,
32+
downloadUrl: '/source-documents/desktop-applications/lifesim/technical-reference-manual/LifeSim-Technical-Reference-Manual.pdf',
33+
},
2634
{
2735
icon: 'img/LifeSim.png',
2836
preserveIconColor: true,
@@ -50,7 +58,8 @@ export default function LifeSim() {
5058
icon: addBaseUrl(doc.icon),
5159
iconLight: addBaseUrl(doc.iconLight),
5260
iconDark: addBaseUrl(doc.iconDark),
53-
doc_location: addBaseUrl(`docs/${doc.doc_location}/${latestVersions[doc.doc_location.replace(/^docs\//, '')]}/preface`),
61+
doc_location: doc.downloadUrl ? undefined : addBaseUrl(`docs/${doc.doc_location}/${latestVersions[doc.doc_location.replace(/^docs\//, '')]}/preface`),
62+
downloadUrl: doc.downloadUrl ? addBaseUrl(doc.downloadUrl) : undefined,
5463
}));
5564

5665
return (

src/pages/desktop-applications/rmc-bestfit.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ const bestFitData = [
1515
active: true,
1616
draft: false,
1717
},
18+
{
19+
icon: 'img/BestFit.png',
20+
preserveIconColor: true,
21+
doc_name: 'RMC-BestFit Verification Report',
22+
active: true,
23+
draft: false,
24+
downloadUrl: '/source-documents/desktop-applications/rmc-bestfit/verification-report/RMC-BestFit-Verification-Report.pdf',
25+
},
1826
];
1927

2028
export const bestFitDocs = bestFitData;
@@ -35,7 +43,8 @@ export default function BestFit() {
3543
icon: addBaseUrl(doc.icon),
3644
iconLight: addBaseUrl(doc.iconLight),
3745
iconDark: addBaseUrl(doc.iconDark),
38-
doc_location: addBaseUrl(`docs/${doc.doc_location}/${latestVersions[doc.doc_location.replace(/^docs\//, '')]}/preface`),
46+
doc_location: doc.downloadUrl ? undefined : addBaseUrl(`docs/${doc.doc_location}/${latestVersions[doc.doc_location.replace(/^docs\//, '')]}/preface`),
47+
downloadUrl: doc.downloadUrl ? addBaseUrl(doc.downloadUrl) : undefined,
3948
}));
4049

4150
return (

src/pages/desktop-applications/rmc-totalrisk.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,27 @@ const totalRiskData = [
1818
{
1919
icon: 'img/TotalRisk.png',
2020
preserveIconColor: true,
21-
doc_location: 'desktop-applications/rmc-totalrisk/applications-guide',
22-
doc_name: 'RMC TotalRisk Applications Guide',
23-
active: false,
21+
doc_name: 'RMC TotalRisk Verification Report',
22+
active: true,
2423
draft: true,
24+
downloadUrl: '/source-documents/desktop-applications/rmc-totalrisk/verification-report/RMC-TotalRisk-Verification-Report.pdf',
2525
},
26-
/*{
26+
{
2727
icon: 'img/TotalRisk.png',
2828
preserveIconColor: true,
29-
doc_location: 'desktop-applications/rmc-totalrisk/vertification-report',
30-
doc_name: 'RMC TotalRisk Verification Report',
29+
doc_name: 'RMC TotalRisk Technical Reference Manual',
30+
active: true,
31+
draft: true,
32+
downloadUrl: '/source-documents/desktop-applications/rmc-totalrisk/technical-reference-manual/RMC-TotalRisk-Technical-Reference-Manual.pdf',
33+
},
34+
{
35+
icon: 'img/TotalRisk.png',
36+
preserveIconColor: true,
37+
doc_location: 'desktop-applications/rmc-totalrisk/applications-guide',
38+
doc_name: 'RMC TotalRisk Applications Guide',
3139
active: false,
3240
draft: true,
33-
},*/
41+
},
3442
];
3543

3644
export const totalRiskDocs = totalRiskData;
@@ -51,7 +59,10 @@ export default function TotalRisk() {
5159
icon: addBaseUrl(doc.icon),
5260
iconLight: addBaseUrl(doc.iconLight),
5361
iconDark: addBaseUrl(doc.iconDark),
54-
doc_location: addBaseUrl(`docs/${doc.doc_location}/${latestVersions[doc.doc_location.replace(/^docs\//, '')]}/preface`),
62+
doc_location: doc.downloadUrl
63+
? undefined
64+
: addBaseUrl(`docs/${doc.doc_location}/${latestVersions[doc.doc_location.replace(/^docs\//, '')]}/preface`),
65+
downloadUrl: doc.downloadUrl ? addBaseUrl(doc.downloadUrl) : undefined,
5566
}));
5667

5768
return (

src/theme/Layout/buildNavLinks.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,20 @@ export default function buildNavLinks(useBaseUrl, latestVersions = {}) {
1818
const trUserGuideHref = useBaseUrl(
1919
`/docs/desktop-applications/rmc-totalrisk/users-guide/${latestVersions['desktop-applications/rmc-totalrisk/users-guide'] || 'v1.0'}/preface`,
2020
);
21-
const trAppHref = useBaseUrl(
22-
`/docs/desktop-applications/rmc-totalrisk/applications-guide/${latestVersions['desktop-applications/rmc-totalrisk/applications-guide'] || 'v1.0'}/preface`,
21+
const trVerifPdfHref = useBaseUrl(
22+
'/source-documents/desktop-applications/rmc-totalrisk/verification-report/RMC-TotalRisk-Verification-Report.pdf',
2323
);
24-
const trVerifHref = useBaseUrl(
25-
`/docs/desktop-applications/rmc-totalrisk/verification-report/${latestVersions['desktop-applications/rmc-totalrisk/verification-report'] || 'v1.0'}/preface`,
24+
const trTechRefPdfHref = useBaseUrl(
25+
'/source-documents/desktop-applications/rmc-totalrisk/technical-reference-manual/RMC-TotalRisk-Technical-Reference-Manual.pdf',
2626
);
2727

2828
/* RMC-BestFit document links (third level) */
2929
const bestFitUserGuideHref = useBaseUrl(
3030
`/docs/desktop-applications/rmc-bestfit/users-guide/${latestVersions['desktop-applications/rmc-bestfit/users-guide'] || 'v1.0'}/preface`,
3131
);
32+
const bestFitVerifPdfHref = useBaseUrl(
33+
'/source-documents/desktop-applications/rmc-bestfit/verification-report/RMC-BestFit-Verification-Report.pdf',
34+
);
3235

3336
/* RMC-RFA document links (third level) */
3437
const rfaUserGuideHref = useBaseUrl(
@@ -45,6 +48,9 @@ export default function buildNavLinks(useBaseUrl, latestVersions = {}) {
4548
const lifeSimAppGuideHref = useBaseUrl(
4649
`/docs/desktop-applications/lifesim/applications-guide/${latestVersions['desktop-applications/lifesim/applications-guide'] || 'v1.0'}/preface`,
4750
);
51+
const lifeSimTechRefPdfHref = useBaseUrl(
52+
'/source-documents/desktop-applications/lifesim/technical-reference-manual/LifeSim-Technical-Reference-Manual.pdf',
53+
);
4854

4955
/* -------------------------------------------------------------------------------------------------------------------------------------------------------------- */
5056

@@ -167,7 +173,8 @@ export default function buildNavLinks(useBaseUrl, latestVersions = {}) {
167173
href: totalRiskHref,
168174
children: [
169175
{ id: 'tr-users-guide', text: "RMC-TotalRisk User's Guide", href: trUserGuideHref },
170-
// Optionally add trAppHref/trVerifHref if needed in the menu
176+
{ id: 'tr-verif-pdf', text: 'RMC-TotalRisk Verification Report (PDF)', href: trVerifPdfHref, target: '_blank', rel: 'noopener noreferrer' },
177+
{ id: 'tr-tech-ref-pdf', text: 'RMC-TotalRisk Technical Reference Manual (PDF)', href: trTechRefPdfHref, target: '_blank', rel: 'noopener noreferrer' },
171178
],
172179
},
173180
{
@@ -180,6 +187,7 @@ export default function buildNavLinks(useBaseUrl, latestVersions = {}) {
180187
text: "RMC-BestFit User's Guide",
181188
href: bestFitUserGuideHref,
182189
},
190+
{ id: 'bestfit-verif-pdf', text: 'RMC-BestFit Verification Report (PDF)', href: bestFitVerifPdfHref, target: '_blank', rel: 'noopener noreferrer' },
183191
],
184192
},
185193
{
@@ -199,6 +207,7 @@ export default function buildNavLinks(useBaseUrl, latestVersions = {}) {
199207
text: 'LifeSim Validation Studies',
200208
href: lifeSimValStudiesHref,
201209
},
210+
{ id: 'lifesim-tech-ref-pdf', text: 'LifeSim Technical Reference Manual (PDF)', href: lifeSimTechRefPdfHref, target: '_blank', rel: 'noopener noreferrer' },
202211
/* {
203212
id: 'lifesim-applications-guide',
204213
text: 'LifeSim Applications Guide',

0 commit comments

Comments
 (0)