Git Product home page Git Product logo

avrodoc's People

Contributors

ept avatar mphuff avatar

Stargazers

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

Watchers

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

avrodoc's Issues

Command-line argument for output file

For situations where you can't redirect stdout (e.g. some CI servers), we should support writing the HTML output to a file specified on the command line.

I think sort(1) is a good example for command line style. In its style, we would support all these forms (argument order doesn't matter, so the output argument can come before or after the inputs):

$ avrodoc input1.avsc input2.avsc > output.html
$ avrodoc input1.avsc input2.avsc -o output.html
$ avrodoc input1.avsc input2.avsc --output output.html
$ avrodoc input1.avsc input2.avsc --output=output.html
$ avrodoc -o output.html -- -input-file-that-starts-with-a-hyphen.avsc

Feature Request: Add types index page

Currently, there is a protocols index page that is displayed by default when you open an avrodoc file. It would be great to have a similar page specific to types. This way we could get a quick overview of all of the types, descriptions of the type, and a clickable link to each type.

sys.puts is deprecated

Hi!

I am getting sys.puts is not a function here because it was deprecated in newer versions of node.

Thanks

avrodoc fails for schema

avrodoc fails with "Not a valid json file: JdbcConfig.avsc" (the file is a valid json file though...) for the following schema:

{
  "type" : "record",
  "name" : "JavaConfig",
  "namespace" : "org.spf4j.base",
  "fields" : [ {
    "name" : "io",
    "type" : {
      "type" : "record",
      "name" : "IoConfig",
      "fields" : [ {
        "name" : "tmpdir",
        "type" : [ "null", "string" ],
        "doc" : "org/spf4j/base/Runtime.<clinit>:107",
        "default" : null
      } ]
    },
    "doc" : "Category: io"
  }, {
    "name" : "version",
    "type" : [ "null", "string" ],
    "doc" : "org/spf4j/base/Runtime.<clinit>:116",
    "default" : null
  }, {
    "name" : "home",
    "type" : [ "null", "string" ],
    "doc" : "org/spf4j/base/Runtime.<clinit>:120",
    "default" : null
  } ]
}

Decomposed schemas are not supported?

Are decomposed Avro schemas are supported?

I have a large number of objects in a deeply nested object hierarchy and we've separated each object into its own avsc schema file. Leaf "objects" only have primitive types and non-leaf objects reference other objects rather than define them inline, like so:

{
  "namespace": "my.namespace",
  "type": "record",
  "name": "TopRecord",
  "fields": [
    {"name": "Field1", "type": ["null", "string"], "default": null},
    {"name": "Field2", "type": ["null", "string"], "default": null},
    {"name": "Field3", "type": ["null", "string"], "default": null, "aliases": ["UpdateDtm"]},
    {"name": "Field4", "type": ["null", {"type": "array", "items": "string"}], "default": null},
    {"name": "Field5", "type": ["null", "SubRecord1"], "default": null},
    {"name": "Field6", "type": ["null", {"type": "array", "items": "SubRecord2"}], "default": null}
  ]
}

where SubRecord1 and 2 are defined in their own schema files (and may reference other subrecords, etc.)

Is this model supported in AvroDoc? When I run:

avrodoc src/main/resources/avro/import/*.avsc > foo.html

It runs without error but when I load foo.html into a browser it just displays "Loading" in both Chrome and Firefox.

Feature Request: Clickable / collapsible headers for 'Protocols' and 'Types'

In the navigation bar on the left-hand-side, there are headers currently for 'Protocols' and 'Types'. It would be nice to make these headers multi-purposed in the following ways:

  • Add a '+/-' symbol to the left of each that would expand or collapse the navigation section
  • Make the actual labels for the headers clickable to navigate to their appropriate 'index' pages (see #11 for index page for types)

DEFAULT behavior for generated docs: all sections expanded and protocol index page displayed

Display aliases

Fields and named types can have aliases. We should display them somewhere.

Nested schemas not processed in proper order

It appears that currently named types are processed in alphabetical order, so any nested type which has not yet been processed will fail due to the type not yet being defined.

I've solved a similar problem in my own repositories using the dependency-graph module and would be glad to contribute here.

Thoughts? If not, I'll begin work on the changes.

Report errors to the user

Currently any errors during schema parsing are thrown as JavaScript exceptions and just bubble to the top. Unless the user has the JavaScript console open, all they see is a blank page. We should catch those errors and show them to the user (in a dialog box or something).

Feature Request: Allow for types index page to be the 'homepage'

See Issue #11.

If the types page gets added, it would be nice to have an option when generating the avrodoc file to specify that the types index page should be set to the homepage rather than the protocols index page.

We have a number of generated avrodoc files that have a couple of empty protocol definitions that simply contain slews of type definitions. These are the docs we are shipping to customers and it would be nice to have them displayed at the homepage rather than having to click through to each type to get a glance of what is available to them.

Bug: Type definition page incorrectly formatted for types with complex members

There is a bug when generating the type definition pages that appears to be linked to a type definition having a complex member variable. When outputting these types (DateRange in the attached example), the definition is output numerous times rather than a single time with a list of protocols that define it.

Compare the output of Date and DateRange in the sample.html file from this gist: https://gist.github.com/mphuff/5461540

This Sample.html file was generated from this command: avrodoc ProtoclA.avsc ProtocolB.avsc ProtocolC.avsc --output=Sample.html

Support Github-style ``` code ``` code blocks

I have a schema defined in AVDL which makes heavy use of backtick-delimited preformatted code blocks for ASCII art. Avrodoc does not interpret these correctly at all.

I think the problem is that they are a Github extension. Would they be difficult to support?

Popovers containing a complex type cause a "flickering effect" in Firefox

In Firefox version 18, I've noticed that when you hover over a known complex type on a protocol page, if that type contains as a property another known complex type, the popover dialog flickers and is impossible to read.

I can't easily get a screenshot of this behavior but I'm using Firefox 18 on Ubuntu 10.4. I've tried at least FF 18 on Windows 7 and the issue doesn't appear there.

This is not a huge deal but something that could possibly be fixed for a future version.

Thanks,
Micah

Feature Request: Output arbitrary attributes for all idl objects

All idl objects (protocols, records, messages, errors, etc) that can be namespaced can also accept arbitrary attribute decorations.

idl can be decorated with these arbitrary attributes and the avro tools converter from idl to avro schema maintains these as top-level attributes under the specific record for either the protocol, record, message, etc.

Example (IDL):
@linksFrom("com.inome.testTypeA")
@linksTo("com.inome.testTypeB")
record EdgeAType { string property = ""; }

Example (Avro SCHEMA):
{
"type" : "record",
"name" : "EdgeAType",
"namespace" : "com.inome",
"doc" : "Some documentation.",
"fields" : [ {
"name" : "field1",
"type" : [ "null", "com.inome.X" ],
"doc" : "Some documentation",
"default" : null
} ],
"linksFrom" : "com.inome.testTypeA",
"linksTo" : "com.inome.testTypeB"
}

The output of this should go on the specific details page for each type of object. Probably as simply a separate table of key-value properties as the keys and values are just arbitrary strings. However, if a specific namespaced type is discovered in either place, an appropriate link should be generated.

Add build information to documentation page

As it is necessary in some projects to keep documentation for different versions it might be helpful for users to see information about build/generation time and schema version on the main page.

What if there is a label that display these information if relevant parameters were provided during build process?

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.