Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SpectralDragon/CodeSyntaxCSSGeneratorPlugin
A Publish plugin that generates a syntax code css styles for you Splash Plugin from Xcode Color Theme.
https://github.com/SpectralDragon/CodeSyntaxCSSGeneratorPlugin
css dark-theme publish publish-plugin splash swift syntax-highlighting xcode
Last synced: about 2 months ago
JSON representation
A Publish plugin that generates a syntax code css styles for you Splash Plugin from Xcode Color Theme.
- Host: GitHub
- URL: https://github.com/SpectralDragon/CodeSyntaxCSSGeneratorPlugin
- Owner: SpectralDragon
- Created: 2020-04-13T01:35:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-08T22:42:46.000Z (over 1 year ago)
- Last Synced: 2024-08-02T07:02:06.475Z (5 months ago)
- Topics: css, dark-theme, publish, publish-plugin, splash, swift, syntax-highlighting, xcode
- Language: Swift
- Homepage:
- Size: 6.84 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-publish - Code Syntaxt CSS
README
# CodeSyntaxCSSGeneratorPlugin
A [Publish](https://github.com/johnsundell/publish) plugin that generates a syntax code css styles for you [Splash Plugin](https://github.com/johnsundell/splashpublishplugin) from Xcode Color Theme.
[![Swift 5.1](https://img.shields.io/badge/Swift-5.1-orange.svg?style=flat)](https://swift.org/)
[![Publish](https://img.shields.io/badge/Publish-blue.svg?style=flat)](https://github.com/johnsundell/publish)## Install
To install it into your [Publish](https://github.com/johnsundell/publish) package, add it as a dependency within your `Package.swift` manifest:
```swift
let package = Package(
...
dependencies: [
...
.package(url: "https://github.com/SpectralDragon/CodeSyntaxCSSGenerator.git", from: "0.1.0")
],
targets: [
.target(
...
dependencies: [
...
"CodeSyntaxCSSGeneratorPlugin"
]
)
]
...
)
```## Usage
Move `dvtcolortheme` or `xccolortheme` file to Resource dirictory and intall the plugin in any place in build step.
```swift
// My xcode theme `Light.dvtcolortheme`
import CodeSyntaxCSSGeneratorPlugin
Site().publish(using: [
.installPlugin(
.generateCodeCSS(withClassPrefix: "pre code .s-",
theme: .xcode("Light.dvtcolortheme"))
),
])
```after that, the plugin will generate `codesyntax.css` file
```css
pre code .s-preprocessing {
color: #63381FFF
}pre code .s-comment {
color: #007400FF
}pre code .s-number {
color: #1C00CEFF
}pre code .s-call {
color: #25464AFF
}pre code .s-property {
color: #3E6D74FF
}pre code .s-keyword {
color: #A90D91FF
}pre code .s-dotAccess {
color: #25464AFF
}pre code .s-type {
color: #3E6D74FF
}pre code .s-string {
color: #C41A15FF
}
```Also plugin can generate css to dark scheme, just use `CodeTheme.dynamic(light: CodeTheme, dark: CodeTheme)` case. The plugin add `@media(prefers-color-scheme: dark)` with passed code theme.
# Features
- [ ] intellij theme
- [ ] VSCodeThank you and enjoy 💯