public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Feature Request: Case sensitive YAML variables
@ 2015-11-17  0:53 Dave Jarvis
       [not found] ` <afb837fa-7623-4574-bfdc-48991f2b2e3f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jarvis @ 2015-11-17  0:53 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 3175 bytes --]



Consider:


entity:
  name:
    singular: bacterium
    plural: bacteria
  capname:
    singular: Bacterium
    plural: Bacteria


The extra level of indirection could be eliminated by supporting case 
sensitivity:


entity:
  singular: bacterium
  plural: bacteria
  Singular: Bacterium
  Plural: Bacteria


The end user would have to enable case-sensitive YAML variables from the 
command-line, explicitly (to maintain backwards compatibility), such as:


pandoc filename.md --template filename.yaml --case-sensitive 


Using uppercase and lowercase also requires three tiers. The names aren't 
important; the following are equivalent:


entity:
  lc:
    singular: bacterium
    plural: bacteria
  uc:
    singular: Bacterium
    plural: Bacteria


entity:
  singular:
    lowercase: bacterium
    uppercase: Bacterium
  plural:
    lowercase: bacteria
    uppercase: Bacteria


I'd like to eliminate that extra tier altogether:


entity:
  single: bacterium
  Single: Bacterium
  plural: bacteria
  Plural: Bacteria


Variable case sensitivity would be useful for screenplays as well, where 
the first instance of a character's name is typically all uppercase:


name:
  first: Jean-Luc
  FIRST: JEAN-LUC


Further, several specifications respect case of YAML keys:

   - YAML and JSON should have interoperability <http://jsontoyaml.com/>, 
   and JSON is case-sensitive
   - RAML <http://docs.raml.org/specs/1.0/#raml-10-spec-markup-language>, 
   an application of the YAML 1.2 specification, is case-sensitive.
   - The Ruby YAML parser is case-sensitive, as are several Go YAML parsers.
   - Swagger <http://swagger.io/specification/> is case-sensitive.
   - Various tools <https://github.com/dbohdan/remarshal> convert between 
   TOML, YAML, and JSON.

There is a large tooling infrastructure that can be leveraged and a world 
of pipelines that are possible when the option of treating YAML 
case-sensitively exists. How many people would take advantage of such 
interoperability within their MD text is unknown, but likely rather small.


I read a few times that this extra command-line option would break 
backwards compatibility. First, I'm not sure how. Second, even if it did, a 
warning/log message could be given to the end-user (and a suitable error 
code returned). Third, documentation should explain how the option breaks 
backwards compatibility. Fourth, it is possible to list keys that should be 
treated case-insensitively (to maintain backwards compatibility).


For example:


pandoc filename.md --template filename.yaml --case-sensitive --case-except 'title'


Thoughts?

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/afb837fa-7623-4574-bfdc-48991f2b2e3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 6805 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-17  2:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-17  0:53 Feature Request: Case sensitive YAML variables Dave Jarvis
     [not found] ` <afb837fa-7623-4574-bfdc-48991f2b2e3f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-11-17  2:35   ` John MacFarlane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).