markdown-playgrounds 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
markdown-playgrounds 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
markdown-playgrounds 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT License
开发语言 Swift
操作系统 OS X
软件类型 开源软件
开源组织
地区 不详
投 递 者 首席测试
适用人群 未知
收录时间 2021-12-02

软件简介

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

展开阅读全文

代码

评论

点击引领话题📣
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
0 评论
0 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部
返回顶部
顶部