Skip to content

Commit

Permalink
Documentor 4 all
Browse files Browse the repository at this point in the history
Accepteer documentor functionaliteit wanneer geen configuratie
beschikbaar. Er wordt terugevallen op een default "Imvertor"
configuratie met een minimum document struktuur.

Improvement.
  • Loading branch information
arjan authored and arjan committed Dec 4, 2024
1 parent df8d472 commit 1fc4937
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/main/java/nl/imvertor/OfficeCompiler/OfficeCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,17 @@ public void generateOfficeReport() throws Exception {
// als documentor info beschikbaar is, dan uitpakken en omzetten naar xhtml met Pandoc
String mdf = configurator.getXParm("cli/documentorfile",false);

Boolean useDefault = false;
if (mdf == null && vr.contains("documentor")) {
runner.warn(logger, "Documentor processing requested but no modeldoc folder passed");
succeeds = false;
runner.warn(logger, "Documentor processing requested but no modeldoc folder passed. Using default model documentation.");
mdf = configurator.getBaseFolder() + "/etc/respec/documentor";
useDefault = true;
}

if (succeeds && vr.contains("documentor")) {

// Er is documentor input in de vorm van modeldocs meegeleverd.
// Zo niet, val terug op default modeldoc.

// Maak de workfolder en de module folder aan
workFolder = new AnyFolder(configurator.getWorkFolder("documentor"));
Expand Down Expand Up @@ -178,7 +181,7 @@ public void generateOfficeReport() throws Exception {
}

// maak een kopie van alle *relevante* files in de workfolder en verzamel deze in de modulefolder.
String modelName = configurator.getXParm("appinfo/original-application-name");
String modelName = useDefault ? "default" : configurator.getXParm("appinfo/original-application-name");
succeeds = succeeds ? copyFilesToModulefolder(workFolder + "/modeldoc/" + modelName, modelName, true, true) : false;
succeeds = succeeds ? copyFilesToModulefolder(workFolder + "/sections", modelName, true, false) : false;

Expand Down Expand Up @@ -208,7 +211,7 @@ public void generateOfficeReport() throws Exception {
AnyFolder leafletFolder = new AnyFolder(configurator.getBaseFolder(), "etc/respec/leaflet");
leafletFolder.copyFolder(target);
}
AnyFolder ownerFolder = new AnyFolder(configurator.getInputFolder() + "/cfg/docrules/documentor");
AnyFolder ownerFolder = new AnyFolder(useDefault ? configurator.getBaseFolder() + "/input/Imvertor/cfg/docrules/documentor" : configurator.getInputFolder() + "/cfg/docrules/documentor");
if (ownerFolder.isDirectory())
ownerFolder.copy(target);
else
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,13 @@ li.abbrevsline abbr.exclude {
li.abbrevsline abbr.exclude:after {
content: ": ";
}

.header-wrapper {
margin-top: 1rem;
}

div.topline {
color: gray;
font-size: 80%;
border-bottom: 1px solid gray;
}
121 changes: 121 additions & 0 deletions src/main/resources/input/Imvertor/cfg/docrules/documentor/js/owner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
var organisationConfig = {

nl_organisationName: "Imvertor OS",

nl_organisationStylesURL: "https://gitdocumentatie.logius.nl/publicatie/respec/style/",

nl_organisationPublishURL: "https://imvertor.org/publicatie",

// Het hier gedefinieerde logo wordt helemaal bovenaan het Respec document aan de rechterzijde geplaatst.
// Er is voor gekozen de 'width' property niet te gebruiken waardoor het logo automatisch in de juiste verhoudingen wordt geplaatst.

logos:[ {
src: "documentor/img/logo.png",
alt: "Logo Imvertor OS",
id: "Logo-ImvertorOS",
height: 77,
url: "https://imvertor.org",
}],

// De hier gedefinieerde variabelen kunnen door ze nogmaals in de config.js te plaatsen overruled worden.

pubDomain: "cim",

//this: "this", <-- Zo kun je dus eigen variabelen introduceren die je ergens anders kunt gebruiken.
// Zoals bijv. hier --> 'thisVersion: ["nl_organisationPublishURL", "this", "/", "shortName"],'

latestVersion:[ "nl_organisationPublishURL", "pubDomain", "/", "shortName"],
thisVersion:[ "nl_organisationPublishURL", "pubDomain", "/", "shortName", "/", "publishVersion"],
prevVersion:[ "nl_organisationPublishURL", "pubDomain", "/", "shortName", "/", "previousPublishVersion"],

useLogo: true,
useLabel: true,
// noTOC: true,
maxTocLevel: 4,

license: "eupl",
addSectionLinks: true,

localizationStrings: {
nl: {
// Specificatie-statussen
cv: "Consultatieversie",
vv: "Ter vaststelling",
ig: "In gebruik",
io: "In ontwikkeling",
// Specificatie-types
im: "Informatiemodel",
hl: "Handleiding",
},
en: {
// Specificatie-statussen
cv: "Consultation",
vv: "Proposed recommendation",
ig: "In use",
io: "In development",
// Specificatie-types
im: "Information model",
hl: "Guideline",
},
},

sotdText: {
nl: {
sotd: "Status van dit document",
cv: `Dit is een goedgekeurde consultatieversie. Commentaar over dit document kan gestuurd worden naar `,
vv: `Dit is een definitief concept van de nieuwe versie van dit document. Wijzigingen naar aanleiding van consultaties zijn doorgevoerd.`,
ig: "Dit document is 'In Gebruik'.",
io: "Dit document is nog 'In Ontwikkeling'.",
},
en: {
sotd: "Status of This Document",
cv: `This is a proposed recommendation approved by TO. Comments regarding this document may be sent to `,
vv: `This is the definitive concept of this document. Edits resulting from consultations have been applied.`,
ig: "This document is 'In Use'.",
io: "This document is is still 'Under Development'.",
},
},

labelColor: {
cv: "#154273",
vv: "#39870c",
ig: "#A569BD",
io: "#DC7633"
},

licenses: {
cc0: {
name: "Creative Commons 0 Public Domain Dedication",
short: "CC0",
url: "https://creativecommons.org/publicdomain/zero/1.0/",
image: "https://gitdocumentatie.logius.nl/publicatie/respec/media/logos/cc-zero.svg",
},
"cc-by": {
name: "Creative Commons Attribution 4.0 International Public License",
short: "CC-BY",
url: "https://creativecommons.org/licenses/by/4.0/legalcode",
image: "https://gitdocumentatie.logius.nl/publicatie/respec/media/logos/cc-by.svg",
},
"cc-by-nd": {
name: "Creative Commons Naamsvermelding-GeenAfgeleideWerken 4.0 Internationaal",
short: "CC-BY-ND",
url: "https://creativecommons.org/licenses/by-nd/4.0/legalcode.nl",
image: "https://gitdocumentatie.logius.nl/publicatie/respec/media/logos/cc-by-nd.svg",
},
"eupl": {
name: "EUROPEAN UNION PUBLIC LICENCE v. 1.2",
short: "EUPL",
url: "https://eupl.eu/",
image: "https://eupl.eu/eu.png",
},
},

localBiblio: {
"SemVer": {
href: "https://semver.org",
title: "Semantic Versioning 2.0.0",
authors:[ "T. Preston-Werner"],
date: "June 2013"
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@

<xsl:variable name="respec-config" as="xs:string*">
<xsl:for-each select="$respec-parms/parm">
<xsl:variable name="specified" select="imf:get-xparm('documentor/' || @parms-name,())"/>
<xsl:variable name="specified" select="imf:reduce-space(imf:merge-parms(imf:get-xparm('documentor/' || @parms-name,())))" as="xs:string?"/>
<xsl:variable name="default" select="node()"/>
<xsl:variable name="value" select="($specified,$default)[1]"/>
<xsl:if test="$value">
<xsl:choose>
<xsl:when test="@type = 'date'">
<xsl:text>{@respec-name} : "{$value}",&#10;</xsl:text>
<xsl:variable name="date" select="imf:extract-pattern($value,'\d{4}-\d{2}-\d{2}')[1]"/>
<xsl:text>{@respec-name} : "{$date}",&#10;</xsl:text>
</xsl:when>
<xsl:when test="@type = 'integer'">
<xsl:text>{@respec-name} : {$value},&#10;</xsl:text>
Expand Down Expand Up @@ -162,7 +163,7 @@
-->
<script src="documentor/js/{$respec-config-filename}.js" class="remove" async="async"/>

<title>{imf:get-xparm('documentor/prop-titel')}</title>
<title>{imf:merge-parms(imf:get-xparm('documentor/prop-titel'))}</title>

<!-- logo van de organisatie opnemen -->
<link href="documentor/img/logo.ico" rel="shortcut icon" type="image/x-icon" />
Expand Down

0 comments on commit 1fc4937

Please sign in to comment.