All Projects → vapor-community → leaf-markdown

vapor-community / leaf-markdown

Licence: MIT License
Markdown renderer for Vapor

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to leaf-markdown

Lingo-Vapor
Vapor provider for Lingo - the Swift localization library
Stars: ✭ 45 (-11.76%)
Mutual labels:  vapor, vapor-provider
flash
Flash messages between views ⚡️
Stars: ✭ 34 (-33.33%)
Mutual labels:  vapor, vapor-2
template
A Vapor template for convenient and fast scaffolding 🏎
Stars: ✭ 33 (-35.29%)
Mutual labels:  vapor, vapor-2
fluent-provider
A provider for including Fluent in Vapor applications
Stars: ✭ 13 (-74.51%)
Mutual labels:  vapor, vapor-provider
mysql-provider
MySQL provider for the Vapor web framework.
Stars: ✭ 31 (-39.22%)
Mutual labels:  vapor, vapor-provider
bugsnag
Report errors with Bugsnag 🐛
Stars: ✭ 37 (-27.45%)
Mutual labels:  vapor, vapor-2
wkhtmltopdf
Generate and return PDFs from Vapor views
Stars: ✭ 53 (+3.92%)
Mutual labels:  vapor, vapor-provider
VaporGCM
A simple Android GCM/FCM library for Swift/Vapor
Stars: ✭ 25 (-50.98%)
Mutual labels:  vapor, vapor-provider
paginator
Offset pagination for Vapor 🗂
Stars: ✭ 67 (+31.37%)
Mutual labels:  vapor, vapor-2
sendgrid
SendGrid-powered mail backend for Vapor
Stars: ✭ 66 (+29.41%)
Mutual labels:  vapor, vapor-provider
sourcery-templates
Building Vapor projects using meta programming with Sourcery ✨
Stars: ✭ 24 (-52.94%)
Mutual labels:  vapor, vapor-2
Stevenson
Stevenson is a Vapor framework designed to build integrations between Slack apps, GitHub, JIRA and CI services (CircleCI).
Stars: ✭ 57 (+11.76%)
Mutual labels:  vapor
auth
👤 Authentication and Authorization framework for Fluent.
Stars: ✭ 51 (+0%)
Mutual labels:  vapor
VaporElasticsearch
A Vapor/Swift Elasticsearch client
Stars: ✭ 26 (-49.02%)
Mutual labels:  vapor
SwiftString
A comprehensive, lightweight string extension for Swift 3.x & 4.0
Stars: ✭ 117 (+129.41%)
Mutual labels:  vapor
leaf-kit
No description or website provided.
Stars: ✭ 32 (-37.25%)
Mutual labels:  vapor
ferno
Vapor Firebase Realtime database provider
Stars: ✭ 52 (+1.96%)
Mutual labels:  vapor
bcrypt
Swift implementation of the BCrypt password hashing function
Stars: ✭ 30 (-41.18%)
Mutual labels:  vapor
Lingo
Powerful Swift string localization library with support for pluralization and string interpolation.
Stars: ✭ 55 (+7.84%)
Mutual labels:  vapor
submissions
Provides a common structure to deal with data based API requests
Stars: ✭ 15 (-70.59%)
Mutual labels:  vapor

Leaf Markdown

Language Build Status codecov GitHub license

A Markdown renderer for Vapor and Leaf. This uses the Vapor Markdown package to wrap cmark (though a fork is used to make it work with Swift PM), so it understands Common Mark. A quick reference guide for Common Mark can be found here. It also supports Github Flavored Markdown.

Usage

Once set up, you can use it in your Leaf template files like any other tag:

#markdown(myMarkdown)

Where you have passed myMarkdown into the view as something like:

# Hey #

Check out my *awesome* markdown! It is easy to use in `tags`

Setup

Add as dependency

Add Leaf Markdown as a dependency in your Package.swift file:

    dependencies: [
        ...,
        .package(name: "LeafMarkdown", url: "https://github.com/vapor-community/leaf-markdown.git", .upToNextMajor(from: "3.0.0")),
    ]

Then add the dependency to your target:

.target(
    name: "App",
    dependencies: [
        // ...
        "LeafMarkdown"
    ],
    // ...
)

Register with Leaf

Register the tag with Leaf so Leaf knows about it:

app.leaf.tags["markdown"] = Markdown()

Don't forget to import LeafMarkdown in the file you register the tag with import LeafMarkdown.

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].