AttribCheckLayout checks and converts layout attribute
(b *Builder, am map[string]interface{}, fname string)
| 719 | |
| 720 | // AttribCheckLayout checks and converts layout attribute |
| 721 | func AttribCheckLayout(b *Builder, am map[string]interface{}, fname string) error { |
| 722 | |
| 723 | v := am[fname] |
| 724 | if v == nil { |
| 725 | return nil |
| 726 | } |
| 727 | msi, ok := v.(map[string]interface{}) |
| 728 | if !ok { |
| 729 | return b.err(am, fname, "Not a map") |
| 730 | } |
| 731 | lti := msi[AttribType] |
| 732 | if lti == nil { |
| 733 | return b.err(am, fname, "Layout must have a type") |
| 734 | } |
| 735 | lfunc := b.layouts[lti.(string)] |
| 736 | if lfunc == nil { |
| 737 | return b.err(am, fname, "Invalid layout type") |
| 738 | } |
| 739 | return nil |
| 740 | } |
| 741 | |
| 742 | // AttribCheckAlign checks and converts layout align* attribute |
| 743 | func AttribCheckAlign(b *Builder, am map[string]interface{}, fname string) error { |