All Projects → TokamakUI → TokamakPublish

TokamakUI / TokamakPublish

Licence: Apache-2.0 license
Use Tokamak in your Publish themes.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to TokamakPublish

99StocksSwiftUI
SwiftUI app that fetches a list of companies, sort them by their share price and can show its details on a separate view
Stars: ✭ 34 (+78.95%)
Mutual labels:  swiftui
statiq-starter-kontent-lumen
Lumen is a minimal, lightweight, and mobile-first starter for creating blogs using Statiq and Kontent by Kentico.
Stars: ✭ 22 (+15.79%)
Mutual labels:  static-site
WWDCNotes
WWDCNotes.com content
Stars: ✭ 343 (+1705.26%)
Mutual labels:  swiftui
figma-preview-swiftui
Figma component preview for your SwiftUI views
Stars: ✭ 51 (+168.42%)
Mutual labels:  swiftui
haxeflixel.com
haxeflixel.com docpad source
Stars: ✭ 57 (+200%)
Mutual labels:  static-site
MultiplatformPlayground
Kotlin Multiplatform project in Jetpack Compose & SwiftUI with shared ViewModel layer and File upload
Stars: ✭ 72 (+278.95%)
Mutual labels:  swiftui
MultiModal
Use multiple .sheet, .alert, etc. modifiers in the same SwiftUI View
Stars: ✭ 49 (+157.89%)
Mutual labels:  swiftui
kavsoft-swiftui-animations
SwiftUI animation tutorials, all of demos are consisted of youtube videos at website of kavsoft. 🔗 https://kavsoft.dev
Stars: ✭ 205 (+978.95%)
Mutual labels:  swiftui
CodeEditorView
SwiftUI code editor view for iOS and macOS
Stars: ✭ 461 (+2326.32%)
Mutual labels:  swiftui
SAAS
🤣🔫Sicko Mode as a service
Stars: ✭ 21 (+10.53%)
Mutual labels:  static-site
o-fish-ios
iOS app for the Officer's Fishery Information Sharing Hub (O-FISH). The mobile app allows fisheries officers to document and share critical information gathered during a routine vessel inspection.
Stars: ✭ 28 (+47.37%)
Mutual labels:  swiftui
Windows11
💻 Windows 11 in SwiftUI.
Stars: ✭ 177 (+831.58%)
Mutual labels:  swiftui
SwiftUICalculator
A calculator app using SwiftUI which is introduced in WWDC19
Stars: ✭ 33 (+73.68%)
Mutual labels:  swiftui
wp-trigger-netlify-build
A WordPress plugin to automatically rebuild a Netlify site when content is updated.
Stars: ✭ 80 (+321.05%)
Mutual labels:  static-site
AVPlayer-SwiftUI
Using AVPlayer in SwiftUI
Stars: ✭ 204 (+973.68%)
Mutual labels:  swiftui
Relay.swift
Relay for GraphQL, ported to Swift and SwiftUI
Stars: ✭ 58 (+205.26%)
Mutual labels:  swiftui
SwiftUIDrag
A simple, customizable, and intuitive SwiftUI wrapper-view enabling dragging, floating, and/or collapsing for its content.
Stars: ✭ 42 (+121.05%)
Mutual labels:  swiftui
you-draw-it
Datenjournalismus: Nutzer können schätzen, wie sich Statistiken verändert haben und ihre Einschätzung danach überprüfen.
Stars: ✭ 24 (+26.32%)
Mutual labels:  static-site
nuxt-static
Generate a static site using Nuxt.js
Stars: ✭ 31 (+63.16%)
Mutual labels:  static-site
iOS-App
🕹️ iOS application of HardcoreTap game
Stars: ✭ 17 (-10.53%)
Mutual labels:  swiftui

TokamakPublish

Use Tokamak in your themes for the Publish static generator.

You can either write your entire theme with Tokamak, or integrate it with your existing Plot HTML.

A Tokamak implementation of the .foundation theme is provided under the name .tokamakFoundation.

TokamakHTMLFactory

To make your own Tokamak theme, conform to the TokamakHTMLFactory protocol. That requires the following functions:

struct MyThemeFactory<Site: Website>: TokamakHTMLFactory {
  func makeIndexView(for index: Index, context: PublishingContext<Self.Site>) throws -> IndexView
  func makeSectionView(
    for section: Publish.Section<Self.Site>,
    context: PublishingContext<Self.Site>
  ) throws -> SectionView
  func makeItemView(for item: Item<Self.Site>, context: PublishingContext<Self.Site>) throws -> ItemView
  func makePageView(for page: Page, context: PublishingContext<Self.Site>) throws -> PageView
  func makeTagListView(for page: TagListPage, context: PublishingContext<Self.Site>) throws -> TagListView
  func makeTagDetailsView(for page: TagDetailsPage, context: PublishingContext<Self.Site>) throws -> TagDetailsView
}

In these functions, you can build a View with SwiftUI-compatible syntax:

struct MyThemeFactory<Site: Website>: TokamakHTMLFactory {
  func makePageView(for page: Page, context: PublishingContext<Self.Site>) throws -> PageView {
    Text("Welcome to my website")
      .font(.largeTitle)
    VStack(alignment: .leading) {
      page.body
    }
      .frame(idealWidth: 820, maxWidth: 820)
      .padding(.vertical, 40)
    Text("2020 © Tokamak Contributors")
      .font(.caption)
  }
  ...
}

Plot integration

You can include Tokamak views in your Plot HTML with the view Node:

let myHTML = Plot.HTML(
  .body(
    .h1(.text("My Website")),
    .view {
      Text("This is a Tokamak ") + Text("View")
        .font(.system(.body, design: .monospaced))
    },
    .view(MyTokamakView())
  )
)

You can include Plot nodes in your Tokamak views just as easily:

struct ContentView: View {
  var body: some View {
    Text("My Website")
      .font(.largeTitle)
    Node.p(
      .span("This is a Plot "),
      .span(.text("Node"), .style("font-family: monospace"))
    )
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].