All Projects → eneko → Markdowngenerator

eneko / Markdowngenerator

Licence: apache-2.0
Swift library to programmatically generate Markdown output and files

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Markdowngenerator

Sourcedocs
Generate Markdown documentation from source code
Stars: ✭ 286 (+276.32%)
Mutual labels:  markdown, generator
Easybook
Book publishing as easy as it should be (built with Symfony components)
Stars: ✭ 744 (+878.95%)
Mutual labels:  markdown, generator
Github Profile Readme Generator
🚀 Generate GitHub profile README easily with the latest add-ons like visitors count, GitHub stats, etc using minimal UI.
Stars: ✭ 7,812 (+10178.95%)
Mutual labels:  markdown, generator
YMFF
Feature management made easy.
Stars: ✭ 26 (-65.79%)
Mutual labels:  swift-package-manager, swift-framework
Framelayoutkit
FrameLayoutKit is a super fast and easy to use autolayout kit
Stars: ✭ 53 (-30.26%)
Mutual labels:  swift-framework, swift-package-manager
tapestry
Generate and maintain Swift frameworks with support for Cocoapods, Carthage and SPM
Stars: ✭ 64 (-15.79%)
Mutual labels:  swift-package-manager, swift-framework
Verb
HEADS UP! Verb is going though a major transition, we've completely refactored everything from the ground up. If you're interested, please see the dev branch.
Stars: ✭ 442 (+481.58%)
Mutual labels:  markdown, generator
Cgx
💻🔥CLI to generate the recommended documentation/files to improve contribution (Github, Gitlab, CodeCommit and Bitbucket)
Stars: ✭ 190 (+150%)
Mutual labels:  markdown, generator
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-59.21%)
Mutual labels:  swift-framework, swift-package-manager
Taniwhatextfield
My first cocoapod framework
Stars: ✭ 26 (-65.79%)
Mutual labels:  swift-framework, swift-package-manager
MLLineChart
A simple Line Chart Lib
Stars: ✭ 28 (-63.16%)
Mutual labels:  swift-package-manager, swift-framework
Mmarkdown
Interpret mmd fenced code blocks in a markdown file and generate a cooler version of it.
Stars: ✭ 67 (-11.84%)
Mutual labels:  markdown, generator
extensions-kit
📦 Collection of Swift+Apple Frameworks extensions for speeding up software development [iOS & iPadOS].
Stars: ✭ 71 (-6.58%)
Mutual labels:  swift-package-manager, swift-framework
EKAstrologyCalc
Astrology Calculator calculates moon's rise/set times, moon Age, moon phases and Zodiac Sign for location and time
Stars: ✭ 31 (-59.21%)
Mutual labels:  swift-package-manager, swift-framework
Github Profilinator
🚀 This tool contains mini GUI components that you can hook together to automatically generate markdown code for a perfect readme.
Stars: ✭ 225 (+196.05%)
Mutual labels:  markdown, generator
Assemble
Community
Stars: ✭ 3,995 (+5156.58%)
Mutual labels:  markdown, generator
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (+107.89%)
Mutual labels:  markdown, swift-package-manager
Sinn
a blog based on of react,webpack3,dva,redux,material-ui,fetch,generator,markdown,nodejs,koa2,mongoose,docker,shell,and async/await 基于react+koa2技术栈的个人开源博客系统
Stars: ✭ 175 (+130.26%)
Mutual labels:  markdown, generator
Github Changelog Generator
Automatically generate change log from your tags, issues, labels and pull requests on GitHub.
Stars: ✭ 6,631 (+8625%)
Mutual labels:  markdown, generator
Docsify Tabs
A docsify.js plugin for rendering tabbed content from markdown
Stars: ✭ 65 (-14.47%)
Mutual labels:  markdown, generator

MarkdownGenerator

Release Swift 4.0+ Build Status codecov Swift Package Manager Compatible Linux Compatible

A small Swift library to generate Markdown documents.

Features

  • ✅ Easily generate Markdown from structured data
  • ✅ Extendible: make your classes and structs conform to MarkdownConvertible
  • ✅ Swift Package Manager compatible
  • ✅ Linux compatible 🐧

MarkdownConvertible

Types conforming to the MarkdownConvertible protocol can be rendered as a markdown string, by implementing the .markdown computed property.

Out of the box, MarkdownGenerator provides the following Markdown elements:

  • Unordered lists
  • Ordered lists
  • Tables
  • Block-quotes
  • Code Blocks
  • Collapsible Blocks
  • Images
  • Links
  • Headings

Please take a look at the following examples, or read the reference documentation.

Lists

List can be nested to any levels and contain single or multi-line items. Lists can be ordered, unordered, or mixed.

let list = MarkdownList(items: ["🍏", "🍌", "🍊", "🍇"])
print(list.markdown)

Generates the following output:

-   🍏
-   🍌
-   🍊
-   🍇

Which renders as:

  • 🍏
  • 🍌
  • 🍊
  • 🍇

Tables

While Markdown didn't have support for tables originally, most modern Markdown readers (including GitHub) properly render tables nowadays.

let data: [[String]] = [
    ["🍏", "Apple", "Fruits"],
    ["🍊", "Orange", "Fruits"],
    ["🥖", "Bread", "Bakery"],
]
let table = MarkdownTable(headers: ["", "Name", "Department"], data: data)
print(table.markdown)

Generates the following output:

|    | Name   | Department |
| -- | ------ | ---------- |
| 🍏 | Apple  | Fruits     |
| 🍊 | Orange | Fruits     |
| 🥖 | Bread  | Bakery     |

Which renders as:

Name Department
🍏 Apple Fruits
🍊 Orange Fruits
🥖 Bread Bakery

Pretty tables 🎉

Blockquotes

Any MarkdownConvertible content (including String) can be easily .blockquoted.

let input = """
## This is a header.

1.   This is the first list item.
2.   This is the second list item.

Here's some example code:

    return shell_exec("echo $input | $markdown_script");

> This is a quote.
"""

print(input.blockquoted.markdown)

Generates the following output:

> ## This is a header.
>
> 1.   This is the first list item.
> 2.   This is the second list item.
>
> Here's some example code:
>
>     return shell_exec("echo $input | $markdown_script");
>
> > This is a quote.

Which renders as:

This is a header.

  1. This is the first list item.
  2. This is the second list item.

Here's some example code:

return shell_exec("echo $input | $markdown_script");

This is a quote.

Collapsible Blocks

Collapsible blocks look great on GitHub and other Markdown viewers. Great way to provide detailed content without cluttering the output.

let details: [MarkdownConvertible] = [
    MarkdownHeader(title: "Title"),
    MarkdownList(items: ["🐶", "🐱", "🦊"]),
    MarkdownTable(headers: ["Name", "Count"], data: [["Dog", "1"], ["Cat", "2"]]),
    MarkdownCodeBlock(code: "let foo = Bar()", style: .backticks(language: "swift"))
]

print(MarkdownCollapsibleSection(summary: "This is cool stuff", details: details).markdown)

Generates the following output:

<details><summary>This is cool stuff</summary>

# Title

-   🐶
-   🐱
-   🦊

| Name | Count |
| ---- | ----- |
| Dog  | 1     |
| Cat  | 2     |

```swift
let foo = Bar()
```
</details>

Which renders as (click to expand):

This is cool stuff

Title

  • 🐶
  • 🐱
  • 🦊
Name Count
Dog 1
Cat 2
let foo = Bar()

Contact

Follow and/or contact me on Twitter at @eneko.

Contributions

If you find an issue, just open a ticket on it. Pull requests are warmly welcome as well.

License

MarkdownGenerator is licensed under the Apache 2.0 license. See LICENSE for more info.

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