Page MenuHomePhabricator

docs: Shiki transforms code on its own terms
Open, Needs TriagePublic

Description

Status

Shiki seems to transform code on its own terms, to its own rules

Example 'icon.md'

@import ( reference ) '@wikimedia/codex/mixins/css-icon.less';

.cdx-demo-css-icon {
	&--tag {
		.cdx-mixin-css-icon( @cdx-icon-tag );
	}

	&--map-pin {
		.cdx-mixin-css-icon( @cdx-icon-map-pin );
	}
}
@import (reference) "@wikimedia/codex/mixins/css-icon.less";

.cdx-demo-css-icon {
  &--tag {
    .cdx-mixin-css-icon(@cdx-icon-tag);
  }

  &--map-pin {
    .cdx-mixin-css-icon(@cdx-icon-map-pin);
  }
}

image.png (536×1 px, 69 KB)

Goal

To make it simpler for Wikiverse developers to work with our code examples, the code should be presented in Wikimedia coding style.

Event Timeline

Catrope renamed this task from docs: Prism transforms code on its own terms to docs: Shiki transforms code on its own terms.Feb 24 2023, 4:13 AM
Catrope updated the task description. (Show Details)


It looks like this only happens when code is wrapped in a ```less or ```css block. The formatter for ```vue is much less opinionated, and just breaks lines that are too long.