Open deontologician opened 9 years ago
@deontologician: I think this is a very important discussion to have. I have a lot of ideas on this, but not a lot of time to write them up now, but I'll revisit this as soon as possible.
Your proposal seems reasonable. I'd like to find an example of a document where the multi-language docs diverge significantly, because while I believe that the syntax you're proposing makes complete sense, I'm worried that there are several documents where this syntax would make the source document incredibly complex (especially in the API docs).
@chipotle, do any examples come to mind, or does a syntax like this seem reasonable?
It seems reasonable. The big caveat is the API docs, as you mentioned -- it would make the source document complex, but at the same time that's where this might be the most helpful, since the API docs are nearly-identical text with language-specific examples. Although I would probably add a {{#cc "camelCase" }}
tag or something similar that outputs camelCase
or camel_case
depending on the language chosen, because doing that in text with a series of conditionals would get very verbose very quickly.
Right now we need 3 identical copies of each documentation page, which need to be kept in sync. This is really error prone, and I'm sure super annoying for @chipotle. With the upcoming creation of an official java driver (rethinkdb/rethinkdb#3930) slated for 2.1, the work is about to increase 33%.
Ideally, what it would be really nice to see are some custom tags that we can pre-process into the final files that jekyll uses (if there's some way to make this a jekyll plugin, even better)
Hypothetically:
Having per-language tags as above would be a nice start. Obviously there are some more convenient things we could do, like having a special tag like
{{#lang}}
that outputs the current language's name, since that will probably be common.@mglukhovsky @AtnNn thoughts?