Commit ff51b0df authored by Paul Asmuth's avatar Paul Asmuth
Browse files

update the layout/box documentation

parent 600ec7d8
Loading
Loading
Loading
Loading
+9 −59
Original line number Diff line number Diff line
@@ -312,65 +312,6 @@ properties:
          legend (items ("My Data"))


  - title: "Style Options"
    anchor: style-options
    properties:
      - name: background
        desc: |
          Set the element's background fill/color. See the [fill-style](#FIXME) page
          for more details on valid values.
        desc_code: |
          background <fill-style>
        examples: |
          ;; set the background color to grey
          background #eee
      - name: margin
        desc: |
          Set the element's top/right/bottom/left margins. See the [measure](#FIXME) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the margin to 2em
          margin 2em
      - name: margin-top
        desc: |
          set the element's top margin. see the [measure](#fixme) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the top margin to 2em
          margin 2em
      - name: margin-right
        desc: |
          set the element's right margin. see the [measure](#fixme) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the right margin to 2em
          margin 2em
      - name: margin-bottom
        desc: |
          set the element's bottom margin. see the [measure](#fixme) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the bottom margin to 2em
          margin 2em
      - name: margin-left
        desc: |
          set the element's left margin. see the [measure](#fixme) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the left margin to 2em
          margin 2em


  - title: "Extra Elements"
    anchor: extra-options
    properties:
@@ -399,3 +340,12 @@ properties:
          Add custom elements to the 'left' viewport of the chart
        desc_code: |
          left (<elements>)


  - title: "Layout Options"
    anchor: layout-options
    inherit: ["elements/layout/box", "layout-options"]

  - title: "Background Options"
    anchor: background-options
    inherit: ["elements/layout/box", "background-options"]
+68 −0
Original line number Diff line number Diff line
name: layout/box
desc: |
  The layout/box element is the basic box layout element.
reference: |
  (layout/box <options>)

properties:
  - title: "Layout Options"
    anchor: layout-options
    properties:
      - name: margin
        desc: |
          Set the element's top/right/bottom/left margins. See the [measure](#FIXME) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the margin to 2em
          margin 2em
      - name: margin-top
        desc: |
          Set the element's top margin. see the [measure](#fixme) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the top margin to 2em
          margin 2em
      - name: margin-right
        desc: |
          Set the element's right margin. see the [measure](#fixme) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the right margin to 2em
          margin 2em
      - name: margin-bottom
        desc: |
          Set the element's bottom margin. see the [measure](#fixme) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the bottom margin to 2em
          margin 2em
      - name: margin-left
        desc: |
          Set the element's left margin. see the [measure](#fixme) page
          for more details on valid values.
        desc_code: |
          margin <measure>
        examples: |
          ;; set the left margin to 2em
          margin 2em

  - title: "Background Options"
    anchor: background-options
    properties:
      - name: background
        desc: |
          Set the element's background fill/color. See the [fill-style](#FIXME) page
          for more details on valid values.
        desc_code: |
          background <fill-style>
        examples: |
          ;; set the background color to grey
          background #eee
+9 −1
Original line number Diff line number Diff line
@@ -41,7 +41,15 @@ def build_elem_page(elem_file):
      "properties": []
    }

    for prop in section["properties"]:
    section_props = section.get("properties", [])
    if "inherit" in section:
      section_inherit_path = section["inherit"][0] + "_ref.yaml"
      if os.path.exists(section_inherit_path):
        for section_inherit in yaml.load(open(section_inherit_path))["properties"]:
          if section_inherit["anchor"] == section["inherit"][1]:
            section_props += section_inherit["properties"]

    for prop in section_props:
      section_new["properties"].append(load_prop(prop))
    props_new.append(section_new)