Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow YAML format for .netkans #40

Merged
merged 1 commit into from
Jun 20, 2021

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented May 17, 2021

Motivation

See KSP-CKAN/CKAN#3367, we might want to allow .netkans to use YAML format. If so, the metadata-webtool should take advantage of it by generating YAML.

Changes

  • The JS-YAML library is loaded (its functions go into jsyaml)
  • JSON.stringify is replaced with jsyaml.dump
  • JSON.parse is replaced with jsyaml.load

This will make the webtool generate YAML if merged.

@DasSkelett
Copy link
Member

spec_version: v1.16
identifier: 4kSPExpanded
license: MIT
$kref: '#/ckan/spacedock/2554'
resources:
  homepage: >-
    https://forum.kerbalspaceprogram.com/index.php?/topic/197794-18x-19x-110x-4ksp-expanded/
  repository: https://github.com/linuxgurugamer/4ksp_Expanded
conflicts:
  - name: 4kSP
depends:
  - name: ToolbarControllerClickThroughBlocker
x_via: Generated by Metadata Webtool

Heh, I think we can avoid the conversion to multi-line strings for the homepage with the lineWidth option:
https://github.com/nodeca/js-yaml#dump-object---options-

Question is to what value, multi-line strings might be handy for hard-coded abstracts. 120, maybe?

@HebaruSan
Copy link
Member Author

Works better with a truncated URL:

spec_version: 1
identifier: 4kSPExpanded
abstract: >-
  4kSP scales the map elements corresponding to the stock UI scale setting

  4kSP scales the map elements corresponding to the stock UI scale setting. The
  UI scale slider can be found under Settings > General > UI-Scale. There is
  also a small window which you can chagne the sizes while the mapview is being
  displayed

  4kSP scales the map elements corresponding to the stock UI scale setting. The
  UI scale slider can be found under Settings > General > UI-Scale. There is
  also a small window which you can chagne the sizes while the mapview is being
  displayed

  4kSP scales the map elements corresponding to the stock UI scale setting. The
  UI scale slider can be found under Settings > General > UI-Scale. There is
  also a small window which you can chagne the sizes while the mapview is being
  displayed
license: MIT
$kref: '#/ckan/spacedock/2554'
resources:
  homepage: https://forum.kerbalspaceprogram.com/index.php?/topic/197794-*
  repository: https://github.com/linuxgurugamer/4ksp_Expanded
conflicts:
  - name: 4kSP
depends:
  - name: ToolbarController
  - name: ClickThroughBlocker
x_via: Generated by Metadata Webtool

I suppose this mildly encourages shorter URLs, but if not, we can always edit to taste in the NetKAN PR.

Question is to what value, multi-line strings might be handy for hard-coded abstracts. 120, maybe?

If we're going to have a characters-per-line limit (and I think we should), the default of 80 makes sense to me. It's widely supported and historically grounded, and makes for relatively comfortable reading.

@DasSkelett
Copy link
Member

I suppose this mildly encourages shorter URLs, but if not, we can always edit to taste in the NetKAN PR.

Fair enough

Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appears to work the way it should

@HebaruSan HebaruSan merged commit 667f575 into KSP-CKAN:master Jun 20, 2021
@HebaruSan HebaruSan deleted the feature/yaml-netkan branch June 20, 2021 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants