Git Product home page Git Product logo

doccarchive's People

Contributors

edudnyk avatar fruitcoder avatar helje5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

doccarchive's Issues

Support for external links in inlineContent

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"
    }
  }
}

link.zip

Images don't have a size anymore

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))

CodeListing.syntax should be optional

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))

Support for tables

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"
},

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.