Trinket proof of concept #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds several trinkets to the text and our basic publisher tools script.
I modified the trinket environment to accept a mandatory argument that is the filename. This is currently printed at the top of all trinkets, which causes a syntax error for now. An upcoming modification to our parser will automatically rename the main file to be this argument value. For now, comment or delete that first line and manually rename the file to test. These examples will magically start working when this update gets pushed.
The best way to test is to clone and
make -i trinket. Here's on of the chapters running from a dev server (crtl-f for1.4to find the first trinket:https://silshack-eah13.c9.io/trinkethtml/thinkjava6002.html
I did a quick search for
public classand added trinkets where they looked complete. To support multi-class programs, I believe we'll need to implement some sort of file reading capacity to the environment so when students are extending classes we can include those files in the trinkets that need them. Something like this:That'll require adding these java files into the repo somewhere. If they're already in another repo we could do a subtree or assume that that repo exists as a sibling to this one for trinket builds (or etc). There will be complexity if there are multiple files called e.g. Card.java but we can cross that bridge when we get there.
Aside: in the PDF and other non-html builds, the Filename argument in the Trinket environment could be used to label the code examples in the book with their filenames. That would let students map the example to the code files included with the book, making that part of reading it easier.
Some other PR notes:
trinketmake task Phony so it'd run every time for debugging purposes.gitignored/htmland/trinkethtmlsince we probably don't want to be committing build results. That can obviously be undone but seems best practice.