beaknit / cform

SublimeText plugin for CloudFormation
Apache License 2.0
103 stars 34 forks source link

Autogenerate snippets from documentation #34

Open dgomesbr opened 8 years ago

dgomesbr commented 8 years ago

The documentation contained here have a topic list of the resources that can be used to build up the snippets.

By build an index with //*[@id="main-col-body"]/div[2]/div[2]/ul we can leverage all the revelant links to keep the snippets updated with the current docs.

dgomesbr commented 8 years ago

This one is linked with #27

nathanatluminal commented 8 years ago

Absolutely love it! Nicely done. :-)

One question & One issue (didn't see an issues link on your github fork):

  1. Got this when I ran it for the first time:
(cform) ➜  build git:(master) python build-snippets.py
creating AWS::ApiGateway::Account => apigateway-account
Traceback (most recent call last):
  File "build-snippets.py", line 84, in <module>
    main()
  File "build-snippets.py", line 80, in main
    generate(index)
  File "build-snippets.py", line 41, in generate
    writeToOutput(title, snippet)
  File "build-snippets.py", line 72, in writeToOutput
    out = file(filename, 'w')
IOError: [Errno 2] No such file or directory: u'./output/`

Would you mind adding an isdir() & mkdir() to just smooth out the creation of "output"?

  1. Also: Do the snippets need to moved to the root of the package or are you thinking we remove the top-level snippets and have Sublime pick up the snippets in the build/output dir?
dgomesbr commented 8 years ago

Hey @nathanatluminal, thanks for the input. Regarding the first, yes, this is missing and also the parameter interpolation $2, $3, $4, I couldn't come up with something great to do that diff than re.sub everything.

Regarding the later, I'm thinking about just let everything on the output. Is there any thing I have to change to sublime pick it up or we should change instructions?

What do you think about that?

dgomesbr commented 8 years ago

@nathanatluminal ping?

beaknit commented 8 years ago

Hey, man! So sorry I haven't had time to look at this. We've launched our product and I've been traveling. It's near the top of my to-do list. I'll hit you up as soon as possible.

On Sun, Aug 14, 2016 at 10:24 PM, Diego Magalhães notifications@github.com wrote:

@nathanatluminal https://github.com/nathanatluminal ping?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/beaknit/cform/issues/34#issuecomment-239716907, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOHHL0bUeQpOS9XMR5GUr_SV2V72jDFks5qf83WgaJpZM4JaIvc .

I am jack's complete lack of surprise . . .