Re: Recommendations for metadata storage in Stylz

2018-04-09 Thread Guenter Milde
On 2018-04-03, Steve Litt wrote:
> On Mon, 2 Apr 2018 10:34:19 +1000
> Alan Tyree  wrote:

>> Hello Steve,
>> I would think YAML is the best choice here. It is easy to type and
>> easy for the beginner to understand. You could provide simple
>> templates for the most common cases. My own feeling is that anything
>> more complicated is going to turn off would-be authors.

> Thanks Alan (and you too Shay)!

> Both of you recommended for YAML and against JSON, made your points
> powerfully, and convinced me not to go with JSON (at least directly).

> I decided not to go with YAML because it's to easy to forget a colon or
> a dash and crash the program. The program would need to be too much of
> a mind reader.

> Instead I'm using several files consisting either of key-value pairs
> separated by an equal sign (people are used to those), or a few of the
> files are lists. I wrote a Python program to turn those files into a
> big, deeply nested dict that can run the program. Also, it will probably
> output a JSON file of the big, deeply nested dict, so all the other
> programs can use it.

If you are using Python anyway, consider the configuration file syntax and
module. It accepts some variations in the input syntax and normalizes this
to Python datatypes.

Günter



Re: Recommendations for metadata storage in Stylz

2018-04-02 Thread Steve Litt
On Mon, 2 Apr 2018 10:34:19 +1000
Alan Tyree  wrote:

> Hello Steve,
> I would think YAML is the best choice here. It is easy to type and
> easy for the beginner to understand. You could provide simple
> templates for the most common cases. My own feeling is that anything
> more complicated is going to turn off would-be authors.

Thanks Alan (and you too Shay)!

Both of you recommended for YAML and against JSON, made your points
powerfully, and convinced me not to go with JSON (at least directly).

I decided not to go with YAML because it's to easy to forget a colon or
a dash and crash the program. The program would need to be too much of
a mind reader.

Instead I'm using several files consisting either of key-value pairs
separated by an equal sign (people are used to those), or a few of the
files are lists. I wrote a Python program to turn those files into a
big, deeply nested dict that can run the program. Also, it will probably
output a JSON file of the big, deeply nested dict, so all the other
programs can use it.

Thanks,
 
SteveT

Steve Litt 
April 2018 featured book: Troubleshooting Techniques
 of the Successful Technologist
http://www.troubleshooters.com/techniques


Re: Recommendations for metadata storage in Stylz

2018-04-01 Thread Alan Tyree
Hello Steve,
I would think YAML is the best choice here. It is easy to type and easy for
the beginner to understand. You could provide simple templates for the most
common cases. My own feeling is that anything more complicated is going to
turn off would-be authors.

Good luck with this project!
Regards,
Alan

On 2 April 2018 at 10:02, Steve Litt  wrote:

> As many of you know, I'm in the middle of creating an authoring format
> called Stylz. You author Stylz docs in any old editor. Think of an
> Asciidoc knockoff which greatly prioritizes styles based authoring at
> the expense of Asciidoc's "we do it all for you."
>
> One of my tasks in order to reach Minimum Viable Product (MVP) status
> is to give the author a way of storing the book's metadata. By metadata
> I mean stuff like author, title, copyright, etc, combined with build
> info like CSS files to be inserted to link styles with their
> appearances in HTML and ePub outputs, or LaTeX layout files (similar to
> those in LyX) to link styles with their appearances in PDF and paper.
> The metadata is not, not, NOT going to be in the .stylz file itself:
> The .stylz file names styles and assumes somebody else will define them.
>
> So I need a format in which the author can put the metadata/buildinfo.
> Because I'm not a fan of dependencies, I right away ruled out mysql,
> Postgres, SQLite or MongoDB. From my perspective, this leaves Yaml,
> JSON, directory trees with leaf filenames being keys and their contents
> being values. Can anyone think of other alternatives?
>
> Do you think an author would prefer JSON or Yaml? I used key/value
> directory trees on UMENU2, and as a practical matter they turn out to
> be very tedious to author. Any other ideas besides JSON and Yaml?
>
> Thanks,
>
> SteveT
>
> Steve Litt
> April 2018 featured book: Troubleshooting Techniques
>  of the Successful Technologist
> http://www.troubleshooters.com/techniques
>



-- 
Alan L Tyreehttp://www2.austlii.edu.au/~alan


Re: Recommendations for metadata storage in Stylz

2018-04-01 Thread Shay Riggs
I like Yaml. Easy to read, easy to type, easy for humans to comprehend. I
think I’d prefer it.

You could also have a look at CSS syntax as it’s kind of a halfway house
between Yaml and JSON. Not sure how you’d deal with hierarchical data
though.

My thoughts on JSON are that if you’re going to use it, you might almost as
well go full-bore XML :-) and IMHO entering more than a few lines of XML
(or JSON) is only truly feasible with an autocompleting editor or with a
combination of great discipline and hot coffee.


Shay

On 2 April 2018 at 01:02, Steve Litt  wrote:

> As many of you know, I'm in the middle of creating an authoring format
> called Stylz. You author Stylz docs in any old editor. Think of an
> Asciidoc knockoff which greatly prioritizes styles based authoring at
> the expense of Asciidoc's "we do it all for you."
>
> One of my tasks in order to reach Minimum Viable Product (MVP) status
> is to give the author a way of storing the book's metadata. By metadata
> I mean stuff like author, title, copyright, etc, combined with build
> info like CSS files to be inserted to link styles with their
> appearances in HTML and ePub outputs, or LaTeX layout files (similar to
> those in LyX) to link styles with their appearances in PDF and paper.
> The metadata is not, not, NOT going to be in the .stylz file itself:
> The .stylz file names styles and assumes somebody else will define them.
>
> So I need a format in which the author can put the metadata/buildinfo.
> Because I'm not a fan of dependencies, I right away ruled out mysql,
> Postgres, SQLite or MongoDB. From my perspective, this leaves Yaml,
> JSON, directory trees with leaf filenames being keys and their contents
> being values. Can anyone think of other alternatives?
>
> Do you think an author would prefer JSON or Yaml? I used key/value
> directory trees on UMENU2, and as a practical matter they turn out to
> be very tedious to author. Any other ideas besides JSON and Yaml?
>
> Thanks,
>
> SteveT
>
> Steve Litt
> April 2018 featured book: Troubleshooting Techniques
>  of the Successful Technologist
> http://www.troubleshooters.com/techniques
>


Recommendations for metadata storage in Stylz

2018-04-01 Thread Steve Litt
As many of you know, I'm in the middle of creating an authoring format
called Stylz. You author Stylz docs in any old editor. Think of an
Asciidoc knockoff which greatly prioritizes styles based authoring at
the expense of Asciidoc's "we do it all for you."

One of my tasks in order to reach Minimum Viable Product (MVP) status
is to give the author a way of storing the book's metadata. By metadata
I mean stuff like author, title, copyright, etc, combined with build
info like CSS files to be inserted to link styles with their
appearances in HTML and ePub outputs, or LaTeX layout files (similar to
those in LyX) to link styles with their appearances in PDF and paper.
The metadata is not, not, NOT going to be in the .stylz file itself:
The .stylz file names styles and assumes somebody else will define them.

So I need a format in which the author can put the metadata/buildinfo.
Because I'm not a fan of dependencies, I right away ruled out mysql,
Postgres, SQLite or MongoDB. From my perspective, this leaves Yaml,
JSON, directory trees with leaf filenames being keys and their contents
being values. Can anyone think of other alternatives?

Do you think an author would prefer JSON or Yaml? I used key/value
directory trees on UMENU2, and as a practical matter they turn out to
be very tedious to author. Any other ideas besides JSON and Yaml?

Thanks,

SteveT

Steve Litt 
April 2018 featured book: Troubleshooting Techniques
 of the Successful Technologist
http://www.troubleshooters.com/techniques