Coder Social home page Coder Social logo

libyaml-glib's Introduction

yaml-glib - Building GObject from YAML

Travis Status

https://travis-ci.org/rainwoodman/libyaml-glib.svg?branch=master

Introduction

yaml-glib is the GLib binding of libyaml, plus a GObject builder that understands YAML.

Source

The source code is hosted at github:

$ git clone git://github.com/fengy-research/libyaml-glib.git

No released tarball is available currently.

Dependencies

  • glib2 >= 2.10 GLib and GObject
  • valac >= 0.7.2 Vala compiler
  • libyaml == 0.1.2 YAML 1.1 parser
    built into the source tree, considering its current availability.

Install

The header files and libraries of libyaml are also installed.

  1. Direct install (on most distributions)
$ ./autogen.sh --prefix=/usr
$ make
$ make install

2. Build RPM and install from the rpm
$ ./autogen.sh
$ make
$ make dist

The next step either requires your rpmdevtree is properly setup

$ rpmbuild -ta yaml-glib-0.1.tar.gz
Or you can build the rpm with easybuild
(obtained from http://github.com/fengy-research/easybuild)
$ easybuild -ba yaml-glib.spec

And the built RPMs will be in the current directory:

$ ls *.rpm
yaml-glib-0.1-5.i386.rpm  yaml-glib-debuginfo-0.1-5.i386.rpm
yaml-glib-0.1-5.src.rpm   yaml-glib-devel-0.1-5.i386.rpm

Install the package with

$ su -c 'rpm -U yaml-glib-0.1-5.i386.rpm \
  yaml-glib-debuginfo-0.1-5.i386.rpm \
  yaml-glib-devel-0.1-5.i386.rpm'

Example

test/example-invoice.vala is an example of an invoice printer. Example data is in test/invoice.yaml. Feed the data to the standard input of example-invoice. The program will then parse and build the invoice, then rewrite the model back to standard output.

Notice how PaypalAddress is extended to the original Model namespace, also how structs and enums are processed.

The invoice data is modified from the standard YAML example.

Documentation

The documenation can be compiled from valadoc, if a valadoc compiler is available. No documentation is installed. It is recommended to turn off the documentation with --disable-valadoc all the time until valadoc is stable.

libyaml-glib's People

Contributors

arteymix avatar rainwoodman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

libyaml-glib's Issues

Make libyaml-glib more convenient

Here's a few ideas to make libyaml-glib more convenient:

  • make libyaml a private dependency
  • wrap all the libyaml enums/flags with introspectable ones
  • add more helper functions
  • consider Scalar -> GValue?
  • some GIO integration for the parser/generator
  • submit docs to valadoc.org (see https://github.com/nemequ/vala-girs repository)
  • consider Meson?
  • add more thorough tests

I can work a bit on improving APIs and add more user-friendly utilities. I think that JSON-GLib is a good reference, though we could be more Vala-friendly.

Meson is really nice and they have an excellent support for Vala. With subproject, it would become a piece of cake to use it by just cloning the code.

Using docker based travis.

Rebuild will be scheduled faster.
We currently need the valateam channel. I wonder how far we can go with the packages preapproved on travis.

Compilation failed with vala 0.7.5

Hi,

The compilation failed with vala 0.7.5:

libvalide/libyaml-glib/src/builder.vala:334.36-334.40: error: The type name Boxed' could not be found libvalide/libyaml-glib/src/writer.vala:132.36-132.40: error: The type nameBoxed' could not be found

The GLib.Boxed type was removed.

Flags support

Is the annotation [Flags] still available in Vala?

The flag operations:
() | & ~

For now probably only implementing "|" will be sufficient. The program can always convert the flags to "|", and that is what glib does with g_flags_xxx anyways.

Ignore property

Is it possible to mark a property as ignored? I'd like not to save it.

fails to build docs with valadoc 0.42.3

/usr/bin/valadoc --force  -o Documentation --package-name libyaml-glib-1.0 libyaml-glib.vala error.vala buildable.vala builder.vala loader.vala writer.vala yaml-0.1.vapi --pkg gmodule-2.0
buildable.vala:146.6-146.9: error: expected <end-of-line>
   * the returned List doesn't hold references to the children.
     ^^^                                                        
libyaml-glib.vala:185.5-185.6: error: unexpected token: <space>
  *  This is not a full implementation of a YAML document.
    ^                                                      
builder.vala:40.5-40.6: error: unexpected token: <space>
  *   an object is created for each mapping which has a YAML tag
    ^                                                            
builder.vala:186.6-186.7: error: unexpected token: <space>
   *   Do not call this function in any places other than 
     ^                                                     
libyaml-glib.vala:72.6-72.7: error: unexpected token: <space>
   *  * For Alias it is the referring anchor,
     ^                                        
libyaml-glib.vala:89.19-89.20: error: unexpected token: <end-of-line>
   * @param notify
                  ^
Failed: 6 error(s), 0 warning(s)

Apparently the new valadoc does not like newlines.

example-invoice.vala crashes.

It crashes on model etc. I don't know why.

run with libtool --mode=execute gdb example-invoice

run < invoice.yaml.

Dies around a postal object. gvalue seems to be empty.

Unknown type names with vala 0.30.2

These types are not found when compiled with vala 0.30.2.

YAMLEventData, YAMLEventMappingStart, YAMLEventSequenceStart
They look like dummy types defined in the vapi file. Was there anything that I missed? @arteymix ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.