command-line-interface-pages / v2-tooling

Tools for handling v2.*.* syntax
6 stars 3 forks source link

Add a converter from YAML/TOML to CLIP pages #21

Closed EmilyGraceSeville7cf closed 1 year ago

EmilyGraceSeville7cf commented 1 year ago

And create JSON schema for YAML files. I think it's a nice addition as it's one of the simplest ways to provide intellisence while writing pages.

They could look like this:

command: am
summary:
  description: Android activity manager
  more-information: https://developer.android.com/studio/command-line/adb#am
examples:
  - description: Start a specific activity
    code: "am start -n {string activity: com.android.settings/.Settings}"
  - description: Start an activity and pass [d]ata to it
    code: "am start -a {string activity: android.intent.action.VIEW} -d {string data: tel:123}"
  - description: Start an activity matching a specific action and [c]ategory
    code: "am start -a {string activity: android.intent.action.MAIN} -c {string category: android.intent.category.HOME}"
  - description: Convert an intent to a URI
    code: "am to-uri -a {string activity: android.intent.action.VIEW} -d {string data: tel:123}"

or this in TOML:

command = "am"

[summary]
description = "Android activity manager"
more-information = "https://developer.android.com/studio/command-line/adb#am"

[[examples]]
description = "Start a specific activity"
code = "am start -n {string activity: com.android.settings/.Settings}"

[[examples]]
description = "Start an activity and pass [d]ata to it"
code = "am start -a {string activity: android.intent.action.VIEW} -d {string data: tel:123}"

[[examples]]
description = "Start an activity matching a specific action and [c]ategory"
code = "am start -a {string activity: android.intent.action.MAIN} -c {string category: android.intent.category.HOME}"

[[examples]]
description = "Convert an intent to a URI"
code = "am to-uri -a {string activity: android.intent.action.VIEW} -d {string data: tel:123}"
EmilyGraceSeville7cf commented 1 year ago

@kbdharun, @Lereena, what do u think about such addition?

EmilyGraceSeville7cf commented 1 year ago

I think that this converter is useless. It's better to introduce fully-fledged YAML-based syntax for CLIP pages and make everything support it.