markdown-playgrounds

A Markdown Editor that can execute Swift code
授权协议 MIT License
开发语言 Swift
所属分类 开发工具、 程序文档工具
软件类型 开源软件
地区 不详
投 递 者 易炳
操作系统 OS X
开源组织
适用人群 未知
 软件概览

�� Markdown Playgrounds for Swift

Swift 5 Swift Package Manager compatible @objcio

What it does

This app reads and writes Markdown documents that contain Swift code. The code can be executed too! You can run individual code blocks, or all the blocks in a file.

We're using this app to update our book Advanced Swift, and while writing blog posts. We find it very useful, and we hope you do too.

How it works

The app works by sending Swift code to a REPL instance, then reading back the results. Compared to Swift Playgrounds or Xcode's playgrounds, this is quite limiting, but it also means we can keep things simple.

Screen Shot 2019-04-02 at 12 51 40

Learn more

We're documenting the building of this app on Swift Talk, a weekly video series of conversational live-coding hosted by Chris Eidhof and Florian Kugler.

video cover

The first episode previews the app, and is free to watch.

Building

Note: currently this builds, but doesn't run from Xcode. Instead, build and run from the command line.

  • You need to have cmark installed from master (not via homebrew). If you use the version from homebrew, you won't get proper syntax highlighting (specifically: for inline elements).
  • This project uses Swift Package Manager. You can either run "swift build" or do "swift package generate-xcodeproj"

Here are the steps as shell commands:

git clone https://github.com/commonmark/cmark
cd cmark
mkdir build
cd build
cmake ..
make
make test
make install
cd ../..

# Building this project
git clone https://github.com/objcio/markdown-playgrounds
cd markdown-playgrounds
swift build

# If you want to edit this in Xcode
swift package generate-xcodeproj
xed .

Future Direction

This project could head in a number of directions, and there are many useful features we could add. Our main goal is to keep using this for authoring Swift-heavy Markdown, which will guide our decisions when we decide on new features.

To keep things simple, we have collected a list of todos in todo.txt.

License

This library is released under the MIT license. See LICENSE for details.

 相关资料
  • GitBook 預設使用 Markdown 標記語法。 本章內容僅快速呈現 Markdown 的基本語法與呈現,若需要更詳細的解說,英文資源可以看看發明人的說明: John Gruber's original spec 以及 GitHub 的擴充版 Github-flavored Markdown info page。Markdown.tw 有不錯的中文詳解;想看看俗稱 GFM - GitHub

  • 更改历史 * 2017-11-17 高天阳 标准化文档内容 * 2017-09-08 高天阳 初始化文档 1 历史、现状和发展 Markdown 是一个 Web 上使用的文本到HTML的转换工具,可以通过简单、易读易写的文本格式生成结构化的HTML文档。 Markdown 的目标是实现「易读易写」。 Markdown具有一系列衍生版本,用于扩展Markdown的功能(如

  • markdown 在模板中插入Markdown代码。使用{{# markdown}}Helper很简单: <div class="my-div"> {{#markdown}} # My heading Some paragraph text {{/markdown}} </div> 确保你的markdown缩进正确。

  • Markdown 是一个 Web 上使用的文本到HTML的转换工具,可以通过简单、易读易写的文本格式生成结构化的HTML文档。目前 Stackoverflow 网站使用这种格式来提问。 一个文本实例: ### Header 3 > This is a blockquote. > > This is the second paragraph in the blockquote. > > ## Thi

  • 来源:Markdown+Pandoc,打通写作界的任督二脉! Markdown+Pandoc,可以把自己的写作内容,变成世界上已有的任何格式的文件,包括很炫的slide,html5。没有人(或者我没看到)总结过这些内容,导致我走了很多弯路才最终打通任督二脉,特此纪念。 了解Markdwon以后,我的写作世界,只有它;看到Pandoc格式转换以后,对生成的slide和pdf羡慕的不行。那时,自己期望

  • 来源:Markdown写作浅谈 科技写作与Markdown+R 科技写作会碰到什么难题? 如果你是纯文科生,写的都是豆瓣小酸文或者诗歌之类的,那么,看完上面这一部分就可以打住了。如果你还有写科技论文的需要,则继续往下看。 科技写作与文艺写作的不同主要有: 公式与图表:相信各位写过科学论文的,都会为数学公式与各类图表的输出头疼不已; 格式转换:pdf是通用的,但是有时偏偏需要LaTeX原始格式或者W

  • 使用Gitbook制作电子书 Gitbook是一个命令行工具,可以把你的Markdown文件汇集成电子书,并提供PDF等多种格式输出。你可以把Gitbook生成的HTML发布出来,就形成了一个简单的静态网站。Gitbook还有一个同名的平台(gitbook.io),可以发布和销售电子书,并提供了一个Markdown客户端工具(支持Mac、Windows和Linux)帮助写作。以下是我在使用Gitb

  • 主页: Cmd Markdown 平台: Windows OSX Linux Web 费用: 免费 技术: Web 介绍 Cmd Markdown 是一款使用 Web 技术开发的,全面且强大的 Markdown 编辑器。它拥有实时预览、离线编辑、智能同步、发布共享等功能,并提供了 Web 版和 Windows、OSX、Linux 平台的客户端,体验很棒。 截图