Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playground Book in iPad #102

Merged
merged 25 commits into from
Dec 3, 2019
Merged

Playground Book in iPad #102

merged 25 commits into from
Dec 3, 2019

Conversation

miguelangel-dev
Copy link
Member

@miguelangel-dev miguelangel-dev commented Nov 27, 2019

Description

As a user, I would like to have Playgrounds with support for third party libraries in my iPad. I would like using nef generate a Playground with the whole dependencies compatible with my iPad.

How is it implemented?

It has been developed in functional programming using Bow. The project has been split in UI and Component

UI inside the SwiftPlayground folder you can find the command line script, in the end, it only gets the values from the command line and sends to Component (nef framework)

Component in framework NefSwiftPlayground you can find the whole logic for building a Swift Playground with the whole dependencies.

  • SwiftPlayground file makes the structure for building and resolves the dependencies using swift-package-manager.
  • PlaygroundBook builds the Playground Book compatible with iPad using the repositories.
  • Module is the model where describe how to build a repository compatible with Playground Book.

How is the project structured?

in command-line (bin folder - legacy)

nef (bash) -- use nef-project UI or another bash scripts

in nef project (project folder)

UI (SwiftPlayground) (CLI - main.swift)
|-- connect to Component (nef)(umbrella fw to NefSwiftPlayground, NefMardown, NefJekyll, NefCarbon...)
| -- using the Core (render) (playground page AST: CoreMarkdown, CoreJekyll, CoreCarbon...)

PUBLIC
UI - CLI scripts
Components - fw to use as a library (nef works as API umbrella)

PRIVATE
Core - renders the AST given a Playground page

Helpers - nef commands in Swift Playground

We have added some commands to help development in iPad. Between them, you can find:

  • PlaygroundColor: some predefined colours (nef, bow, ...)
  • PlaygroundLog: the whole necessary for logging in LiveView

How can I use it?

we can build a Swift Playground with third-party libraries using the next command:
nef-swift-playground --package <package path> --to <output path> --name <swift-playground name>

nef-ipad

@miguelangel-dev miguelangel-dev force-pushed the playground_ipad branch 5 times, most recently from 505ce63 to 2b962db Compare November 28, 2019 17:31
@miguelangel-dev miguelangel-dev force-pushed the playground_ipad branch 6 times, most recently from 5f54ca4 to 5058e8f Compare November 28, 2019 19:02
@miguelangel-dev miguelangel-dev force-pushed the playground_ipad branch 2 times, most recently from abe459f to 6c99d88 Compare November 28, 2019 19:13
@miguelangel-dev miguelangel-dev force-pushed the playground_ipad branch 2 times, most recently from 8fb13f7 to 7ebc0e8 Compare November 29, 2019 16:42
update SPM

simplify FP logic in addModules method
Package.swift Show resolved Hide resolved
project/Component/NefCommon/String+Path.swift Outdated Show resolved Hide resolved
project/Component/NefSwiftPlayground/SwiftPlayground.swift Outdated Show resolved Hide resolved
project/UI/SwiftPlayground/ConsoleOutput.swift Outdated Show resolved Hide resolved
project/UI/SwiftPlayground/ConsoleOutput.swift Outdated Show resolved Hide resolved
project/UI/SwiftPlayground/main.swift Outdated Show resolved Hide resolved
@miguelangel-dev miguelangel-dev merged commit 75ebb14 into develop Dec 3, 2019
@miguelangel-dev miguelangel-dev deleted the playground_ipad branch December 3, 2019 17:45
This was referenced Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants