[OpenSCAD] Abbreviations

Torsten Paul Torsten.Paul at gmx.de
Thu Jun 9 11:36:17 EDT 2016


Von: buttim <maurizio.butti at gmail.com>
> I'm thinking about moving the abbreviation list to an external
> file. Can someone point me in the right direction for choosing
> a format and location for the file? I was thinking about a
> per-user JSON file.
>
I guess it would be best to follow the logic that already exists
for render and editor color schemes, e.g.:

https://github.com/openscad/openscad/blob/master/src/scintillaeditor.cpp#L400

This allows to read the configuration from an application folder
location as well as overwrite from the user directory.

> The format might be something like this:
> {
>   "t" : { 
>         "l" : "translate([",
>         "r" : "])"
>       }
> }
>
Using JSON makes sense as the other configs are using this format
too and there's a simple file parser in Boost to read those files.

The l/r looks a bit strange, but it does not really matter much.
How would that handle multi-line cases / indentation? I think JSON
supports escaping like \t and \n, but I did not try that yet.

I think it would be good to merge the features from both solutions
as they do complete each other (like the CallTips are probably
quite useful for people getting started).

ciao,
  Torsten.




More information about the Discuss mailing list