-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #983 from HL7/2024-11-gg-publication-fixes
2024 11 gg publication fixes
- Loading branch information
Showing
12 changed files
with
372 additions
and
69 deletions.
There are no files selected for viewing
134 changes: 92 additions & 42 deletions
134
org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/Publisher.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
....publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/utils/IGRegistryScanner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.hl7.fhir.igtools.publisher.utils; | ||
|
||
import java.io.FileInputStream; | ||
import java.io.FileNotFoundException; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.util.jar.Attributes.Name; | ||
|
||
import org.hl7.fhir.utilities.json.model.JsonObject; | ||
import org.hl7.fhir.utilities.json.parser.JsonParser; | ||
|
||
public class IGRegistryScanner { | ||
|
||
private String filename; | ||
|
||
public IGRegistryScanner(String filename) { | ||
this.filename = filename; | ||
} | ||
|
||
public static void main(String[] args) throws FileNotFoundException, IOException { | ||
new IGRegistryScanner(args[0]).execute(); | ||
|
||
} | ||
|
||
private void execute() throws FileNotFoundException, IOException { | ||
JsonObject reg = JsonParser.parseObject(new FileInputStream(filename)); | ||
if (checkReg(reg)) { | ||
JsonParser.compose(reg, new FileOutputStream(filename), true); | ||
} | ||
} | ||
|
||
private boolean checkReg(JsonObject reg) { | ||
boolean changed = false; | ||
for (JsonObject ig : reg.forceArray("guides").asJsonObjects()) { | ||
if (!ig.has("language")) { | ||
String name = ig.asString("npm-name"); | ||
if (true || name.contains("ihe.formatcode.fhir")) { | ||
changed = true; | ||
ig.forceArray("language").add("en"); | ||
} else { | ||
System.out.println("No history: "+name); | ||
} | ||
} | ||
} | ||
return changed; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
...ir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/utils/JekyllRepatcher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.hl7.fhir.igtools.publisher.utils; | ||
|
||
import java.io.File; | ||
import java.io.FileNotFoundException; | ||
import java.io.IOException; | ||
|
||
import org.hl7.fhir.utilities.TextFile; | ||
|
||
public class JekyllRepatcher { | ||
|
||
public static void main(String[] args) throws FileNotFoundException, IOException { | ||
new JekyllRepatcher().process(new File(args[0])); | ||
} | ||
|
||
private void process(File folder) throws FileNotFoundException, IOException { | ||
for (File f : folder.listFiles()) { | ||
if (f.isDirectory()) { | ||
process(f); | ||
} else if (f.getName().endsWith(".html")) { | ||
String src = TextFile.fileToString(f); | ||
int i = src.indexOf("typeof=\"foaf:Document\">"); | ||
if (i > -1) { | ||
String hdr = src.substring(0, i+"typeof=\"foaf:Document\">".length()); | ||
int b = hdr.indexOf("<title>"); | ||
int e = hdr.indexOf("</title>"); | ||
String title = hdr.substring(b+7, e); | ||
|
||
src = src.substring(i+"typeof=\"foaf:Document\">".length()); | ||
i = src.indexOf("</div>"); | ||
src = src.substring(0, i).trim(); | ||
|
||
src = "---\nlayout: page\ntitle: "+title+"\n---\n"+src.replace("\r\n", "\n"); | ||
TextFile.stringToFile(src, f); | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.