Skip to content

Commit eb07d10

Browse files
Merge pull request #101 from bow-swift/README
update README + Site - release 0.4
2 parents 433ea30 + 78e0892 commit eb07d10

File tree

16 files changed

+261
-62
lines changed

16 files changed

+261
-62
lines changed

README.md

+64-17
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,65 @@
55
<img src="https://travis-ci.org/bow-swift/nef.svg?branch=develop">
66
</a>
77
<a href="https://github.com/bow-swift/nef">
8-
<img src="https://img.shields.io/badge/platform-iOS%20%7C%20macOS-orange.svg" alt="Platforms">
8+
<img src="https://img.shields.io/badge/platform-macOS-orange" alt="Platforms">
9+
</a>
10+
<a href="https://github.com/bow-swift/nef">
11+
<img src="https://img.shields.io/badge/dependency%20manager-CocoaPods%20%7C%20Carthage-orange" alt="CocoaPods+Carthage compatible">
912
</a>
1013
<a href="https://gitter.im/bowswift/bow">
1114
<img src="https://img.shields.io/badge/gitter-nef-blueviolet.svg" alt="Gitter">
1215
</a>
1316

1417
</p>
1518

16-
`nef`, short for [Nefertiti](https://en.wikipedia.org/wiki/Nefertiti), mother of Ankhesenamun, is a command line tool to ease the creation of documentation in the form of Xcode Playgrounds. It provides compile-time verification of documentation, exports it in Markdown format that can be consumed by [Jekyll](https://jekyllrb.com/) to generate websites, and export [Carbon](https://carbon.now.sh/) snippets for given Xcode Playground.
19+
`nef`, short for [Nefertiti](https://en.wikipedia.org/wiki/Nefertiti), mother of Ankhesenamun, is a toolset to ease the **creation of documentation** in the form of Xcode Playgrounds. It provides compile-time **verification** of documentation, exports it in **Markdown** format that can be consumed by [Jekyll](https://jekyllrb.com/) to generate websites, and export [Carbon](https://carbon.now.sh/) snippets for a given Xcode Playground.
1720

1821
`nef` is inspired by [ΛNK](https://github.com/arrow-kt/ank) for Kotlin and [tut](https://github.com/tpolecat/tut) for Scala.
1922

20-
## 📥 Installation
23+
### Features
24+
25+
💡 Eases the creation of Xcode Playgrounds with support for [__third party libraries__](#-creating-a-xcode-playground).
26+
27+
💡 [__Compiles Xcode Playgrounds__](#-compiling-a-xcode-playground) with support for third party libraries from the command line.
2128

22-
`nef` can be installed using [Homebrew](https://brew.sh). `nef` needs Xcode and [Cocoapods](https://cocoapods.org) as dependencies. It will warn you if there is a missing dependency and will provide guidance to install it.
29+
💡 Generates [__Markdown__](#-generating-a-markdown-project) project from Xcode Playground.
30+
31+
💡 Generates Markdown files that can be consumed from [__Jekyll__](#-generating-markdown-files-for-jekyll) to create a microsite.
32+
33+
💡 Export [__Carbon__](#-exporting-carbon-code-snippets) code snippets for given Xcode Playgrounds.
34+
35+
&nbsp;
36+
37+
## 💻 Installation
38+
39+
#### 📟 Using [Homebrew](https://github.com/bow-swift/homebrew-nef) (preferred)
40+
41+
> It will warn you if there is a missing dependency and will provide guidance to install it.
2342
2443
<p align="center">
2544
<img src="assets/nef-installation.gif">
2645
</p>
2746

28-
## 🌟 Features
47+
#### 📦 Using [Swift Package Manager](https://developer.apple.com/documentation/xcode/creating_a_swift_package_with_xcode)
2948

30-
`nef` highlights the following features:
49+
`nef` can be consumed as a library in your **macOS project**.
3150

32-
💡 Eases the creation of Xcode Playgrounds with support for [__third party libraries__](#-creating-a-xcode-playground).
51+
```swift
52+
.package(url: "https://github.com/bow-swift/nef.git", from: "{version}")
53+
```
3354

34-
💡 [__Compiles Xcode Playgrounds__](#-compiling-a-xcode-playground) with support for third party libraries from the command line.
55+
> You can read more about how to use nef library in the [**nef site**](https://nef.bow-swift.io/docs/tutorials/how-to-use-nef-library-/).
3556
36-
💡 Generates [__Markdown__](#-generating-a-markdown-project) project from Xcode Playground.
57+
&nbsp;
3758

38-
💡 Generates Markdown files that can be consumed from [__Jekyll__](#-generating-markdown-files-for-jekyll) to create a microsite.
59+
#### 🔌 Using [Xcode Editor Extension](https://github.com/bow-swift/nef-plugin)
3960

40-
💡 Export [__Carbon__](#-exporting-carbon-code-snippets) code snippets for given Xcode Playgrounds.
61+
Some of the `nef` features can be used directly in Xcode as an Extension. You can install it directly from [**App Store**](https://apps.apple.com/app/nef/id1479391704?mt=8).
4162

4263
&nbsp;
4364

65+
## Usage
66+
4467
### 📃 Creating an Xcode Playground
4568

4669
Xcode Playgrounds are a nice tool for prototyping and trying new concepts. However, third party libraries support is a bit cumbersome to add. One of the goals of `nef` is to make the creation of an Xcode Playground easier with support for one or more libraries.
@@ -51,18 +74,28 @@ By default, `nef` can create an Xcode Playground with support for [Bow](http://b
5174
➜ nef playground
5275
```
5376

77+
<p align="center">
78+
<img src="assets/nef-playground.png" height="100">
79+
</p>
80+
5481
And you can use the following option to specify the name for the Xcode project that you are creating:
5582

5683
```bash
5784
➜ nef playground --name LatestBowProject
5885
```
5986

60-
It will create an Xcode project with support for the latest available version of Bow, named `BowPlayground`. If you open this Xcode project, you will have an Xcode Playground where you can import Bow or any of its modules, and start trying some of its features.
87+
It will create an Xcode project with support for the latest available version of Bow, named `LatestBowProject`. If you open this `nef playground`, you will have an Xcode Playground where you can import Bow or any of its modules, and start trying some of its features.
88+
89+
By default, `nef playground` will be created for iOS platform. If you need to change it, you can use the `--platform` option.
90+
91+
```bash
92+
➜ nef playground --platform osx
93+
```
6194

6295
###
6396

6497
<details>
65-
<summary>You can select any different Bow version or branch, even a third-party dependency</summary>
98+
<summary>📣 You can select any different Bow version or branch, even a third-party dependency</summary>
6699

67100
###
68101

@@ -86,7 +119,7 @@ It will create an Xcode project with support for the latest available version of
86119

87120
##
88121

89-
- `--podfile <Podfile>`: Specify a Podfile with your own dependencies. This option lets you create a Playground with support for other libraries. Create a `Podfile` listing your dependencies and pass it to `nef`. Example:
122+
- `--podfile <Podfile>`: Specify a **Podfile** with your own dependencies. This option lets you create a Playground with support for other libraries. Create a `Podfile` listing your dependencies and pass it to `nef`. Example:
90123

91124
Your `Podfile`, located in `./folder/dependencies`:
92125

@@ -103,6 +136,20 @@ end
103136
➜ nef playground --name MyPodsProject --podfile ./folder/dependencies/Podfile
104137
```
105138

139+
##
140+
141+
- `--cartfile <Cartfile>`: Specify a **Cartfile** with your dependencies. Create a `Cartfile` listing your dependencies and pass it to `nef`. Example:
142+
143+
Your `Cartfile`, located in `./folder/dependencies`:
144+
145+
```ruby
146+
github "bow-swift/Bow"
147+
```
148+
149+
```bash
150+
➜ nef playground --name MyCarthageProject --cartfile ./folder/dependencies/Cartfile
151+
```
152+
106153
</details>
107154

108155
&nbsp;
@@ -159,7 +206,7 @@ Options:
159206

160207
&nbsp;
161208

162-
### 🖥 Generating Markdown files for Jekyll
209+
### 🌐 Generating Markdown files for Jekyll
163210

164211
As you can write comments in [Markdown](https://developer.apple.com/library/archive/documentation/Xcode/Reference/xcode_markup_formatting_ref/index.html) in Xcode Playgrounds, this makes it very suitable to write documentation with compilable examples.
165212
Leveraging this, `nef` can create Markdown files that can be consumed from Jekyll to generate a microsite. The command to do this is:
@@ -177,7 +224,7 @@ Options:
177224
###
178225

179226
<details>
180-
<summary>How to setup an Xcode Playgroud for Jekyll?</summary>
227+
<summary>📣 How to setup an Xcode Playgroud for Jekyll?</summary>
181228

182229
###
183230

@@ -224,7 +271,7 @@ Options:
224271
###
225272

226273
<details>
227-
<summary>You can customize the output with the next commands</summary>
274+
<summary>📣 You can customize the output with the next commands</summary>
228275

229276
###
230277
<table>

assets/nef-carbon-example.png

-2.51 KB
Loading

assets/nef-playground.png

116 KB
Loading

bin/nef-jekyll

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ buildMicrosite() {
7575
permalink="/$BASE_JEKYLL/$playgroundName/$pageName/"
7676

7777
#clean up - jekyll folders without any whitespace
78-
output=`echo "$output" | tr -s ' ' '-' | awk '{print tolower($0)}'`
79-
permalink=`echo "$permalink" | tr -s ' ' '-' | awk '{print tolower($0)}'`
78+
output=`echo "$output" | tr -s '?' '-' | tr -s ' ' '-' | awk '{print tolower($0)}'`
79+
permalink=`echo "$permalink" | tr -s '?' '-' | tr -s ' ' '-' | awk '{print tolower($0)}'`
8080

8181
logFile="$LOG_PATH/$playgroundName-$pageName.log"
8282
log="$1/$logFile"

contents/Documentation/Integration.playground/Pages/Jekyll.xcplaygroundpage/Contents.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Nef.Playground.needsIndefiniteExecution(false)
1010
// nef:end
1111

1212
/*:
13-
## 🖥 Generating Markdown files for Jekyll
13+
## 🌐 Generating Markdown files for Jekyll
1414
As you can write comments in [Markdown](https://developer.apple.com/library/archive/documentation/Xcode/Reference/xcode_markup_formatting_ref/index.html) in Xcode Playgrounds, this makes very suitable to write documentation with compilable examples.
1515
Leveraging this, `nef` can create Markdown files that can be consumed from Jekyll to generate a microsite. The command to do this is:
1616

contents/Documentation/Quick start.playground/Pages/Creating an Xcode Playground.xcplaygroundpage/Contents.swift

+32-12
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,24 @@ Nef.Playground.needsIndefiniteExecution(false)
1818
```bash
1919
➜ nef playground
2020
```
21-
&nbsp;
22-
*/
23-
24-
/*:
25-
### Commands for creating a Xcode Playground
26-
You can use the following option to specify the name for the Xcode project that you are creating.
2721

22+
![](/assets/nef-playground.png)
23+
24+
And you can use the following option to specify the name for the Xcode project that you are creating:
25+
2826
```bash
2927
➜ nef playground --name LatestBowProject
28+
```
29+
30+
It will create an Xcode project with support for the latest available version of Bow, named `LatestBowProject`. If you open this `nef playground`, you will have an Xcode Playground where you can import Bow or any of its modules, and start trying some of its features.
31+
32+
By default, `nef playground` will be created for iOS platform. If you need to change it, you can use the `--platform` option.
33+
34+
```bash
35+
➜ nef playground --platform osx
3036
```
3137

32-
It will create an Xcode project with support for the latest available version of Bow, named `BowPlayground`. If you open this Xcode project, you will have a Xcode Playground where you can import Bow or any of its modules, and start trying some of its features.
33-
34-
&nbsp;
38+
&nbsp;
3539

3640
Besides this, you can select any different `Bow` version or branch, even a third-party dependency.
3741

@@ -43,15 +47,16 @@ Nef.Playground.needsIndefiniteExecution(false)
4347
➜ nef playground --name OldBowProject --bow-version 0.3.0
4448
```
4549

46-
___
50+
&nbsp;
4751

4852
- `--bow-branch <branch-name>`: Specify the branch of Bow that you want to use in the project. This option lets you test features of Bow that are still in development in a branch that has not been merged or released yet. Example:
4953

5054
```bash
5155
➜ nef playground --name BranchBowProject --bow-branch master
5256
```
5357

54-
___
58+
&nbsp;
59+
5560

5661
- `--podfile <Podfile>`: Specify a Podfile with your own dependencies. This option lets you create a Playground with support for other libraries. Create a `Podfile` listing your dependencies and pass it to `nef`. Example:
5762

@@ -69,5 +74,20 @@ Nef.Playground.needsIndefiniteExecution(false)
6974
```bash
7075
➜ nef playground --name MyPodsProject --podfile ./folder/dependencies/Podfile
7176
```
72-
&nbsp;
77+
78+
&nbsp;
79+
80+
81+
- `--cartfile <Cartfile>`: Specify a **Cartfile** with your dependencies. Create a `Cartfile` listing your dependencies and pass it to `nef`. Example:
82+
83+
Your `Cartfile`, located in `./folder/dependencies`:
84+
85+
```ruby
86+
github "bow-swift/Bow"
87+
```
88+
89+
```bash
90+
➜ nef playground --name MyCarthageProject --cartfile ./folder/dependencies/Cartfile
91+
```
92+
7393
*/

contents/Documentation/Quick start.playground/Pages/Installation.xcplaygroundpage/Contents.swift

+21-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
/*:
88
## 📥 Installation
99

10-
`nef` can be installed using [Homebrew](https://brew.sh). `nef` needs Xcode and [Cocoapods](https://cocoapods.org) as dependencies. It will warn you if there is a missing dependency and will provide guidance to install it.
11-
10+
📟 **Using** [**Homebrew**](https://github.com/bow-swift/homebrew-nef)
11+
12+
> It will warn you if there is a missing dependency and will provide guidance to install it.
13+
1214
```bash
1315
➜ brew tap bow-swift/nef
1416
➜ brew install nef
@@ -20,4 +22,21 @@
2022
➜ brew upgrade nef
2123
```
2224

25+
&nbsp;
26+
27+
📦 **Using** [**Swift Package Manager**](https://developer.apple.com/documentation/xcode/creating_a_swift_package_with_xcode)
28+
29+
`nef` can be consumed as a library in your **macOS project**.
30+
31+
```swift
32+
.package(url: "https://github.com/bow-swift/nef.git", from: "{version}")
33+
```
34+
35+
&nbsp;
36+
37+
38+
🔌 **Using** [**Xcode Editor Extension**](https://github.com/bow-swift/nef-plugin)
39+
40+
Some of the `nef` features can be used directly in Xcode as an Extension. You can install it directly from [**App Store**](https://apps.apple.com/app/nef/id1479391704?mt=8).
41+
2342
*/

contents/Documentation/Quick start.playground/contents.xcplayground

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<playground version='6.0' target-platform='ios' display-mode='rendered'>
2+
<playground version='6.0' target-platform='ios' display-mode='raw'>
33
<pages>
44
<page name='Installation'/>
55
<page name='Creating an Xcode Playground'/>

contents/Documentation/Tutorials.playground/Pages/First Steps with Carbon.xcplaygroundpage/Contents.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ In this tutorial, we assume you do not have any project, and we will follow up f
2222
```bash
2323
➜ nef playground --name TutorialCarbon
2424
```
25+
26+
![](/assets/nef-playground.png)
2527
*/
2628

2729
/*:
2830
&nbsp;
2931
### 2. Add content to Xcode Playground
3032

31-
Great! Go to `TutorialCarbon` and open its `xcworkspace`. It is an easy view where to see the future Playgrounds you will be creating and their pages.
33+
Great! Open `TutorialCarbon.app` playground. It is an easy view where to see the future Playgrounds you will be creating and their pages.
3234

3335
![](/assets/nef-playground-view.png)
3436

0 commit comments

Comments
 (0)