-
Notifications
You must be signed in to change notification settings - Fork 114
Conversation
Do you mean "newline" i.e. space space space space \n, or do you mean a paragraph? Because it looks like your commit tries to get rid of second paragraphs that are indented 4 spaces. Maybe the solution here is to remove empty lines from comments, so there are no second paragraphs? Would that work? As it is, with this commit we now have comment blocks with two different indentation levels in the same block. |
Yes - sorry about that. I meant, uh, newline x 2 - otherwise known as a paragraph :) We could definitely remove empty lines from comments, but that's a little limiting for the longer explanations (of which I hope we have more of some day!) My long term suggestion was something like this:
So we never hit the 4 space limit with normal indentation. If we can agree on something like that I can reformat all of the code in a different pr (and drop this one). My main goal was to quickly fix the docs on ga4gh.org, so at least @skeenan can patch this for now before we do something better. |
How does it handle something like: record { ....words words We could just be careful not to have indentation spaces on lines with no An alternative style would be: record { I.e. not indenting the comment relative to the delimiters. I don't like the single-space indent, since a conditional mixture of 2- and Maybe the right long-term solution is to just fix avrodoc to intelligently Anyway, it seems like it will take a non-trivial amount of time to work out On Wed, Jul 30, 2014 at 11:06 AM, cassiedoll notifications@github.com
|
I believe this is the relevant code in avrodoc. If that logic spits out the "code_block" result, then the comment gets wrapped in pre/code tags. (I think that says your first example would still trigger the code tag) The real fix is definitely to patch avrodoc (because it should take into account the initial indent of the overall comment block in that loop). We could also fork a copy which never uses code_block style for a simple indent (I don't think we ever want that to happen) - that would be an easy hack, but we'd have to maintain our own version. I'm open to whatever everyone else wants to do. |
Actually avrodoc is actually "doing the right thing" with respect to markdown formatting. This behaviour/bug is the fault of I'll create an example to illustrate the issue in a second. On a train with bad wifi. |
Here are some examples for the underlying problem with Markdown formatting when translating from Avro IDL to Avro JSON to HTML |
blah. so - do we hack avrodoc to work around the issue, try and fix avro-tools.jar, or change our comment style? |
I think the Right Way would be to change avro-tools.jar, which means making The first step would probably be complaining on the Avro mailing list, On Wed, Jul 30, 2014 at 2:02 PM, cassiedoll notifications@github.com
|
From a pragmatic perspective, I think we should change our comment/indent style and open a JIRA issue on the Avro project in parallel. |
+1 on that. We can't just sit around waiting for them to take our random On Wed, Jul 30, 2014 at 5:33 PM, Frank Austin Nothaft <
|
I've opened #111; I'm +1 to @cassiedoll's change as it is sufficient, and will try to put together #111 in the next week (unless anyone else wants to do it). |
We can just un-indent multi line comments. Will make the schema terrible to view, but it will fix the avrodoc issue. Single line comments will be ok as is.
|
Note: for some reason this fix did not work for the Stephen's docs on ga4gh.org, so he ended up removing the paragraph breaks. So let's definitely not merge this in. Question - should we use Adam's suggestion from before and just never use multi-paragraph comments? (and so just leave style as is) |
Closing this in favor of #111 |
This is the smallest possible change to fix the random
code
blocks that are appearing in our docs.Essentially, if a newline has 4 spaces in front of it, avrodoc thinks thats a markdown code block.
Long term, I think we need to fix our style guide to indent avro records by 2 spaces only, and then shift the bodies of the /** */ comments over by 1 space, so that a paragraph only ever has 3 spaces in front of it. (or - someone can patch avrodoc with a better fix :)