Closed ryanoconnor7 closed 7 years ago
@playgroundbooks/contributors anyone have any ideas here?
The same problem over here! I would like to get to know if there is a comfy way to fully develop a playground book from XCode. Thanks!
There's a PR to change how we do things: https://github.com/playgroundbooks/playgroundbook/pull/34 You could pull down the code on that fork and try it out.
Interesting, it does make sense because once you create the file structure of a .playgroundbook, there's no actual .playground file left. So I guess what he did was for each chapter, enclose all of the stuff inside of Chapterq.playground. My only concern is that I'm pretty sure as per Apple's documentation you are required to name chapter's .playgroundchapter, so I wonder if it will recognize it. Rather than have a .playgroundchapter in book manifest, use Chapter1.playground.
It should work. i've just merged that pull request and released version 1.0.0 of the tool, which uses the new playgrounds page format. I'd appreciate any feedback y'all have on documentation, and let me know what other shortcomings there are with the tool. Thanks!
So what's the procedure to get a playgrounds book started with your repo? I apologize, I haven't really looked at it much.
That's a good question, I'm having some difficulty with it right now but I'm working on a fix and will get it to you asap, with instructions.
Thanks!
Okay so it looks like Xcode's playgrounds format may have changed since #34 was opened /cc @dionlarson I'm working on a fix now.
Okay, you're lucky you caught me when I had some spare time :wink: I've updated the tool to fix the bug I mentioned above, as well as improve the documentation. Basically, you need a directory that has a .yaml
file and a bunch of playgrounds (these will become your chapters). You add pages to the playgrounds and that's it. Here's an example that's working for me locally with version 1.1.0 of the tool:
It should generate a playground book that you can airdrop to your iPad. Autocomplete should work, too. More documentation has been added to the readme. Let me know if there are any questions, either here or in a new issue.
@ryanoconnor7 @Diiaablo95 Please try this out if you can and let me know if it works, hopefully we can get this issue closed and you can get back to working on your applications š
Thanks for your work!
Iām gonna give it a try in a couple of hours more or less, hoping it will do its job in the best way possible! :)
On 15 Mar 2017, at 20:05, Ash Furrow notifications@github.com wrote:
Okay, you're lucky you caught me when I had some spare time š I've updated the tool to fix the bug I mentioned above, as well as improve the documentation. Basically, you need a directory that has a .yaml file and a bunch of playgrounds (these will become your chapters). You add pages to the playgrounds and that's it. Here's an example that's working for me locally with version 1.1.0 of the tool:
test.zip https://github.com/playgroundbooks/playgroundbook/files/845713/test.zip It should generate a playground book that you can airdrop to your iPad. Autocomplete should work, too. More documentation has been added to the readme. Let me know if there are any questions, either here or in a new issue.
@ryanoconnor7 https://github.com/ryanoconnor7 @Diiaablo95 https://github.com/Diiaablo95 Please try this out if you can and let me know if it works, hopefully we can get this issue closed and you can get back to working on your applications š
ā You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/playgroundbooks/playgroundbook/issues/51#issuecomment-286847142, or mute the thread https://github.com/notifications/unsubscribe-auth/AGZNeJrFD9W8TaZciXMCEvvuuIIzGtyXks5rmDZ2gaJpZM4MbYdm.
Alright thanks I'll give it a try!
Works AMAZING! Great job!
We should maybe make an example book repo - so people can look at that as a reference, rather than infer it from our README?
@ryanoconnor7 - think you could turn your book into something applicable to anyone following along? I can make you a repo
So from start to finish? I'm pretty sure @ashfurrow 's test project does it pretty well, we just need to get the instructions down.
So maybe some instructions like this:
How to make a Playgrounds Book from start to finish
Download this .playground template: test.zip
Install framework that allows .playground to be converted to .playgroundbook
sudo gem install playgroundbook
Go back to the test project that you downloaded. Customize it by adding new .playground files for each chapter, and new Pages within the playground for each page.
Update test.yml file so that when converting, it knows what to include. These are all of the parameters available, but keep in mind the optionals. For a bare minimum, you should include name
, identifier
, imports
, and chapters
:
name: Testing book
identifier: com.ashfurrow.example
resources: assets # Optional
cover: cover.jpeg # Optional
deployment_target: ios10.0 # Optional
imports: # Optional, defaults to UIKit
- UIKit
- CoreGraphics
chapters:
- name: Chapter 1
edge_to_edge_live_view: false # defaults to true
live_view_mode: "VisibleByDefault" # defaults to "HiddenByDefault"
- name: Chapter 2
- etc...
glossary:
term: definition
cd Desktop/Xcode\ Projects/test
playgroundbook render test.yaml
name: Testing book
identifier: com.ryanoconnor.example
imports: # Optional, defaults to UIKit
- UIKit
- CoreGraphics
- SceneKit
chapters:
- name: Ryan O'Connor
live_view_mode: "VisibleByDefault" # defaults to "HiddenByDefault"
Testing your completed Playgrounds Book You can use Airdrop or iCloud Drive to get it on an iPad to test. Another workaround: Since my iPad isn't on the same iCloud account as my Mac and my school disabled Airdrop, email the .playgroundbook file to yourself, then on iPad, do action "Add to iCloud Drive", selected Playgrounds folder.
Those are great instructions @ryanoconnor7! I've invited you to join our GitHub organization, and I've created an empty repository that we could use to hold your instructions and sample code: https://github.com/playgroundbooks/example No pressure to accept! The example repo can look like whatever you want it to, whenever you have time. Let me know here or via email if I can help provide any guidance.
I'm going to close this issue as resolved, I've opened https://github.com/playgroundbooks/example/issues/1 to document things in the new repo.
Alright awesome @ashfurrow ! I know how to get the repository files up and stuff, but where should I put the instructions? In a separate file in the repo, maybe called instructions, or in the read me?
Readme makes sense to me š
Hi all, Once I get the file & folder structure for a .playgroundbook, I import necessary classes and put them in the sources folder. Then, on the individual Contents.swift files for each page, I try to reference the class and initialize it, add it to the live view, etc. Not only am I unable to get any autocomplete whatsoever, it does not show any suggestions for regular UIKit and Foundation stuff, like trying to create a new variable for a view, string, etc. Even when writing in the Class file from my other project that I copied over, it compiles/shows autocomplete in the separate playground, and once put in the .playgroundbook Project, nothing.
I'm thinking that it doesn't compile anything in Xcode, and will only actually compile once you load it onto the iPad, however, it doesn't seem practical to write all my code in a separate project so that I can get completition when writing.
I will get a project uploaded shortly.