docczz / doccarchive Goto Github PK
View Code? Open in Web Editor NEWSwift package to read and process "DocC" archives
License: Apache License 2.0
Swift package to read and process "DocC" archives
License: Apache License 2.0
When using an external link you get an error unsupportedInlineContentType("link")
. A simple documentation containing [link](https://google.com)
produces the following json:
{
"primaryContentSections": [
{
"kind": "declarations",
"declarations": [
{
"tokens": [
{
"kind": "keyword",
"text": "struct"
},
{
"kind": "text",
"text": " "
},
{
"kind": "identifier",
"text": "DocCInlineContentLink"
}
],
"languages": [
"swift"
],
"platforms": [
"macOS"
]
}
]
},
{
"kind": "content",
"content": [
{
"anchor": "overview",
"level": 2,
"type": "heading",
"text": "Overview"
},
{
"type": "paragraph",
"inlineContent": [
{
"type": "text",
"text": "An "
},
{
"type": "reference",
"isActive": true,
"identifier": "https://google.com"
}
]
}
]
}
],
"schemaVersion": {
"major": 0,
"minor": 1,
"patch": 0
},
"sections": [],
"variants": [
{
"paths": [
"/documentation/doccinlinecontentlink/doccinlinecontentlink"
],
"traits": [
{
"interfaceLanguage": "swift"
}
]
}
],
"identifier": {
"url": "doc://DocCInlineContentLink/documentation/DocCInlineContentLink/DocCInlineContentLink",
"interfaceLanguage": "swift"
},
"abstract": [
{
"type": "text",
"text": "Sample documentation"
}
],
"kind": "symbol",
"metadata": {
"fragments": [
{
"kind": "keyword",
"text": "struct"
},
{
"kind": "text",
"text": " "
},
{
"kind": "identifier",
"text": "DocCInlineContentLink"
}
],
"title": "DocCInlineContentLink",
"roleHeading": "Structure",
"role": "symbol",
"symbolKind": "struct",
"externalID": "s:21DocCInlineContentLinkAAV",
"modules": [
{
"name": "DocCInlineContentLink"
}
],
"navigatorTitle": [
{
"kind": "identifier",
"text": "DocCInlineContentLink"
}
]
},
"hierarchy": {
"paths": [
[
"doc://DocCInlineContentLink/documentation/DocCInlineContentLink"
]
]
},
"topicSections": [
{
"title": "Initializers",
"identifiers": [
"doc://DocCInlineContentLink/documentation/DocCInlineContentLink/DocCInlineContentLink/init()"
]
},
{
"title": "Instance Properties",
"identifiers": [
"doc://DocCInlineContentLink/documentation/DocCInlineContentLink/DocCInlineContentLink/text"
]
}
],
"references": {
"doc://DocCInlineContentLink/documentation/DocCInlineContentLink/DocCInlineContentLink/text": {
"role": "symbol",
"title": "text",
"fragments": [
{
"kind": "keyword",
"text": "var"
},
{
"kind": "text",
"text": " "
},
{
"kind": "identifier",
"text": "text"
},
{
"kind": "text",
"text": ": "
},
{
"kind": "typeIdentifier",
"text": "String",
"preciseIdentifier": "s:SS"
}
],
"abstract": [],
"identifier": "doc://DocCInlineContentLink/documentation/DocCInlineContentLink/DocCInlineContentLink/text",
"kind": "symbol",
"type": "topic",
"url": "/documentation/doccinlinecontentlink/doccinlinecontentlink/text"
},
"doc://DocCInlineContentLink/documentation/DocCInlineContentLink": {
"role": "collection",
"title": "DocCInlineContentLink",
"abstract": [],
"identifier": "doc://DocCInlineContentLink/documentation/DocCInlineContentLink",
"kind": "symbol",
"type": "topic",
"url": "/documentation/doccinlinecontentlink"
},
"doc://DocCInlineContentLink/documentation/DocCInlineContentLink/DocCInlineContentLink/init()": {
"role": "symbol",
"title": "init()",
"fragments": [
{
"kind": "identifier",
"text": "init"
},
{
"kind": "text",
"text": "()"
}
],
"abstract": [],
"identifier": "doc://DocCInlineContentLink/documentation/DocCInlineContentLink/DocCInlineContentLink/init()",
"kind": "symbol",
"type": "topic",
"url": "/documentation/doccinlinecontentlink/doccinlinecontentlink/init()"
},
"doc://DocCInlineContentLink/documentation/DocCInlineContentLink/DocCInlineContentLink": {
"role": "symbol",
"title": "DocCInlineContentLink",
"fragments": [
{
"kind": "keyword",
"text": "struct"
},
{
"kind": "text",
"text": " "
},
{
"kind": "identifier",
"text": "DocCInlineContentLink"
}
],
"abstract": [
{
"type": "text",
"text": "Sample documentation"
}
],
"identifier": "doc://DocCInlineContentLink/documentation/DocCInlineContentLink/DocCInlineContentLink",
"kind": "symbol",
"type": "topic",
"navigatorTitle": [
{
"kind": "identifier",
"text": "DocCInlineContentLink"
}
],
"url": "/documentation/doccinlinecontentlink/doccinlinecontentlink"
},
"https://google.com": {
"title": "external url",
"titleInlineContent": [
{
"type": "text",
"text": "external url"
}
],
"type": "link",
"identifier": "https://google.com",
"url": "https://google.com"
}
}
}
Building the documentation with Xcode 13.2.1 the images don't have a size
anymore so the decoding fails with the following message:
Could not process document at: .../SlothCreator.doccarchive/data/tutorials/slothcreator.json keyNotFound(CodingKeys(stringValue: "size", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "references", intValue: nil), _JSONKey(stringValue: "slothcreator-intro.png", intValue: nil), CodingKeys(stringValue: "variants", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0)], debugDescription: "No value associated with key CodingKeys(stringValue: \"size\", intValue: nil) (\"size\").", underlyingError: nil))
In case when syntax of the code listing block is not specified, DocC of Xcode 13 puts "syntax":null
into json.
error docc2html : Could not process document at: /path/to/file.json valueNotFound(Swift.String, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "primaryContentSections", intValue: nil), _JSONKey(stringValue: "Index 1", intValue: 1), CodingKeys(stringValue: "content", intValue: nil), _JSONKey(stringValue: "Index 3", intValue: 3), CodingKeys(stringValue: "syntax", intValue: nil)], debugDescription: "Expected String value but found null instead.", underlyingError: nil))
Inline content type "strong" is unsupported. It appears for me in the DocC output of Xcode 13 for text in markdown prefixed and suffixed with two wildcards (**Strong Text**
)
Thanks for your amazing work. My documentation almost works with docc2html except for tables. I've seen that the Content
enum currently doesn't support tables and wanted to ask how hard it is to implement. Maybe I could create a PR if you could point me in the right direction :)
My table in the json file looks like this
{
"type": "table",
"rows": [
[
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "text",
"text": "Mode"
}
]
}
],
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "text",
"text": "Description"
}
]
}
]
],
[
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "codeVoice",
"code": "buffering"
}
]
}
],
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "text",
"text": "The mode indicates a buffering state."
}
]
}
]
],
[
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "codeVoice",
"code": "pause"
}
]
}
],
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "text",
"text": "The mode indicates a button tap triggers pause (two vertical bars)."
}
]
}
]
],
[
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "codeVoice",
"code": "play"
}
]
}
],
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "text",
"text": "The mode indicates a button tap triggers play (triangle)."
}
]
}
]
],
[
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "codeVoice",
"code": "stop"
}
]
}
],
[
{
"type": "paragraph",
"inlineContent": [
{
"type": "text",
"text": "The mode indicates a button tap triggers stop (square)."
}
]
}
]
]
],
"header": "row"
},
{
"anchor": "Respond-to-Button-Taps",
"level": 2,
"type": "heading",
"text": "Respond to Button Taps"
},
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.