Download Padre

Padre::Plugin::YAML

YAML plug-in that provides background syntax checking
  • By using YAML::XS we get great feedback ( Binding to libyaml, "C" Fast YAML 1.1 )
  • win32 user's will need to use YAML due to issue with YAML::XS on win32

Usage

  • install Padre::Plugin::YAML
  • enable in Tools -> Plug-in Manager
  • make sure you have checked Show-Syntax-Check in View menu, you should have a Syntax Panel visible in lower part of screen

Limitations

directives are supported only for the %YAML 1.1 or none
%YAML 1.1
# --- document separator
---
plack_middlewares:
  -
    - Expires
    - Deflater
    - StackTrace
    - Debug
    - panels
    -
      - Parameters
      - Dancer::Version
      - Dancer::Settings
      - Memory
      - PerlConfig
      - DBITrace 
      - ModuleVersions
...
# comments like so
---
rootproperty: blah
section:
  one: two
  three: four
  Foo: Bar
  empty: ~
# ... indicate the end of a document
...

Another example

%YAML 1.1
---
 - - item 1
   - item 2
 - key 1: value 1
   key 2: value 2
 - ? complex key
   : complex value
...

Links

Formal on line validation the only one so far, I have found that works :)

Debugging

Use the following to track down "Unknown YAML error" displayed in Syntax Panel.
perl dev -a -t Padre::Plugin::YAML::Syntax

To-Do

* release version 0.04 after Padre 0.96, due to dependencies issues * tidy up code * syntax panel dose not show a green square when clean