mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 01:39:21 +02:00
GP-5496: Converting headless readme to markdown
This commit is contained in:
parent
6d44b9bad7
commit
95060a2dd8
6 changed files with 1084 additions and 1448 deletions
File diff suppressed because it is too large
Load diff
1047
Ghidra/RuntimeScripts/Common/support/analyzeHeadlessREADME.md
Normal file
1047
Ghidra/RuntimeScripts/Common/support/analyzeHeadlessREADME.md
Normal file
File diff suppressed because it is too large
Load diff
|
@ -28,6 +28,18 @@ rootProject.assembleDistribution {
|
|||
}
|
||||
}
|
||||
|
||||
rootProject.assembleMarkdownToHtml {
|
||||
from (this.project.file("Common/support")) {
|
||||
include "*.md"
|
||||
into "support"
|
||||
}
|
||||
|
||||
from (this.project.file("Common/server")) {
|
||||
include "*.md"
|
||||
into "server"
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.PLATFORMS.each { platform ->
|
||||
rootProject.tasks.findAll {it.name == "assembleDistribution_${platform.name}"}.each { t ->
|
||||
def p = this.project
|
||||
|
|
|
@ -6,7 +6,7 @@ Common/server/jaas.conf||GHIDRA||||END|
|
|||
Common/server/server.conf||GHIDRA||||END|
|
||||
Common/server/svrREADME.html||GHIDRA||||END|
|
||||
Common/support/GhidraGo/ghidraGoREADME.html||GHIDRA||||END|
|
||||
Common/support/analyzeHeadlessREADME.html||GHIDRA||||END|
|
||||
Common/support/analyzeHeadlessREADME.md||GHIDRA||||END|
|
||||
Common/support/buildGhidraJarREADME.txt||GHIDRA||||END|
|
||||
Common/support/debug.log4j.xml||GHIDRA||||END|
|
||||
Common/support/gradle/gradle-wrapper.jar||Apache License 2.0||||END|
|
||||
|
|
|
@ -21,4 +21,5 @@ dependencies {
|
|||
implementation 'org.commonmark:commonmark:0.23.0'
|
||||
implementation 'org.commonmark:commonmark-ext-heading-anchor:0.23.0'
|
||||
implementation 'org.commonmark:commonmark-ext-footnotes:0.23.0'
|
||||
implementation 'org.commonmark:commonmark-ext-gfm-tables:0.23.0'
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Map;
|
|||
|
||||
import org.commonmark.Extension;
|
||||
import org.commonmark.ext.footnotes.FootnotesExtension;
|
||||
import org.commonmark.ext.gfm.tables.*;
|
||||
import org.commonmark.ext.heading.anchor.HeadingAnchorExtension;
|
||||
import org.commonmark.node.Link;
|
||||
import org.commonmark.node.Node;
|
||||
|
@ -51,11 +52,12 @@ public class MarkdownToHtml {
|
|||
}
|
||||
|
||||
// Setup the CommonMark Library with the needed extension libraries
|
||||
List<Extension> extensions =
|
||||
List.of(HeadingAnchorExtension.create(), FootnotesExtension.create());
|
||||
List<Extension> extensions = List.of(HeadingAnchorExtension.create(),
|
||||
FootnotesExtension.create(), TablesExtension.create());
|
||||
Parser parser = Parser.builder().extensions(extensions).build();
|
||||
HtmlRenderer renderer = HtmlRenderer.builder()
|
||||
.extensions(extensions)
|
||||
.attributeProviderFactory(new TableAttributeProvider())
|
||||
.attributeProviderFactory(new LinkAttributeProvider())
|
||||
.build();
|
||||
|
||||
|
@ -73,6 +75,25 @@ public class MarkdownToHtml {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to add custom style to tables
|
||||
*/
|
||||
private static class TableAttributeProvider
|
||||
implements AttributeProvider, AttributeProviderFactory {
|
||||
@Override
|
||||
public AttributeProvider create(AttributeProviderContext attributeProviderContext) {
|
||||
return new TableAttributeProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttributes(Node node, String tagName, Map<String, String> attributes) {
|
||||
if (node instanceof TableBlock || node instanceof TableCell) {
|
||||
attributes.put("style",
|
||||
"border: 1px solid black; border-collapse: collapse; padding: 5px;");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to help adjust links to Markdown files to instead become links to HTML files
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue