-
Notifications
You must be signed in to change notification settings - Fork 0
Installation and Usage
It's possible to use Carnap in a webapp without downloading anything. But if you'd like to create your own webpages or slideshows containing embedded proofs, you'll need to download a few files.
For basic usage, we suggest that you download the basic bundle available on our releases page. The basic bundle contains an optimized (extra small and extra fast) version of the main FOLbox javascript file, all the auxiliary javascript that Carnap needs to run, some basic css to make proofs look nice, and a pandoc filter. Using these, you'll be able to create webpages and slideshows containing interactive proofs in first-order logic, either by hand or with pandoc.
For more advanced usage---e.g. creating a new webapp or using Carnap in an offline application---just clone the repository. Please consider linking this wiki to any new resources that you create, on the outside resources page.
When the FOLBox script is run, it transforms any <textarea>
element with the class proofbox
into an interactive proof. Adding the lined
class decorates the interactive proof with line numbers and other nicites.
So, it's possible to create a webpage, run carnap, and immediately have some interactive proofs.
However, because proofs are somewhat whitespace sensitive and fragile in their formatting, we've also provided a way to use pandoc to easily create webpages and slideshows containing embedded proofs.
####Webpages with carnap and pandoc
To make a webpage with pandoc and carnap, first make sure you have pandoc installed on your computer. Then, write a document in Pandoc markdown. Include any proofs that you'd like to embed as code blocks, thus:
```proof
Show: P=>P
P PR
:CD 2
```
If the basic bundle is not in the same directory as your markdown document, then include, at the beginning of your markdown document, the following metadata block:
---
carnapBundlePath: INSERT THE FILEPATH OF THE BASIC BUNDLE HERE
... (you can also include additional metadata)
---
When you are finished writing your document and wish to create a webpage, invoke the following incantation from the command line:
pandoc ---filter INSERT_PATH_OF_BASIC_BUNDLE/carnapFilter --template INSERT_PATH_OF_BASIC_BUNDLE/PageTemplate.html -o INSERT_NAME_OF_GENERATED_WEBPAGE INSERT_NAME_OF_YOUR_MARKDOWN_DOCUMENT
####Slideshows with carnap, pandoc, and reveal.js
If you'd like to create a slideshow with reveal.js, carnap, and pandoc, then you can do more or less the same thing. You'll need to download a copy of reveal.js---you can do that here. Use pandoc's slideshow markdown to create a document, making sure to include the following metadata block:
---
carnapBundlePath: INSERT_THE_FILEPATH_OF_THE_BASIC_BUNDLE_HERE
revealjs-url: INSERT_PATH_TO_REVEAL.JS_DIRECTORY
viewDistance: THE_NUMBER_OF_SLIDES
... (you can also include additional metadata)
---
Then use this command to create your slides:
pandoc -t revealjs ---filter INSERT_PATH_OF_BASIC_BUNDLE/carnapFilter --template INSERT_PATH_OF_BASIC_BUNDLE/SlidesTemplate.html INSERT_PATH_TO_YOUR_MARKDOWN_DOCUMENT -o NAME_OF_NEW_SLIDES